This code should "copy" files (with minor changes, maybe - spaces, EOLs etc). Instead, it changes the way the Polish characters are represented:
GPX=LoadXML(#PB_Any,"GPSdata_in.gpx",#PB_UTF8)
SaveXML(GPX,"GPSdata_out.gpx")
Of course the file GPSdata_in.gpx is a valid XML document (created by the GPS unit or GPS software) with the UTF-8 encoding. 2 GPS devices and at least 3 different programs (English language ones) understand those Polish characters correctly.
I have found one way to keep them intact: Load the XML as it was in #PB_Ascii encoding. But after saving it changes the XML header (to "ISO-8859-1"), thus the GPS device reads such a file misinterpreting characters...If you manually change the XML header in the file created this way back to "UTF-8", everything is OK.
Same messy problems with the creation of XML (CreateXML(...) command). Polish characters from the text fields are encoded the wrong way.
And additionally, to make things even worse, the text fields read from the XML are displayed the wrong way on the screen (always, both when the XML was loaded as UTF-8 as well as Ascii)
Something is wrong here the very strange way...
Something doesn't work with XML encoding
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Something doesn't work with XML encoding
I have no idea what the cause of the issue is, but make sure:
1) Use PB5.30
2) Compiler/Compiler Options/Create Unicode executable
3) File/Preferences/Compiler/Defaults/Source file Text encoding: UTF-8
1) Use PB5.30
2) Compiler/Compiler Options/Create Unicode executable
3) File/Preferences/Compiler/Defaults/Source file Text encoding: UTF-8
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Something doesn't work with XML encoding
Thanks a lot! I have previously tried checking option "unicode executable" in the compiler preferences, with no success. But haven't tried those File/preferences settings. Checked UTF-8 and unicode executable ("second instance" here) and everything now is perfectly fine! 
