Page 1 of 1

ComposeXML

Posted: Fri Nov 27, 2015 3:56 pm
by User_Russian

Code: Select all

CreateXML(0, #PB_UTF8)
Debug ComposeXML(0)
Result.
<?xml version="1.0" encoding="UTF-16"?>
Why UTF-16?
Must be UTF-8.

Re: ComposeXML

Posted: Fri Nov 27, 2015 4:04 pm
by Kiffi
confirmed. Same with:

Code: Select all

CreateXML(0, #PB_Ascii)
Debug ComposeXML(0)
PB-Debugger wrote:<?xml version="1.0" encoding="UTF-16"?>
When i deactivate unicode in the compiler settings i always get ISO-8859-1:
PB-Debugger wrote:<?xml version="1.0" encoding="ISO-8859-1"?>
Greetings ... Peter

Re: ComposeXML

Posted: Fri Nov 27, 2015 6:01 pm
by freak
The entire purpose of the function is to return a PB string. If the string format is unicode and the function would return utf-8 then the PB string would contain garbage.

Its documented: http://www.purebasic.com/documentation/ ... sexml.html
The XML will be returned in the string format of the executable (Ascii or Unicode) independent of the setting returned by GetXMLEncoding(). The ExportXML() function can be used to create markup in a different encoding.