Encoding Auto-Detection

Encoding and Use Unicode UTF-8 for worldwide language support

As of Notepad++ version 8.8.8, the ANSI and Convert to ANSI entries on the Encoding menu are disabled when the Windows setting Use Unicode UTF-8 for worldwide language support is enabled. When that setting is in effect, the system default code page, which ordinarily defines “ANSI” in Windows, is UTF-8; attempting to treat UTF-8 as an ordinary code page does not work properly, which caused erratic behavior prior to version 8.8.8. Since the traditional concept of “ANSI” has no consistent meaning when that Windows setting is enabled, Notepad++ disables ANSI encoding. (But even with that OS option set, Notepad++ can still choose one of the Character Set encodings; it just manually selects that entry, not setting it to “ANSI”.)

Some Windows 11 installations are coming with that option turned on by default. If you need to be able to use the Convert to ANSI action, and you find it’s disabled in Notepad++ (or if that conversion doesn’t behave as expected on older versions of Notepad++), you can verify in ?-menu’s Debug Info: it will show Current ANSI codepage: 65001 if that Windows OS option is on. If you want to change that Windows OS setting, Microsoft provides multiple paths to that setting, but two of the common ways to find it are:

  1. Windows Control Panel > Clock & Region (or just Region), go to the Administrative tab on the dialog, using the Change System Locale button, and toggle the Use Unicode UTF-8 for worldwide language support checkmark.
  2. Windows Settings > Time & Language, in the Language (or Language & Region) section, find the Use Unicode UTF-8 for worldwide language support toggle (it may be not show, in which case, look under the Windows Display Language ▼ pulldown to show it).

Encoding During Editing

Notepad++ does not always edit a document in the same encoding used to store it in its file (which doesn’t influence most users, though some plugins may give you byte-level information about the internal representation of the document, instead of the file itself, which has confused users of some plugins). When the encoding (shown in the Encoding menu and in status bar) is ANSI or UTF-8, you are editing the document in the same encoding as the file; in all other cases (UTF-16 or anything from the Character sets sub-menus), you are editing the document as UTF-8, and Notepad++ converts from or to the chosen encoding when opening or saving the file.

Also, for encodings that have the BOM sequence, Notepad++ will not include the BOM character in the editor panel – but it is in the file on disk during reads and writes; said another way, Notepad++ treats the BOM sequence as “metadata”, and doesn’t include it in the text you are editing. This means you cannot use the editor panel in Notepad++ to look at, add, or remove the BOM character; if you want to change the BOM status for UTF-8, use the Convert to UTF-8-BOM to add the BOM or Convert to UTF-8 to remove the BOM; if the Encoding shows one of the UTF-16 options chosen, or UTF-8-BOM, then you can be confident that Notepad++ will write the BOM when the file saves or read the BOM when the file was loaded.