Page 1 of 1

XML Encoding in PrimalXML

Posted: Tue Aug 18, 2015 9:33 am
by boj100
Is it possible to change and/or specify the default XML Encoding in PrimalXML?

We would like to have "UTF-8" as the default XML Encoding in PrimalXML.

After multiple tries, it seems the default XML Encoding in PrimalXML version 2012 (build 3.0.17) and in version 2014 (build 4.0.31) is "Unicode". In the version 2015 (build 4.1.37), it is "AINSI".

We tried to "force" the XML Encoding by adding the element <test>àéèëêîôûù ÀÉÈËÊÎÔÛÙ</test> to our file, but the Encoding of our file remains "Unicode" in the version 2012 and 2014 of PrimalXML.

In the version 2015 though, it does save the file with the "UTF-8" encoding.

We tried to specify the encoding in the header of version 2012 and 2014 with the string <?xml version="1.0" encoding="UTF-8"?>, but the XML Encoding remains "Unicode" in both version 2012 and 2014.

We did our tests in Windows 7 32 bits and 64 bits, same results.

In the end, is it possible to change and/or specify the default XML Encoding in PrimalXML as "UTF-8"?

Thank you for your help.

XML Encoding in PrimalXML

Posted: Tue Aug 18, 2015 9:33 am
by SAPIEN Support Forums
This is an automated post. A real person will respond soon.

Thank you for posting, boj100.

Did you remember to include the following?
  • 1. Product, version and build (e.g. Product: PrimalXML 2014, Version & Build: 4.0.31. Version and build information can be found in the product's About box accessed by clicking the blue icon with the 'i' in the upper right hand corner of the ribbon.)
    2. Specify if you are running a 32 or 64 bit version
    3. Specify your operating system and if it is 32 or 64 bit.
    4. Attach a screenshot if your issue can be seen on the screen
    5. Attach a zip file if you have multiple files (crash reports, log entries, etc.) related to your issue.
If not, please take a moment to edit your original post or reply to this one.

*** Make sure you do not post any licensing information ***

Re: XML Encoding in PrimalXML

Posted: Tue Aug 18, 2015 10:03 am
by davidc
In the v4.1.37 service build of PrimalXML 2015 we change the default encoding of PrimalXML to UTF-8, but it will retain the encoding of an existing file.

You can change the encoding of the file in PrimalXML 2015 (v4.1.37) by using right-clicking on the encoding in status bar:
PrimalXML Encoding Status Bar.png
PrimalXML Encoding Status Bar.png (3.19 KiB) Viewed 17485 times
Note: UTF-8 is similar to ANSI. The difference will be noted when a non-ANSI character is used. The standard seems to have a UTF-8 file without a BOM.

FYI, I added a feature request to force the encoding from the ?xml tag.

David

Re: XML Encoding in PrimalXML

Posted: Tue Aug 18, 2015 10:52 am
by boj100
Hi,

Thank you for the reply.

We did some new tests with the v4.1.37 service build of PrimalXML 2015 in Windows 7 32bits and 64 bits, and even if the "UTF-8" is specified in the encoding status bar, the encoding of a brand new file changes to "ANSI" when the file is saved.

Our tests were done by opening the program, creating a brand new file (menu File-> New) and without adding anything else into the file except keeping the <?xml version="1.0"?> tag added by default.

Selecting "Unicode Litle Endian" keeps the same encoding when the file is saved.
Selecting "Unicode Big Endian" keeps the same encoding when the file is saved.
Selecting "ASCII" changes the encoding to "ANSI".
Selecting "UTF-8" changes the encoding to "ANSI".

Since our XML files includes french accents, the files needs to be saved with the "UTF-8" encoding and keep it.

Thank you for your help.

Re: XML Encoding in PrimalXML

Posted: Tue Aug 18, 2015 3:01 pm
by davidc
ANSI is a subset of UTF-8.
UTF-8 is saved without a BOM and files often will list it as ANSI / ASCII.

Next service release when a file is loaded it will display UTF-8 (which mimics the XML standards).

David