• Login
Community
  • Login

BUG when reloading changed file with diff encoding

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
2 Posts 2 Posters 1.5k 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.
  • M
    Michaela Julia M
    last edited by May 13, 2017, 5:42 PM

    Hi,

    I was just using notepad to monitor some text output from one of my c# programs and noticed that, when the file gets rewritten with a different encoding, notepad prompts me to reload the file but does not change the encoding which makes the displayed text a proper mess.
    I was actually swearing at my program LOL until I noticed that if I close notepad and then reopen the file everything looks fine.

    1 Reply Last reply Reply Quote 0
    • G
      gstavi
      last edited by May 14, 2017, 10:58 AM

      Practice some modesty/caution before calling specific behavior a BUG.

      Files do NOT have encoding.
      Encoding is applied to the file’s byte stream when it is loaded into a buffer within Scintilla.
      On load, an automatic detection algorithm is used to select an encoding. Many threads in this forum state a wish for an option to override this automatic selection.
      After load the user can override the encoding.

      The question of whether file reload should re-trigger the automatic detection or not is an open user interface decision with no ONE RIGHT ANSWER.

      Since the scenario you described of a file changing its contents in the background in away that will trigger different encoding result from the automatic detection apply to 0.001% of Notepad++ users I think that maintaining the current encoding of the buffer is the choice that benefit the majority of users.

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