zufuliu / notepad4

Notepad4 (Notepad2⨯2, Notepad2++) is a light-weight Scintilla based text editor for Windows with syntax highlighting, code folding, auto-completion and API list for many programming languages and documents, bundled with file browser plugin matepath.
Other
3.29k stars 211 forks source link

再次反馈乱码 #469

Closed Davider-code closed 2 years ago

Davider-code commented 2 years ago

以前反馈过很多次了, R4220 版发布后, 一直在用, 经常出现乱码, 有点影响使用了, 再反馈一下,如下图所示 下面的文件, 我用emeditor打开,没有乱码显示 乱码

测试文件: test.zip

zufuliu commented 2 years ago

Not a bug, both files ware declared as ISO-8859-1

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

Maybe we should prefer Windows-1252, https://encoding.spec.whatwg.org/#names-and-labels

>>> b'\x93'.decode('iso-8859-1')
'\x93'
>>> b'\x93'.decode('windows-1252')
'“'
>>> b'\x94'.decode('iso-8859-1')
'\x94'
>>> b'\x94'.decode('windows-1252')
'”'
>>>
Davider-code commented 2 years ago

Not a bug, both files ware declared as ISO-8859-1

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

Maybe we should prefer Windows-1252, https://encoding.spec.whatwg.org/#names-and-labels

>>> b'\x93'.decode('iso-8859-1')
'\x93'
>>> b'\x93'.decode('windows-1252')
'“'
>>> b'\x94'.decode('iso-8859-1')
'\x94'
>>> b'\x94'.decode('windows-1252')
'”'
>>>

感谢回复, 要设置哪个地方呢?

zufuliu commented 2 years ago

implemented by commit d190148a04f410a71010b8d21dbf9e32fcf0886a.

Davider-code commented 10 months ago

implemented by commit d190148.

最近下载了新版, 乱码问题又卷土重来了, 哎, 因为习惯了, 所以一直在用Notepad2, 又改乱码逻辑了吗? 以前有个版本一直没有乱码, 各类文件都能很好的兼容, 最近这个版本, 已经遇到N次乱码的情况了, 下图有演示 xxx

b.txt

zufuliu commented 10 months ago

It works for me (opened as UTF-8), with following (the default) configuration.

image

PNBRQK commented 10 months ago

Judging by his demo picture he made a re-code (as GBK) to the text and the re-coded file cannot be properly recognized for some reason.

zufuliu commented 10 months ago

He is probable use English Windows (ANSI (1252) in gif), ANSI code page (1252) can encode all GBK bytes. set default encoding to GBK should fix the problem: https://github.com/zufuliu/notepad2/blob/0cc948a87b54ff21a68a447bbd5c6e25fc5e61c1/src/EditEncoding.c#L2408-L2422