UCS-2

Started by Michael Greer, May 05, 2022, 05:25:42 PM

Previous topic - Next topic

Michael Greer

I am having trouble using the SalesForce API and it appears it might be because those endpoints require UCS-2 encoding.  Can anyone verify this, and more importantly does anyone have a function or routine that creates that encoding.

Thanks!
Michael

Mike King

UCS-2 appears to be similar to 16 bit Unicode which you can generate using the PxPlus CVS function.

It is however odd that any web based system would require UCS-2 data, normally web processes will use UTF-8 thereby keeping all data 8 bits and provides supports for a wider of characters.
Mike King
President - BBSysco Consulting - http://www.bbsysco.com
eMail: mike.king@bbsysco.com

Michael Greer

Thanks Mike. It is not clear to me using the cvs function how I specify 16 bit UTF-8.

Mike King

To the best of my knowledge there is no such thing as 16 bit UTF-8.  UTF-8 data is always a string of 8-bit values.

If you want UCS-2 you may be able to do:

   X$=CVS("This is a test","ASCII:UNICODE")

This will provide you a string of 16 bits characters

Mike King
President - BBSysco Consulting - http://www.bbsysco.com
eMail: mike.king@bbsysco.com