[mkgmap-dev] r4836 stops Hungary & Romania
From Ticker Berkin rwb-mkgmap at jagit.co.uk on Tue Dec 28 12:20:00 GMT 2021
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-bounces at lists.mkgmap.org.uk> im Auftrag > von Ticker Berkin <rwb-mkgmap at 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 at lists.mkgmap.org.uk > https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev at lists.mkgmap.org.uk > https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
- Previous message: [mkgmap-dev] r4836 stops Hungary & Romania
- Next message: [mkgmap-dev] r4836 stops Hungary & Romania
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the mkgmap-dev mailing list