how to use diacritical marks / accents in style file

I noticed that the style file rules (sometimes?) ignore diacritical marks or accents. For instance I want to add a rule to render a bigger lakes in lower resolution, like lake Geneva: this didnt work: natural=water & name="Lac Léman" [0x3d resolution 16] only this works: natural=water & name:en="Lake Geneva" [0x3d resolution 16] Same for name:de=Neuenburgersee (works) name="Lac de Neuchâtel" (didnt work) Is there a way to use those accents in the style file rules?

Another issue regarding accents: shop=* {set name="test äéöèô"} appears as shops with the name 'test ?????' on the map Any ideas?
I noticed that the style file rules (sometimes?) ignore diacritical marks or accents. For instance I want to add a rule to render a bigger lakes in lower resolution, like lake Geneva:
this didnt work: natural=water & name="Lac Léman" [0x3d resolution 16]
only this works: natural=water & name:en="Lake Geneva" [0x3d resolution 16]
Same for name:de=Neuenburgersee (works) name="Lac de Neuchâtel" (didnt work)
Is there a way to use those accents in the style file rules?

Is there a way to use those accents in the style file rules?
From Steve I got the tip to save the styles in UTF-8 (wthout BOM) which works now. Only problem is that the style file can't be edited anymore with windows notepad (no linefeeds), only with notepad++ If I save the text file as UTF-8 (which looks ok in notepad) mkgmap gives an error: Could not open style null

Have you tried Wordpad? Geoff Minko <ligfietser@online.nl> wrote:
Is there a way to use those accents in the style file rules?
From Steve I got the tip to save the styles in UTF-8 (wthout BOM) which works now. Only problem is that the style file can't be edited anymore with windows notepad (no linefeeds), only with notepad++ If I save the text file as UTF-8 (which looks ok in notepad) mkgmap gives an error: Could not open style null
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Use Notepad++ or Notepad2 instead on Windows, much better than the builtin editors - MS Wordpad and MS Notepad are notorious for breaking line endings... On 17.01.2013 22:47, Geoff Sherlock wrote:
Have you tried Wordpad?
Geoff
Minko <ligfietser@online.nl> wrote:
Is there a way to use those accents in the style file rules? From Steve I got the tip to save the styles in UTF-8 (wthout BOM) which works now.
Only problem is that the style file can't be edited anymore with windows notepad (no linefeeds), only with notepad++ If I save the text file as UTF-8 (which looks ok in notepad) mkgmap gives an error: Could not open style null
------------------------------------------------------------------------
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

MS Wordpad and MS Notepad are notorious for breaking line endings... don't ever use them with mkgmap style-files... You can check line endings with Notepad++ On 17.01.2013 22:47, Geoff Sherlock wrote:
Have you tried Wordpad?
Geoff
Minko <ligfietser@online.nl> wrote:
Is there a way to use those accents in the style file rules? From Steve I got the tip to save the styles in UTF-8 (wthout BOM) which works now.
Only problem is that the style file can't be edited anymore with windows notepad (no linefeeds), only with notepad++ If I save the text file as UTF-8 (which looks ok in notepad) mkgmap gives an error: Could not open style null
------------------------------------------------------------------------
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- keep on biking and discovering new trails Felix openmtbmap.org & www.velomap.org

On 17/01/13 21:41, Minko wrote:
Is there a way to use those accents in the style file rules?
From Steve I got the tip to save the styles in UTF-8 (wthout BOM) which works now. Only problem is that the style file can't be edited anymore with windows notepad (no linefeeds), only with notepad++ If I save the text file as UTF-8 (which looks ok in notepad) mkgmap gives an error: Could not open style null
That ought to be a separate problem to the file being in utf-8. Although the files in the default style as distributed have unix line endings, they should work equally well with dos line endings and if not it can be fixed. It does work with dos line ending on linux - I just tried it to check. ..Steve

