在 Windows 和 Wine (Ubuntu) 上执行应用程序时字符集不匹配

发布于 2025-01-17 13:30:28 字数 781 浏览 1 评论 0原文

我们有一个小的 exe 客户端应用程序,用于从远程源加载扫描图像,我们需要做的是将图像中的地址输入到特定文本框并提交。 然后,数据将保存在远程数据库中,并由其他应用程序读取。

当我们在Windows上运行客户端应用程序时,一切正常。仅当我们通过 Wine 在 Ubuntu 上运行应用程序时才会出现此问题: 无论我们输入包含德语字符的地址,其他应用程序都会从​​数据库中读取错误的字符,例如:

我们输入的内容: Lößnitzstr

其他应用程序看到的内容: Löñitzstr

input output

我们发现,使用 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

input
output

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文