Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad support CP-1251 (Cyrillic Windows) in PrettyPrinter (XML) #994

Open
MikePryadko opened this issue Aug 3, 2020 · 3 comments
Open

Bad support CP-1251 (Cyrillic Windows) in PrettyPrinter (XML) #994

MikePryadko opened this issue Aug 3, 2020 · 3 comments

Comments

@MikePryadko
Copy link

geany_error
geany_log
geany_version
geany_pretty-printer-version
Example file: cyrillic_example.xml.txt
Content: example-1_content

Example 2:
cyrillic_example2.xml.txt
geany_error-2
example-2_content

@intact
Copy link

intact commented Aug 20, 2020

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).

@MikePryadko
Copy link
Author

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! 😃
I think it's still a bug and it should be fixed 😌 Just ingore encoding= in <?xml ... ?> and everybody will be happy! 😎

@elextr
Copy link
Member

elextr commented Aug 21, 2020

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants