Community
    • Login

    Bug: Empty file with UTF-8 encoding saved as ANSI

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 57 Views 1 Watching
    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.
    • Claudia SvensonC Offline
      Claudia Svenson
      last edited by Claudia Svenson

      Assume I open NP++ and create a new file via menu

      file—>new

      In the lower right corner the Encoding is “UTF-8” which is equal to my default encoding.
      Good

      Now I save this empty, unchanged file as “new 1.txt” and close NP++.
      Afterwards I reopen this file “new 1.txt” by double click…and the Encoding now switched to ANSI.
      Very bad

      I guess this is a bug in NP++

      I oftentimes create empty files in Filemanager and fill them later with stuff.

      And I always want have UTF-8 Encoding (until I switch this manually).
      How can I enforce this in NP++?

      1 Reply Last reply Reply Quote 0
      • MarkusBodenseeM Offline
        MarkusBodensee
        last edited by

        The problem is that neither ANSI nor UTF-8 includes a “marker” within the file itself to indicate the encoding type. This means Notepad++ or any other editor has to determine the encoding based on the file’s content. Consequently, with an empty file, it is impossible to distinguish which encoding is intended.

        That is precisely why this setting exists (see screenshot). Checking that box should do the trick.

        4047c99e-e786-469d-ab2c-9f164ff62957-image.jpeg

        1 Reply Last reply Reply Quote 0
        • MarkusBodenseeM Offline
          MarkusBodensee
          last edited by

          Screenshot with englisch lang:

          c9203773-1cf6-4e41-8a11-6415a3597add-image.jpeg

          1 Reply Last reply Reply Quote 0

          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
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors