morbac/xmltools

Plugin doesn't set file encoding according to XML header line when loading an XML file

Opened this issue · 0 comments

Description

If the header line of an XML file looks like that

<?xml version='1.0' encoding='utf-8'?>

i.e. attribute values are enclosed in single quotes instead of double quotes, the plugin doesn't set the file encoding of Notepad++ according to the header line's encoding attribute when loading that XML file. However, syntax checking the file succeeds.

Steps To Reproduce

  1. With another editor, create an XML file with a header line like the one above.
  2. Go to Notepad++ settings and set the default file encoding in Notepad++ to ANSI.
  3. Restart Notepad++
  4. Load the file you created in step 1.
  5. Watch encoding indication in Notepad++ status bar. It is still ANSI instead of UTF-8 like it should be according to the XML file's header line.

Applies To

XMLTools plugin v3.1.1.13 (tested with 64 bit build).
Notepad++ v8.6.9 64 bit