Community
    • Login

    Different encoding determined based on the file extension

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 446 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.
    • Joe SchmitzJ
      Joe Schmitz
      last edited by

      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++ v8.1.9.3 (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

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @Joe Schmitz
        last edited by

        @joe-schmitz

        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.

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