ComposeXML

Just starting out? Need help? Post your questions and find answers here.
User_Russian
Addict
Addict
Posts: 1597
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

ComposeXML

Post 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.
User avatar
Kiffi
Addict
Addict
Posts: 1510
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: ComposeXML

Post 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
Hygge
freak
PureBasic Team
PureBasic Team
Posts: 5948
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: ComposeXML

Post 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.
quidquid Latine dictum sit altum videtur
Post Reply