Encode a string from UTF-8 to ANSI(without changing special characters in string)

HI,
Can someone please explain how to encode a string from UTF-8 to ANSI without effecting or missing the special characters in the string.

Thanks in advance

Hi – There is no such built-in service to transform till wm8 Version, so you should go for writing java service. Not sure if any built-in service in 9.8 or 9.9 versions.

Thanks,

In a Java environment, a String is always encoded in UTF-16. You care about encoding only when you need to convert from/to bytes.

you can use:
pub.string:stringToBytes
pub.string:bytesToString
and specify the encoding of the Bytes. It’s supported since beginning of WM, all versions.

BTW, if you mean ASCII, it doesn’t support many special characters, if you are converting from UTF-8 bytes, you may end up with ??? in places of special characters.