UTF-8 by default

2. Help
  • Hi and, before anything else, thanks for this great tool!

    By default, when creating a new document with Notepad++, it is encoded as ANSI. In order to fulfill compatibility purposes, I would like to use UTF-8 encoding by default but this option is neither proposed through options menu, nor in different XML configuration files. So I currently have to change the encoding in "Format" menu for every new document I create.

    Is there a way to specify UTF-8 as the default encoding character set? Thanks for any help.

    • I'd also love to see the default encoding switchable for UTF-8. It is essential in today's programming.

      • Wishing the same like that user, 11 months later.

        Configuration allows new files to be UTF-8, but if you edit a existing file which has no extended characters, it will start as ANSI, and after that, if you type any extended char, you MUST remember to manually switch codification.

        Should be very easy to add another option in configuration to add UTF-8 as default instead of ANSI... and it might be very useful for many of us.

        • Notepad++'s annoyances with UTF-8 is the SOLE reason I stopped using it. I need ALL my files to BE utf-8 and for some reason Notepadd++ (4.5) insisted it be something else. I had to open files in other programs like Dreamweaver and change encoding.

          I'm downloading newest version to see if anything has changed, if not, I'm sticking with Eclipse (feels bloated, but has gotta love the sysntax warnings when you make a mistake ;) )

          Oh, by the way, when will Notepad++ UPDATE ITSELF???

        • Perhaps you can imagine that ANSI users wouldn't like this behavior at all. If you experience a problem, why ask it to be changed so _others_ will have a problem, instead of you?

          • "Should be very easy to add another option in configuration to add UTF-8 as default instead of ANSI... and it might be very useful for many of us."

            He asked for a configuration option, not a change that would affect others.

            I've noticed a lot of rudeness on this forum lately, let's all strive to be more polite to Don and tolerant of each other, ok?

    • DV

      Main menu: Settings -> Preferences -> New document


  • Anonymous

    It appears that something more is needed for UTF-8 support, not only in Notepad++, but globally. The Unicode standard recommends *against* using a BOM in UTF-8 encoded files. But my experience is that Notepad++ never, ever, ever interprets such a file as UTF-8, even if there are no ANSI characters in the file! Try it yourself: enable support for an Asian language on your computer (I used Thai), open Notepad++, start a new file, change the encoding to "UTF-8 without BOM", type some characters in the Asian language, save the file and close the window. Now reopen the file in Notepad++ and you will see garbage, and if you look at the encoding, Notepad++ thinks it is ANSI. The standard Windows Notepad *usually* displays UTF-8 files without a BOM correctly, but it also gets confused, especially with files that have many ANSI characters and a few UTF-8 characters. I think that the recommendation against the BOM is a *huge* mistake, because  every valid UTF-8 sequence is also a valid ANSI sequence. Just because a file contains no invalid UTF-8 byte sequences doesn't automatically mean it is UTF-8. So, developers are left in a quandary: On a platform that traditionally uses ANSI, should an application presume an unmarked text file with valid UTF-8 sequences to be ANSI or UTF-8?


  • Anonymous

    Oops, can't edit! My previous post should have said "even if there are no *ASCII* characters in the file".

  • DV

    Notepad++ 5.9 Unicode. Under Settings -> Preferences -> New Document/Default Directory, both checkboxes are set: "UTF-8 without BOM" and "Apply to opened ANSI files". Everything works as expected. New files are "ANSI as UTF-8" and existing ANSI files (without locale-specific characters) are also opened as "ANSI as UTF-8". Do not understand why it does not work for you…

  • ttt

    Last edit: ttt 2013-07-01