Force UTF-8 on every document opened in Notepad++
Nothing is wrong. It is just, how Notepad++ is working. Files are actually saved as UTF-8 w/o BOM.
Whenever an ANSI-encoded text file is opened in Notepad++, editor displays its correct encoding (ANSI). However, after actually saving that file, it will be saved as UTF-8 w/o BOM, if Apply to opened ANSI files
option is checked. To verify this, one must create a new text file in the Windows Explorer, open it in Notepad++, change contents, save and reopen. It will be recognized as encoded in UTF-8 w/o BOM.
Tip: There's a fairy easy way to force Windows Notepad to always save files in UTF-8:
- solution at answers.microsoft.com,
- solution at superuser.com.
It requires some tweaks in Windows registry, but allows you to have all files always encoded in UTF-8, no matter, what editor you're using.
Related videos on Youtube
trejder
I'm just an average person, that uniquely combines strict, engineering mind with a non-schematic, humanistic and magical way of looking on life and surrounding world. Add a little bit of madness, and you'll get entire picture of me! :] I'm a developer, both desktop and mobile, with 15+ years of experience and 50+ small-to-big projects on account. In the very same time I'm a writer with similar experience and a lot of books, articles, blog posts or own blogs ideas on account.
Updated on September 18, 2022Comments
-
trejder over 1 year
I want every document that I create or open in Notepad++ to always (no matter what) be encoded in UTF-8. It seems, that either I'm missing something or this is not possible.
In
Settings > Preferences... > New Document > Encoding
I haveUTF-8 without BOM
selected in the list plusApply to opened ANSI files
checked as well. I'm using version 6.7.4.Everyhing is fine, when I create a new file directly in Notepad++. Then, yes, it has UTF-8 w/o BOM encoding set by default. But, when I select
New > Text Document
in Windows Explorer, create a new empty text file and then double click it, it opens in Notepad++ withANSI
encoding by default.What is wrong? For me, option
Apply to opened ANSI files
seems to be not working at all. -
Ryan over 7 yearsI was really excited but then your link didn't work. Maybe you were linking to something similar to this? superuser.com/a/872848/74576
-
trejder over 7 years@Ryan Link in my answer works for me, however target page opens up very slowly. I have added both link to make sure future readers reach information, they're seeking for.
-
David Spector over 4 yearsFails for me, I think. I have a file containing Unicode characters. It displays as pairs of hex digits instead of the Unicode. The status line says "Windows (CR LF) UCS-2 LE BOM". I want to see it in Unicode glyphs.