logo separator

[mkgmap-dev] style file reader patch

From Mike Baggaley mike at tvage.co.uk on Thu Jan 26 00:23:22 GMT 2017

Bizarre, I have just reinstated the original code for handling UTF-8 and it
is no longer crashing. Can't think of anything I've changed in the
environment, other than the points file now contains a lot more statements
in it. I'll leave the original code in place and see if the crash recurs and
if so try to find out what exactly is happening.

Regards,
Mike

-----Original Message-----
From: Gerd Petermann [mailto:GPetermann_muenchen at hotmail.com] 
Sent: 19 January 2017 12:25
To: Development list for mkgmap <mkgmap-dev at lists.mkgmap.org.uk>
Subject: Re: [mkgmap-dev] style file reader patch

Hi Mike,

I am also using Windows.

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Mike
Baggaley <mike at tvage.co.uk>
Gesendet: Donnerstag, 19. Januar 2017 13:20:16
An: 'Development list for mkgmap'
Betreff: Re: [mkgmap-dev] style file reader patch

Hi Gerd, This may be a platform specific problem. I am running on Windows.
Notepad and Visual Studio say my file is UTF-8 encoded, but it fails to load
with the accented character in it. It does load with the patch. Is there
anyone else using Windows who can try the line?

Regards,
Mike

-----Original Message-----
From: Gerd Petermann [mailto:GPetermann_muenchen at hotmail.com]
Sent: 18 January 2017 13:52
To: Development list for mkgmap <mkgmap-dev at lists.mkgmap.org.uk>
Subject: Re: [mkgmap-dev] style file reader patch

Hi Mike,

I am not able to reproduce the problem. I've added the line to the default
style points file
and mkgmap doesn't complain about it.
My editor (PSPad) "says" that the points file is a utf-8 encoded unix  file,
a hex editor shows no BOM.

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Mike
Baggaley <mike at tvage.co.uk>
Gesendet: Samstag, 14. Januar 2017 23:21:22
An: mkgmap-dev at lists.mkgmap.org.uk
Betreff: [mkgmap-dev] style file reader patch

Hi Gerd, I have found that the style file reader does handle non ASCII
characters properly. With the following line in my points file:

amenity=cafe & name~'[Cc]af[eé]' {echotags 'Description as name'; delete
name}

I get an error:

Error in style : error : (points:142): Bad character in input, file probably
not in utf-8

This happens whether or not I save the points file as UTF-8.

The attached patch fixes the problem.

Can you please try it and commit if it is OK (you may want to change the
RuntimeException)?

Thanks,
Mike



_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev




More information about the mkgmap-dev mailing list