How to replace Unicode Character in Notepad++
Solution 1:
I wonder how do I search and replace unicode character xE5
" with æ
Note that æ
is actually Unicode 00E6
not 00E5
.
Search and replace is not the right way to get the correct characters displayed.
<?xml version="1.0" encoding="utf-8"?>
The above states the encoding is utf-8
but the file is actually encoded as ANSI
.
You need to convert the file correctly to UTF-8
, as follows:
Open Testfile.xlf
-
File looks like:
Unicode is incorrectly displayed.
-
Menu > Encoding > Select Encode in ANSI
-
File looks like:
Unicode is correctly displayed.
Select all file contents (ctrl+a)
-
Menu > Encoding > Select Convert to UTF-8
Save the File (ctrl+s)
Close and reopen.
File is now correctly encoded as UTF-8 and Unicode characters display correctly.
How can you see the file is actually ANSI?
The cygwin file
utility shows this (before and after conversion):
DavidPostill@Hal /f/test
$ file -i Testfile*.xlf
Testfile.xlf: application/xml; charset=iso-8859-1
TestfileConverted.xlf: application/xml; charset=utf-8
Solution 2:
If you want to remove UTF-8/unicode chars entirely, click Encoding
in NPP and do the following steps, in order:
- Select Encode in UTF-8 (if it's currently in ANSI)
- Select Convert to ANSI (also under encoding)
- Save file
When I do that, all the UTF-8/unicode chars go away.