-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use embedded nulls to detect UTF-16 without BOM 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.
- Loading branch information
1 parent
55f6346
commit e80028c
Showing
2 changed files
with
31 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters