![geany_error](https://user-images.githubusercontent.com/31248040/89197316-31874680-d5b4-11...) ![geany_log](https://user-images.githubusercontent.com/31248040/89197325-364bfa80-d5b4-11...) ![geany_version](https://user-images.githubusercontent.com/31248040/89197537-8aef7580-d5b4-11...) ![geany_pretty-printer-version](https://user-images.githubusercontent.com/31248040/89197549-8dea6600-d5b4-11...) Example file: [cyrillic_example.xml.txt](https://github.com/geany/geany-plugins/files/5016783/cyrillic_example.xml.tx...) Content: ![example-1_content](https://user-images.githubusercontent.com/31248040/89197976-2aad0380-d5b5-11...)
Example 2: [cyrillic_example2.xml.txt](https://github.com/geany/geany-plugins/files/5016807/cyrillic_example2.xml.t...) ![geany_error-2](https://user-images.githubusercontent.com/31248040/89198064-4b755900-d5b5-11...) ![example-2_content](https://user-images.githubusercontent.com/31248040/89198204-85465f80-d5b5-11...)
Documents are internally stored in utf-8 encoding so that encoding attribute is no longer valid (from PrettyPrinter perspective).
As workaround you can select all document but xml header (and use PrettyPrinter only on that part).
I've find out the problem! PrettyPrinter crushes ONLY if there is `encoding="windows-1251"` - no matter which encoding is really used, which alphabet is used and which part of document is selected! :smiley: I think it's still a bug and it should be fixed :relieved: Just ingore `encoding=` in `<?xml ... ?>` and everybody will be happy! :sunglasses:
The parsing is done by libxml, which is fully standards compliant, so its not possible to make it ignore encoding thats written in the xml passed to it AFAICT. The plugin will need to convert the UTF-8 buffer to the specified encoding, after parsing the xml with libxml to find what it is ... oh :)
github-comments@lists.geany.org