0

I've got an issue with Notepad++ plugin, XML Tools. It used to work fine with windows-1251 encoding, yet now it fails even on the simplest of XML:

<?xml version="1.0" encoding="windows-1251"?>
<Файл>
<tst ИдОтпр="test">
</tst>
</Файл>

On every save, attempt to validate, etc.. I'm getting following error:

XML Tools error

It used to work just fine, since then I don't remember updating Notepad++ nor XML Tools plugin, so I guess it's some external library that might've been changed that affects it?

SSV
  • 860
  • 3
  • 11
  • 25
  • Can you use a hex editor and show the first few bytes of the file?` – Tomalak Jul 02 '19 at 15:28
  • One good free hex editor is [HxD](https://mh-nexus.de/en/hxd/). – Tomalak Jul 02 '19 at 15:29
  • 3C 3F 78 6D 6C 20 76 65 72 73 69 6F 6E 3D 22 31 2E 30 22 20 65 6E 63 6F 64 69 6E 67 3D 22 77 69 6E 64 6F 77 73 2D 31 32 35 31 22 3F 3E 0D 0A 3C D4 E0 E9 EB 3E 0D 0A 3C 74 73 74 20 C8 E4 CE F2 EF F0 3D 22 74 65 73 74 22 3E 0D 0A 3C 2F 74 73 74 3E 0D 0A 3C 2F D4 E0 E9 EB 3E – SSV Jul 09 '19 at 16:03
  • @Tomalak Here's the whole content of that file – SSV Jul 09 '19 at 16:05
  • This is a correctly encoded Windows-1251 XML file. When you open it in (for example) Internet Explorer, it will open and show the expected content. If that's working for you, the error is within the Notepad++ plugin, not the file. – Tomalak Jul 09 '19 at 16:10
  • I know the file is correct, but I think the error is caused by some external(not notepad++ plugin) library that might be causing encoder error, and I don't know how to pinpoint which and how to fix it Does it work for you? – SSV Jul 11 '19 at 08:53
  • Oh, I thought you suspected the file. At first, I suspected the file as well, but the hex dump rules that out. The error message seems to come from the underlying libxml2 library. From what I've found (for example [here](https://bugs.documentfoundation.org/show_bug.cgi?id=81461)), libxml2 does not support `Windows-1251` internally, but relies on the external library libiconv for this. – Tomalak Jul 11 '19 at 10:53
  • So the error says that libxml2 saw that it should switch to `Windows-1251` encoding for this file and then failed to find an appropriate decoder. Check if you have the necessary DLLs in your Notepad++ folder. Here is some guidance, it's from 2015 but might still be relevant. https://sourceforge.net/projects/npp-plugins/files/XML%20Tools/Xml%20Tools%202.4.2%20r1057%20Unicode/ – Tomalak Jul 11 '19 at 10:55
  • Checked it, they exist in both main Notepad++ location, as well as Notepad++\plugins\XMLTools\libs. Same issue occurs when I install XML Tools on a freshly made Win10 virtual machine, so I don't think I'm alone with this problem – SSV Jul 16 '19 at 15:03

0 Answers0