PxPlus User Forum

Twitter Twitter Twitter

Author Topic: UCS-2  (Read 833 times)

michaelgreer

  • Diamond Member
  • *****
  • Posts: 129
    • View Profile
UCS-2
« on: May 05, 2022, 05:25:42 PM »
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

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: UCS-2
« Reply #1 on: May 06, 2022, 08:11:04 AM »
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
eMail: mike.king@bbsysco.com

michaelgreer

  • Diamond Member
  • *****
  • Posts: 129
    • View Profile
Re: UCS-2
« Reply #2 on: May 06, 2022, 09:25:53 AM »
Thanks Mike. It is not clear to me using the cvs function how I specify 16 bit UTF-8.

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: UCS-2
« Reply #3 on: May 06, 2022, 02:17:10 PM »
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
eMail: mike.king@bbsysco.com