XhmikosR / notepad2-mod

LOOKING FOR DEVELOPERS - Notepad2-mod, a Notepad2 fork, a fast and light-weight Notepad-like text editor with syntax highlighting
https://xhmikosr.github.io/notepad2-mod/
Other
1.45k stars 270 forks source link

Automatic Unicode detection needs to be improved #94

Open pffang opened 10 years ago

pffang commented 10 years ago

Many GBK texts recognized as Unicode no BOM, Unicode no BOM is not usual. I think just need support UTF8 no BOM. Others just need to be treated as system locale.

XhmikosR commented 10 years ago

You should take this upstream.

pffang commented 10 years ago

Which one?

XhmikosR commented 10 years ago

What do you mean "which one"? This is an upstream issue, not an issue with this fork.

QWp6t commented 10 years ago

@XhmikosR I think he wants to know whether you mean scintilla or notepad2 when you say "upstream."

@pffang This would be a Notepad2 issue, sorta. Notepad and Notepad2 both use the Unicode detection heuristics that are built into Windows.

There are a few other things worth noting about Notepad2's Unicode detection, but they're not entirely relevant to this discussion.

pffang commented 10 years ago

@XhmikosR Sorry for the incomplete description. @QWp6t Thanks.

XhmikosR commented 10 years ago

Let us know if you hear from Floarian.

Thanks @QWp6t for the help!

pffang commented 10 years ago

The following is a reply:

Thanks for your feedback.

Unicode detection is always just a best guess, and personal preferences are subjective. Here in Eruope, I have much more UTF-16 without BOM files, than GBK files, so I'd say GBK is unusual.

You can turn off UTF-16 detection, and just rely on BOMs to identify UTF-16 files: http://www.flos-freeware.ch/development-releases/notepad2-FAQs.html#unicode-detection

--Florian

pffang commented 10 years ago

Why no BOM UTF16 text exist in the world?:anguished:

ghost commented 7 years ago

For those who do not want to deal with this, you can just turn it off:

SkipUnicodeDetection = 1

http://github.com/svnpenn/dotfiles/blob/d111bb9/notepad2/notepad2.ini#L12