Hi,
we are currently using Powerbuilder 2017/R3 Build 1858. We have an issue regarding UTF8 character encoding. We have to send a string UTF8 encoded to an external software (function is called directly in Powerbuilder).
Problem with eg. special german letters (ü,ä, …)
If there is such a letter in this string (surname, firstname, …) this string isn’t encoded with correctly with UTF8, irrespective if what I do (because of Powerbuilder uses UFT16LE internally?)
This is my test:
// Test
String ls_in = "ü"
String ls_out
Blob lbl_hex
coderobject lnvo_coderobject
lnvo_coderobject = Create coderobject
lbl_hex = Blob(ls_in)
ls_out = lnvo_coderobject.HexEncode(lbl_hex)
MessageBox("UTF16 - FC00", ls_out) // correct hexvalue
lbl_hex = Blob(ls_in, EncodingUTF8!)
ls_out = lnvo_coderobject.HexEncode(lbl_hex)
MessageBox("UTF8 - C3B3", ls_out) // correct hexvalue
ls_out = String(lbl_hex, EncodingUTF8!)
// Hex: FC00 – wrong hex values (checked it with an external editor)
Destroy lnvo_coderobject
Is there a possibility to convert/create this string with an UTF8 encoding (means HEX: C3B3)?
Thanks,
Andreas