Bug report for format convert!
-
When I convert a text file from UTF-8 to ANSI (Encoding > Convert to ANSI), the save and reopen the file, but it still show the format is UTF-8!
-
Hello, @张锋, and All,
Probably, your text contains NO character with Unicode value over
\x{007F};-))Remember that, when the Unicode value of a character is :
-
Under
\x{0080}, the N++ ANSI and UTF-8 encodings are strictly equivalent and use1byte to encode the character -
Over
\x{007F}, the UTF-8 and UTF-8 BOM encodings use from2to4bytes, whereas the ANSI encoding still use a1byte to encode that character !
So, if your text contains only pure ASCII characters ( under
\x{0080}), there no way, for Notepad++, on opening that file, to determine the right encoding, and it chooses, by default, the UTF-8 encoding, ( which does not contain the invisibleBOM: Byte Order Mark )So, to be sure that the ANSI encoding will be kept, just change this default behavior :
-
Choose the
Settings > Preferences > New documentoption -
In the Encoding section, just uncheck the squared box
Apply to opened ANSI files -
Close the Preferences dialog , by clicking on the
Closebutton -
Preferably, stop and re-start Notepad++
Best Regards,
guy038
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login