Troubleshooting
Problem
Javascript Serialization.
Sending some objects over a Nirvana queue containing UTF-8 encoded strings, but when consumed, they are encoded differently, creating strange characters.
E.g. when we send:
"Some test text, a total of €230.3m (down 2.2% YoY) on – ALERT”
receive:
"Some test text, a total of ?230.3m (down 2.2% YoY) on ? ALERT” - FIREFOX
"Some test text, a total of â¬230.3m (down 2.2% YoY) on â ALERT" - Chrome
It works fine on an older IE (Internet Explorer) v8 browser.
With regards to the UTF-8 problems with the Nirvana Javascript library, perhaps the problem is that some browsers are using the native BTOA implementation, which does not support UTF-8 characters.
Details of this can be found at the following link:
A possible fix for this would be reverting to the Webtoolkit implementation within the Nirvana.js file that is currently in the code to support browsers that do not support BTOA.
It’s slower than native implementations, but it successfully decodes UTF-8 characters.
The JS code reference for this can be found at the following link:
http://www.webtoolkit.info/javascript-base64.html#.U_XPhxD6m3p
Lines affected in the Nirvana.js library are 1660:1670.
A possible solution would be to change 1660:1670 to:
base64Decode = nBase64Decode;
What are the options with UM/Universal Messaging now?
Document Location
Worldwide
Log InLog in to view more of this document
Was this topic helpful?
Document Information
Modified date:
20 March 2025
UID
ibm17210581