Different encoding determined based on the file extension
I have an xml file which is encoded ISO-8859-1.
With a file extension of .XML, Notepad++ shows encoding as ISO-8859-1
If I remove the file extension, Notepad++ shows the encoding as ANSI
Is this a bug that can be fixed?
Notepad++ v220.127.116.11 (32-bit)
Build time : Dec 6 2021 - 19:16:45
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 2009
OS Build : 19044.1645
Current ANSI codepage : 1252
Plugins : ComparePlugin.dll DSpellCheck.dll HexEditor.dll mimeTools.dll NppConverter.dll NppExport.dll NPPJSONViewer.dll XMLTools.dll
No, this is not an error. Some files like xml or html sometimes provide a tag that Npp uses to identify the encoding. If this is not present or Npp does not know that it is an XML or HTML file, it tries to guess the encoding using the chardet module.
So it works as intended. By the way, in this particular case, ISO-8859-1 and your ANSI version (1252) are identical.