Hi Ticker, okay, maybe you find time to implement a better solution. I've committed the patch with r4838.
@Arndt: Please check if this solves the problems with your maps. Not sure about this because you said mkgmap stops without any reaction while this problem was a loop. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-boun...@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkg...@jagit.co.uk> Gesendet: Dienstag, 28. Dezember 2021 13:20 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] r4836 stops Hungary & Romania Hi Gerd This fix is reasonable in the short term but has some problems: If the invalid UTF16 string is output by other means (eg diagnostics), it could cause a (more conventional) crash - but probably not looping. Anything concatenated onto this string will be lost - this could be fixed by initialising the encoder with onMalformedInput(CodingErrorAction.IGNORE); instead of catching the error. The full fix would required looking at all substr and character indexing operations on string data from OSM tags and using Character.is[High/Low/]Surrogate() or similar logic and adjusting the start/end char index or whatever Ticker On Tue, 2021-12-28 at 07:23 +0000, Gerd Petermann wrote: > Hi all, > > I was able to reproduce with option --latin1 and the modified default > style. > > The offending node seems to be > https://www.openstreetmap.org/node/9122388694 > > mkgmap loops in method AnyCharsetEncoder.encodeText(String text) > I guess the same can happen when labels are cut at length 170. > > The attached patch seems to fix this, but I have no idea if this is > the right approach. > > Gerd > > ________________________________________ > Von: mkgmap-dev <mkgmap-dev-boun...@lists.mkgmap.org.uk> im Auftrag > von Ticker Berkin <rwb-mkg...@jagit.co.uk> > Gesendet: Montag, 27. Dezember 2021 20:06 > An: Development list for mkgmap > Betreff: Re: [mkgmap-dev] r4836 stops Hungary & Romania > > Looks like uft16 surrogate pair chars are being separated by the > substr. > > Ticker > > > > On Mon, 2021-12-27 at 19:28 +0100, Arndt Röhrig wrote: > > ...mayby is in the osm data a kryptic text like this: > > > > https://www.openstreetmap.org/node/9115233473 > > > > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev@lists.mkgmap.org.uk > https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev@lists.mkgmap.org.uk > https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev