How can I edit Unicode text in Notepad++?

The problem described in the question happens when an empty/new document is set to "ANSI", and Unicode characters are pasted into it.

There isn't any auto-detection when used with an empty/new document, at least not in the version of Notepad++ I tested it on (v5.4.5). "ANSI" is the default in Notepad++ for a new document, unless set in menu SettingsPreferences → tab New Document/Open Save Directory.

Solution

The solution is to set the encoding to UTF-8 before pasting, menu FormatEncode in UTF-8:

Menu command "menu Format/Encode in UTF-8" about to be executed

Example

I copied some text to a new Notepad++ document, Russian (русский язык, russkiy yazyk), from Firefox showing the Wikipedia page Russian language.

If the encoding is not changed from "ANSI" this is the result:

Result of pasting the Unicode string "Russian (русский язык, russkiy yazyk" into a new Notepad++ document without changing the encoding from the default "ANSI".

If the encoding is changed this is the result:

Result of pasting the Unicode string "Russian (русский язык, russkiy yazyk" into a new Notepad++ document after changing the encoding from the default "ANSI" to "UTF-8".

As can be seen in the figure below (the Cyrillic part is highlighted), Notepad++ actually converts the Unicode characters into ASCII 63 (hexadecimal 3F), question marks. That is why the Unicode characters are lost (in "ANSI" mode) when copying the text out through the clipboard (it is not a font issue - information is lost).

Screenshot of a hex view of said document

Tested on: Notepad++ v5.4.5 (UNICODE).


If the file is actually encoded in Unicode, Notepad++ should detect it automatically. The Consolas font works well for me. You can try one of these two menu options:

  • Encoding -> Encode in UTF-8
  • Encoding -> Convert to UTF-8

I'm pretty sure the first one will do what you want.


There are good news and bad news.

Good news: Notepad++ supports Unicode (at least from what I can gather).

Bad news: Apparently Unicode support is only on Windows XP.

I actually do not have a Windows machine in front of me. From what I remember, there is an Encoding menu under the Format menu somewhere. The encoding for Unicode is actually most commonly UTF-8.

Here is a 'pretty' picture of Unicode support in Notepad++,

enter image description here