Encoding tricks...
-
Hi
I run a website (php/mysql/ajax), with distinct directories using MVC structure.
Default encoding in Notepad++ is UTF8 without BOM.
All my files are encoded this way.
I use uWamp to run local server (avoids me to install whole Apache and Mysql)I work on 3 distinct computers (all running Win 7 home 64bit, and belonging to the same home network) according to opportunities, and I synchronize the www directory then from one to the others.
All my files are UTF8 encoded (I checked in status bar) on my main computer (let’s say “computer A”)
But… once synchronized to another computer (“computer B”) :- some are UTF8 encoded
- some are “Windows-1258” encoded (the ones who contained accentuated letters like è, which are then turned into è)
- some others “Windows-1250”
- …
I tried to delete them, and copy them once again : same issue
I tried to convert them to UTF8 encoding with Notepad++ :
- it works, mais for some of them, when re-opening file, it comes to Windows-1258 again. For some other it doesn’t
- …and I have too many files just to imagine converting them
This problems occurs on computer “B”, but not on my main computer “A” nor the third one “C”.
(notice that computer B has not been windows-updated for a big while, because it has small hard-drive and small-memory, and memory would be saturated by updates)So what can be the issue, so that encoding changes with copying ?
Thanks
-
welcome to the notepad++ community, @Benoit-Martha
your computer “b” most probably has notepad++ 7.6. or higher installed, while computers “a” and “c” have notepad++ 7.5.9 or below.
unfortunately autodetect character encoding is broken since notepad++ version 7.6. and above.
currently it is necessary to:
- go to
settings > preferences > misc
and disableauto detect character encoding
on your computer “b”, as seen at the screenshot below.
- then go to
settings > preferences > new document
and set your preferred default encoding to e.g utf-8, as seen at the screenshot below.
after that repeat your testing, it will work on computer “b” now.
note: a solving regression rollback fix for that issue has been committed and pushed to the pull requests, but it has currently been suspended by @donho as the issue is being inspected, to evaluate if a fix is possible, instead of a rollback.
- go to