Encode to UTF-8 and then decode to TP.
MorgoZ
Posts: 116
Hello,
My app takes some user data from a TP keyboard.
I need to store that data in UTF-8 format, and then, show the UTF-8 formatted data on the TP again.
What i'm trying so far is:
1.- Encode the data received from the keyboard to UTF-8.
2.- Take the encoded data and show it on the TP:
But, the text at the TP is in blank.
I've also tried other ways to implement similar tests using _WC and wc_to_char or char_to_wc, but none worked for me.
Thanks for your help!!
My app takes some user data from a TP keyboard.
I need to store that data in UTF-8 format, and then, show the UTF-8 formatted data on the TP again.
What i'm trying so far is:
1.- Encode the data received from the keyboard to UTF-8.
wcAux = wc_decode(acDataText,WC_FORMAT_TP,1) scStudyCase.Patient.Name = wc_encode(wcAux,WC_FORMAT_UTF8,1)
2.- Take the encoded data and show it on the TP:
wcAux = wc_decode(acAux,WC_FORMAT_UTF8,1) acAux = wc_tp_encode(wcAux) send_command dvTp, "'^UNI-',itoa(anAddressItemData[nAux][4]),',0,',acAux"
But, the text at the TP is in blank.
I've also tried other ways to implement similar tests using _WC and wc_to_char or char_to_wc, but none worked for me.
Thanks for your help!!
0
Comments
finally, the solution was that i was receiving data from the TP input fields in ASCII format, so i just had to decode the ASCII data and encode it in UTF-8.
The code:
Then, with the data in UTF-8, i can properly store latin characters and use them in a server-PC's database.
Salutes!