• Login
Community
  • Login

Bug report for format convert!

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
2 Posts 2 Posters 585 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 张
    张锋
    last edited by Apr 14, 2019, 1:12 PM

    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!

    1 Reply Last reply Reply Quote 0
    • G
      guy038
      last edited by guy038 Apr 14, 2019, 7:39 PM Apr 14, 2019, 6:34 PM

      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 use 1 byte to encode the character

      • Over \x{007F}, the UTF-8 and UTF-8 BOM encodings use from 2 to 4 bytes, whereas the ANSI encoding still use a 1 byte 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 invisible BOM : Byte Order Mark )

      So, to be sure that the ANSI encoding will be kept, just change this default behavior :

      • Choose the Settings > Preferences > New document option

      • In the Encoding section, just uncheck the squared box Apply to opened ANSI files

      • Close the Preferences dialog , by clicking on the Close button

      • Preferably, stop and re-start Notepad++

      Best Regards,

      guy038

      1 Reply Last reply Reply Quote 2
      1 out of 2
      • First post
        1/2
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors