PowerBuilder - 不同编码 PB 6.5 - PB 10.5
我在 PB 6.5 中为应用程序构建了一个加密函数,它工作正常,它获取一个人的数据,对其进行加密并将结果字符串存储在数据库中。另一方面,我可以在 PB 10.5 中构建的应用程序中访问这些数据(因为两个应用程序共享数据库)。
问题是我无法正确恢复数据:( 我用谷歌搜索了它并阅读了一些文档。我知道 PB6.5 使用 ANSI 编码,而 PB10.5 使用 UTF-16LE,因此我尝试了在文档中找到的函数,看看得到了什么:
lb_text = Blob(original_string, EncodingANSI!)
ls_string1 = String(lb_text, EncodingANSI!)
ls_string2 = String(lb_text, EncodingUTF16LE! )
ls_string1 给了我一个与用 PB6 编码的原始字符串非常相似的字符串.5 和 ls_string2 给了我一个字符串,它是“方形字符”的序列:㔐
我的问题是:
有没有办法标准化不同版本的 PB 之间的编码? 或...
< strong>是否有一个函数(在PB10.5中)可以将字符串转换为我需要的编码?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题出在我的加密函数中:我使用了一个字符串 (ascii_string),其 ASCII 字符从 1 到 255对数据进行编码,但我发现位置 1 到 31 中有“奇怪”的字符。
因此,在 PB6.5 中我做了:
对于 PB 10.5:
并且它适用于每个版本!
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!