Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Bug report for format convert!

    Plugin Development
    2
    2
    453
    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

      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
      • guy038
        guy038 last edited by guy038

        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
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors