Encoding not retained when moving a file to a new instance.
-
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. -
This question pertains to Notepad++ v7.5.5 32-bit, running on Windows XP.
-
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, theBackup > Remember current session for next launch
option -
As you, I set the default encoding to
OEM-US
encoding, inSetting > 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 the1st
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 encodingOEM-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 the1st
N++ instance to the2nd
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 thesession.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 initialOEM-US
encoding is lost and the defaultANSI
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, inPreferences... > Backup
-
Do not close the given file’s tab, before exiting N++
Best regards,
guy038
-