Here are my findings (tested on a windows computer): Saving one of the (default) style files as ansi (default) in Notepad++ everything is fine, except for the accents (doesnt work). If I save them as UTF-8 without BOM (whatever that means) accents are ok Saving them as UTF-8, mkgmap aborts with Error in style: Error: (polygons:3): Stack size is 5 Could not open style null Files saved in UTF-8 (with or without BOM) aren't editable with notepad Steven wrote:
That ought to be a separate problem to the file being in utf-8. Although the files in the default style as distributed have unix line endings, they should work equally well with dos line endings and if not it can be fixed. It does work with dos line ending on linux - I just tried it to check.
..Steve
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Minko, please send the file(s) that produces the error message. My 50 cent regarding editors on Windows: I use PSPad http://www.pspad.com/en/download.php It can handle utf-8 and all kinds of line endings and also quite large files. Ciao, Gerd
Date: Fri, 18 Jan 2013 09:51:27 +0100 From: ligfietser@online.nl To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] how to use diacritical marks / accents in style file
Here are my findings (tested on a windows computer):
Saving one of the (default) style files as ansi (default) in Notepad++ everything is fine, except for the accents (doesnt work). If I save them as UTF-8 without BOM (whatever that means) accents are ok Saving them as UTF-8, mkgmap aborts with Error in style: Error: (polygons:3): Stack size is 5 Could not open style null
Files saved in UTF-8 (with or without BOM) aren't editable with notepad
Steven wrote:
That ought to be a separate problem to the file being in utf-8. Although the files in the default style as distributed have unix line endings, they should work equally well with dos line endings and if not it can be fixed. It does work with dos line ending on linux - I just tried it to check.
..Steve
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Wikipedia says that notepad always puts a BOM at the begining of the file when it saves as utf-8. This appears as an odd character at the beginning of the file to Java programs. I can add code to skip it. ..Steve

Attached patch fixes so that a BOM will be ignored. This applies to all files read with TokenScanner which includes the styles, the command line options files (-c) the TYP text format and the SRT text format. Pre-built jar: http://files.mkgmap.org.uk/download/82/mkgmap.jar ..Steve

Thanks Steve, With the patch it looks like the accents are working now if i save it normal way (ANSI). UTF-8 is fine now too. Maybe this is related to other recent changes but I only got a bunch of errors related to the Sea generator Error in style: Error: (polygons:4): Stack size is 4 SEVERE (SeaGenerator): splitter\10010001.osm.pbf: uk.me.parabola.imgfmt.ExitException: Could not open style default uk.me.parabola.imgfmt.ExitException: Could not open style default In my polygons test file I only have include 'inc/address'; natural=sea [0x32 resolution 12] natural=background [0x010100 resolution 14]
Attached patch fixes so that a BOM will be ignored. This applies to all files read with TokenScanner which includes the styles, the command line options files (-c) the TYP text format and the SRT text format.
Pre-built jar: http://files.mkgmap.org.uk/download/82/mkgmap.jar
..Steve

Hi Minko, I saw these error messages when I build mkgmap within eclipse. I created a new project from the ant build file and that fixed the problem. If you see them outside of eclipse, try ant clean && ant dist Gerd
Date: Fri, 18 Jan 2013 11:31:26 +0100 From: ligfietser@online.nl To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] how to use diacritical marks / accents in style file
Thanks Steve, With the patch it looks like the accents are working now if i save it normal way (ANSI). UTF-8 is fine now too.
Maybe this is related to other recent changes but I only got a bunch of errors related to the Sea generator Error in style: Error: (polygons:4): Stack size is 4 SEVERE (SeaGenerator): splitter\10010001.osm.pbf: uk.me.parabola.imgfmt.ExitException: Could not open style default uk.me.parabola.imgfmt.ExitException: Could not open style default
In my polygons test file I only have
include 'inc/address';
natural=sea [0x32 resolution 12] natural=background [0x010100 resolution 14]
Attached patch fixes so that a BOM will be ignored. This applies to all files read with TokenScanner which includes the styles, the command line options files (-c) the TYP text format and the SRT text format.
Pre-built jar: http://files.mkgmap.org.uk/download/82/mkgmap.jar
..Steve
mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

On 18/01/13 10:31, Minko wrote:
Maybe this is related to other recent changes but I only got a bunch of errors related to the Sea generator Error in style: Error: (polygons:4): Stack size is 4 SEVERE (SeaGenerator): splitter\10010001.osm.pbf: uk.me.parabola.imgfmt.ExitException: Could not open style default uk.me.parabola.imgfmt.ExitException: Could not open style default
Yes that is almost certainly the same problem. ..Steve
participants (5)
-
Felix Hartmann
-
Geoff Sherlock
-
Gerd Petermann
-
Minko
-
Steve Ratcliffe