XML Encoding in PrimalXML

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 8 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
boj100
Posts: 2
Last visit: Tue Aug 18, 2015 12:12 pm

XML Encoding in PrimalXML

Post 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.
User avatar
SAPIEN Support Forums
Posts: 945
Last visit: Thu Oct 22, 2015 1:10 pm

XML Encoding in PrimalXML

Post 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 ***
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: XML Encoding in PrimalXML

Post 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 17456 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
David
SAPIEN Technologies, Inc.
User avatar
boj100
Posts: 2
Last visit: Tue Aug 18, 2015 12:12 pm

Re: XML Encoding in PrimalXML

Post 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.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: XML Encoding in PrimalXML

Post 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
David
SAPIEN Technologies, Inc.
This topic is 8 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.