Hi All,
I found the root cause and fix for this in case anyone encountered the same issue.
So the root cause is the conversion from buffer to String. Default is UTF-8.
I need to change that to latin1, which is ISO-8859-1 encoding. Then the symbol ± is displayed correctly.
The code snippet looks like this:
let str = buffer.toString('latin1');
------------------------------
Geoff Xu
------------------------------
Original Message:
Sent: Sun September 03, 2023 11:52 PM
From: Geoff Xu
Subject: How to parse special symbol ± in gateway script
Hi All,
I am trying to convert a non-XML input to XML using gateway script.
There is one special scenario I have encountered. The input data had a special symbol ± in the data.
When outputted by gateway script, the value of this symbol got converted to � by DataPower.
Is there any way to preserve the symbol on the output?
Any help is much appreciated.
Thanks,
Geoff
------------------------------
Geoff Xu
------------------------------