Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[编码问题] 简体中文环境下,♡被错误的渲染为≡ #448

Open
PiDanShouRouZhouXD opened this issue May 3, 2024 · 4 comments

Comments

@PiDanShouRouZhouXD
Copy link
Collaborator

PiDanShouRouZhouXD commented May 3, 2024

image
image
如上图所示,♡被错误的渲染为≡。
经过查询,应当是UTF-8字符被错误的认为是GBK渲染造成的。
0xE2 0x99 0xA1 → 0xA1 0xAB
在命令行中可以正常显示:
image

@dmMaze
Copy link
Owner

dmMaze commented May 4, 2024

出现这个问题的 OCR 是本地的还是你最新提交的?

@PiDanShouRouZhouXD
Copy link
Collaborator Author

出现这个问题的 OCR 是本地的还是你最新提交的?

我进行了测试,使用本地OCR和彩云翻译也会出现相同的情况。

@dmMaze
Copy link
Owner

dmMaze commented May 5, 2024

我进行了测试,使用本地OCR和彩云翻译也会出现相同的情况。

你看下保存的项目文件里字符是不是也是错的,或者

ch = self.model.dictionary[chid]

看下 ocr 识别出的字符chid是不是对的,那个字典是 data/alphabet-all-v7.txt

qt 这部分应该默认就是 utf8,另外我也是 windows 简中也能正确识别渲染 ♡ 啊,你的代码编辑器没改全局编码吧

而且如果是 utf-8 被错误识别成了 gbk,其它 cjk 字符也会出错才对

@PiDanShouRouZhouXD
Copy link
Collaborator Author

我进行了测试,使用本地OCR和彩云翻译也会出现相同的情况。

你看下保存的项目文件里字符是不是也是错的,或者

ch = self.model.dictionary[chid]

看下 ocr 识别出的字符chid是不是对的,那个字典是 data/alphabet-all-v7.txt
qt 这部分应该默认就是 utf8,另外我也是 windows 简中也能正确识别渲染 ♡ 啊,你的代码编辑器没改全局编码吧

而且如果是 utf-8 被错误识别成了 gbk,其它 cjk 字符也会出错才对

我查看了一下工程,是完全正确的……我现在怀疑是我使用vscode的powershell启动程序导致的,有时间排查一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants