在 Windows 和 Wine (Ubuntu) 上执行应用程序时字符集不匹配
我们有一个小的 exe 客户端应用程序,用于从远程源加载扫描图像,我们需要做的是将图像中的地址输入到特定文本框并提交。 然后,数据将保存在远程数据库中,并由其他应用程序读取。
当我们在Windows上运行客户端应用程序时,一切正常。仅当我们通过 Wine 在 Ubuntu 上运行应用程序时才会出现此问题: 无论我们输入包含德语字符的地址,其他应用程序都会从数据库中读取错误的字符,例如:
我们输入的内容: Lößnitzstr
其他应用程序看到的内容: Löñitzstr
我们发现,使用 UTF-8 编码并使用 Windows-1252 代码页解码时,这是不匹配的字符集。
由于Ubuntu的默认字符集是UTF-8,我们尝试使用命令行强制WINE以Windows字符集设置运行:
LANG=de_DE.CP1252 wine client.exe
我们还尝试通过localectl将操作系统默认语言环境设置为以下语言字符集 Windows-1252 (CP1252) 但它似乎不起作用
知道如何解决此问题,非常感谢您的帮助。
We have a small exe client application that used for loading the scanned images from the remote sources, what we need to do is enter the address from the images to specific text box and submit.
The data then will be saved in remote database and will be read by another apps.
When we run the client application on Windows, everything is normal. The problem only happen when we run application on Ubuntu via Wine:
Whether we input the address that contain German characters, the other apps will read from database the wrong characters, for example:
What we enter:
Lößnitzstr
What the other apps see:
Lößnitzstr
We found out this is mismatch charset when encoding with UTF-8 and decode with Windows-1252 code page.
Since the default charset of Ubuntu is UTF-8, we tried to use command line to force WINE to run with windows charset setting:
LANG=de_DE.CP1252 wine client.exe
We also tried to set Operating system default locale by localectl to language with charset Windows-1252 (CP1252) but it seem not to work
Any idea how to fix this, really appreciate your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论