I have built an encryption function for an application in PB 6.5, it works fine, it takes the data of a person, encrypts it and stores the resulting string in the database. In the other hand, I have access to this data in an application built in PB 10.5 (because both application share the database).
The problem is I cannot recover the data correctly 🙁
I googled it and I have read some documentation. I know PB6.5 uses ANSI codification and PB10.5 uses UTF-16LE, so I have tried the functions I found in the documentation to see what I get:
lb_text = Blob(original_string, EncodingANSI!)
ls_string1 = String(lb_text, EncodingANSI!)
ls_string2 = String(lb_text, EncodingUTF16LE! )
ls_string1 gave me a string that is very similar to the original string encoded with PB6.5 and ls_string2 gave me a string that is a sequence of the ‘square character’: 㔐
My question is:
Is there a way to standardize the encoding between diferents versions of PB? or…
Is there a function (in PB10.5) to convert a string to the encoding I need?
The problem was in my encrypting function: I used a string (ascii_string) with ASCII characters from 1 to 255 to encode the data, but I found there are ‘strange’ characters in positions 1 until 31.
So, in PB6.5 I did:
and for PB 10.5:
and it works for each versions!