• Login
Community
  • Login

Encoding not retained when moving a file to a new instance.

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
encoding
3 Posts 2 Posters 917 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.
  • C
    Compu chan
    last edited by Jul 28, 2018, 5:16 AM

    This is just a very minor inconvenience, but when I drag and drop a file i’m editing into it’s own window it reverts back to ANSI encoding.
    I want it to remain OEM-US. I guess I need to change the default encoding.

    I see an option, Settings>Preferences>New Document>Encoding, which i’ve already set to OEM-US.
    I’ve also tried to edit and save the file with OEM-US encoding before moving it to a new instance.

    1 Reply Last reply Reply Quote 0
    • C
      Compu chan
      last edited by Jul 28, 2018, 5:25 AM

      This question pertains to Notepad++ v7.5.5 32-bit, running on Windows XP.

      1 Reply Last reply Reply Quote 0
      • G
        guy038
        last edited by guy038 Jul 28, 2018, 4:04 PM Jul 28, 2018, 11:49 AM

        Hello @compu-chan and All,

        On my Win XP configuration, I did a test :

        • I downloaded the 7z archive of the last 7.5.8 version of Notepad++

        • I extracted all files in folder D:\Test

        • I started N++ and I customized in Settings > Preferences.. my usual settings and, particularly, the Backup > Remember current session for next launch option

        • As you, I set the default encoding to OEM-US encoding, in Setting > Preferences...> New document > Encoding

        • Then, I opened several files ( change.log, license.txt, readme.txt )

        => Of course, the default encoding used, for existing files is ANSI

        • So, I changed, for instance, the encoding of the readme.txt file to OEM-US

        => And, after closing and re-starting Notepad++, I do get the same OEM-US encoding for the readme.txt file !

        • Now, I opened a console DOS window and moved to the D:\test folder

        • With the command notepad++.exe -multiInst, I opened a new instance of N++

        => As expected, this 2nd instance contained all the files of the 1st instance ( current session ) and the encoding of readme.txt was, indeed, OEM-US

        • Then, I closed this second instance and re-opened it, without any session, with the DOS command notepad++ -nosession -multiInst

        => As expected, only a new 1 file was opened, with the customized encoding OEM-US

        • I opened the readme.txt file and, this time, as you saw, the encoding of readme.txt was ANSI !

        • Again, I closed this second instance and re-opened it, without any session, with the DOS command notepad++ -nosession -multiInst

        • Now, using the Ctrl + Drag and Drop, I copied the readme.txt tab of the 1st N++ instance to the 2nd N++ instance

        => Again, the default encoding of the readme.txt file was ANSI


        Simply, note that this behaviour is identical, if no 2nd instance is involved in process ! Indeed :

        • Close any supplementary instance of N++

        • Now, close your 1st N++ instance

        => On re-starting N++, the readme.txt encoding is still OEM-US, according to information of the session.xml configuration file

        • Then close ( Ctrl + W ) the readme.txt tab and re-open it with the Restore Recent Closed File command ( Ctrl + Shift + T )

        As during the tests, above, with a 2nd instance, the initial OEM-US encoding is lost and the default ANSI encoding is chosen for the readme.txt file !


        Conclusion :

        You must live with this small drawback :-((. And, to my mind, if you want to keep a chosen encoding, taken from Encoding > Character Sets, for a given file, from one session to another, closing and re-starting N++, the only way seems :

        • Get the option Remember current session for next launch ticked, in Preferences... > Backup

        • Do not close the given file’s tab, before exiting N++

        Best regards,

        guy038

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