commondialogs: match full width '|'#838
Open
zx2c4 wants to merge 1 commit into
Open
Conversation
A bug was encountered in the localization from:
Configuration Files (*.zip, *.conf)|*.zip;*.conf|All Files (*.*)|*.*
to:
구성 파일 (*.zip, *.conf)|*.zip;*.conf|All Files (*.*)|*.*
Converting the latter into utf16 yields this sequence:
00000000 6c ad 31 c1 20 00 0c d3 7c c7 20 00 28 00 2a 00 |l.1. ...|. .(.*.|
00000010 2e 00 7a 00 69 00 70 00 2c 00 20 00 2a 00 2e 00 |..z.i.p.,. .*...|
00000020 63 00 6f 00 6e 00 66 00 29 00 7c 00 2a 00 2e 00 |c.o.n.f.).|.*...|
00000030 7a 00 69 00 70 00 3b 00 2a 00 2e 00 63 00 6f 00 |z.i.p.;.*...c.o.|
00000040 6e 00 66 00 7c 00 41 00 6c 00 6c 00 20 00 46 00 |n.f.|.A.l.l. .F.|
00000050 69 00 6c 00 65 00 73 00 20 00 28 00 2a 00 2e 00 |i.l.e.s. .(.*...|
00000060 2a 00 29 00 7c 00 2a 00 2e 00 2a 00 |*.).|.*...*.|
Notice on the top line, 0x7c, which is '|'. The old code thus replaced
7c c7 with 00 00, because it cast each utf16 character to a single byte
before doing the comparison.
Fix this by instead comparing the full utf16 character against the the
utf16 representation of '|', 7c 00.
Reported-by: 오한웅 <oho790114@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A bug was encountered in the localization from:
Configuration Files (.zip, .conf)|.zip;.conf|All Files (.)|.
to:
구성 파일 (.zip, .conf)|.zip;.conf|All Files (.)|.
Converting the latter into utf16 yields this sequence:
Notice on the top line, 0x7c, which is '|'. The old code thus replaced 7c c7 with 00 00, because it cast each utf16 character to a single byte before doing the comparison.
Fix this by instead comparing the full utf16 character against the the utf16 representation of '|', 7c 00.