You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How does itoolkit handle special character's for xml? The example below returns *BADPARSE. Our understanding is that CDATA should allow for the use of special characters. I think in this case it's a period (.)
It appears that in your output you have the string "Kyle?s van" where ? is a substitute character (0x1A in UTF-8). As XML does not allow control characters other than tab, LF, and CR this causes a parsing error.
We could try to work around this by replacing any substitute characters with the U+FFFD Unicode replacement character, which is allowed. I don't know if this is what you want, though, since your data will still have "garbage" in it. Probably better to investigate why the output is getting converted improperly in the first place. Looking at the output, I'm guessing the data contains some sort of smart quote/apostrophe, eg. Kyle’s van instead of Kyle's van.
Note that the IBM i Access ODBC driver uses the locale's encoding for character conversions. By default Unix applications start up in the "C" locale, which uses CCSID 819 in the driver (ISO-8859-1). Likely what you want is to use a UTF-8 locale sent by your environment variables. This can be called from your main application in Python with the example shown here: https://docs.python.org/3/library/locale.html#locale.setlocale
Alternatively, if you don't want (or can't) set the locale, you can set CCSID=1208 in your connection string or DSN to override the locale's encoding with UTF-8.
Describe the bug
How does itoolkit handle special character's for xml? The example below returns *BADPARSE. Our understanding is that CDATA should allow for the use of special characters. I think in this case it's a period (.)
3e3c215b43444154415b4b796c651a73 ><![CDATA[Kyle.s2076616e5d5d3e3c2f646174613e0a3c van]]></data>.<
XML_IN:
XML_OUT:
Trace
The text was updated successfully, but these errors were encountered: