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

Utf 16 fixes #166

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

AnyOldName3
Copy link
Member

Qt's UTF-8 decoder will decode UTF-16 strings with only low code points as the right string with a null character after each real character, which encodes back to the same data, so the reverse conversion check fails.
If there's a BOM, then there's a high code point that won't decode, so this problem was avoided, and only occurred when there was no BOM.

QStringConverter::encodingForData returns nullopt if there's no BOM to identify the encoding instead of trying to work it out, so it's safer to guess UTF-16 if there's no identified encoding but there were null bytes.
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

Successfully merging this pull request may close these issues.

1 participant