-
Notifications
You must be signed in to change notification settings - Fork 11
RFC: UTF 8 Support in EasyXML #6
- Date: 2020-02-25
- Author: Jim Kring
- Discussion: Here
EasyXML does not do any treatment of string data when writing to or reading from XML, which means that it's not necessarily UTF-8 encoded when there are special characters like the degrees character ("°") in "°C". This causes problems for some XML parsers (e.g. Excel) when these special characters are found in the data. It would be good if EasyXML would do proper UTF-8 encoding.
Use the primitive LabVIEW string to UTF-8 conversion functions, shown below, to UTF-8 encode/decode the data.


These functions could be called inside of "Easy Generate XML" and "Easy Parse XML" to handle the encoding and decoding of UTF-8 data.
We would add a new input to "Easy Generate XML" called "Encoding" and if the value is "UTF-8" then we would encode the data as such (question: should we default to UTF-8? would that hurt anyone's existing code that relied on the old behavior?)

We would add some smarts inside of "Easy Parse XML" to check for the encoding inside of the root "" tag (e.g. "<?xml version="1.0" encoding="UTF-8"?">

- Should the new Encoding input on "Easy Generate XML" default to "UTF-8"? would that hurt anyone's existing code that relied on the old behavior?)