use of uk.me.parabola.imgfmt.app.labelenc.CharacterDecoder in project mkgmap by openstreetmap.
the class TREFileReader method getMapInfo.
public String[] getMapInfo(int codePage) {
CodeFunctions funcs = CodeFunctions.createEncoderForLBL(0, codePage);
CharacterDecoder decoder = funcs.getDecoder();
// First do the ones in the TRE header gap
ImgFileReader reader = getReader();
reader.position(header.getHeaderLength());
List<String> msgs = new ArrayList<>();
while (reader.position() < header.getHeaderLength() + header.getMapInfoSize()) {
byte[] m = reader.getZString();
decoder.reset();
for (byte b : m) decoder.addByte(b);
DecodedText text = decoder.getText();
String text1 = text.getText();
msgs.add(text1);
}
return msgs.toArray(new String[msgs.size()]);
}
Aggregations