On 6 December 2016 2:29:40 pm Lynn Deffenbaugh <[email protected]> wrote:

0xEF 0xBB 0xBF is a UTF-8 Byte Order Marker.
 See https://en.wikipedia.org/wiki/Byte_order_mark

On Monday, December 5, 2016 at 6:11:13 PM UTC-5, A Thompson wrote:

Thank you Nick! That's very helpful and explains why my renderer with
underscores in its filename stopped working after a recent update, and was
fixed by renaming the file.

It doesn't explain why I was getting that same error toast message with
Roger's renderer named "IslandKiller.render.xml" above, and you inspired me
to get to the bottom of it:

   - *Conclusion*: The IslandKiller renderer *does *work with the current
   release of OsmAnd, which otherwise still shows "Great Britain" annoyingly.
   But if one makes a renderer file by copy and paste from a web page, it's
   possible to insert non-displaying characters that mess-up the reading of
   the file.
   - *Details*: Entirely on my phone, I copied the renderer above to the
   clipboard from the Opera browser. Then using ES File Explorer I created a
   new file in OsmAnd's rendering folder, renamed it appropriately, opened it
   for editing in ES Note Editor, pasted in the text from the clipboard, and
   saved the file. The text looked to be correct, but the renderer won't load.
   But by other means I could create a file that appeared identical and yet
   worked! Inspecting the failing file with a binary/hex viewer I discovered a
   few special characters that weren't being displayed. For example, after the
   opening "<" are extra characters 0xEF, 0xBB and 0xBF before it continues
   correctly with "renderingstyle..." The extra characters aren't displayed at
   all in ES Note Editor, but they aren't white-space so it's not surprising
   that they thwarted OsmAnd from reading the .xml. I expect things would be
   different with other editors and operating systems, but if anyone else has
   inexplicable problems with renderers taken from websites by copy-and-paste
   (even partly), then be warned!




Oops, my bad. I checked the file on my system. At least one of the copies had the utf-8 BOM in it. I probably posted that one. I think I probably opened it in an XML editor that 'corrected' it by putting the utf-8 marker in it. All my Linux systems are set to utf-8 by default. As most 'full' XML parser handle utf-8 I suspect osmand is using a cut down inbuilt parser.

I wonder if putting a real XML header on the fragment would work ;-)

<?xml version="1.0" encoding="utf-8"?>

I have come across this problem before with XML 'like' config files.

Roger

--
You received this message because you are subscribed to the Google Groups 
"Osmand" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to