Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes the bug in
Utf16_Iter
described here: #9599 (comment). I introduced this bug in 9599, it is a regression. Sorry for that. The problem is: If the last character of an UTF-16-coded file is greater then 0x7F, and hence needs more than one byte in UTF-8-encoding, only the 1st byte of the UTF-8 sequence arrives in the text buffer.A similar bug does exist in
Utf8_Iter
, which is fixed too. This bug, at least, is no regression. It is also harder to reproduce. When writing an UTF-16-coded file, andthen only the first 16-bit code is written to the file.
The 65536 comes from the size of the intermediate buffer which is used while conversion:
notepad-plus-plus/PowerEditor/src/Utf8_16.cpp
Line 344 in 6750be3