Skip to content
Discussion options

You must be logged in to vote

This is the same defect as #4624, seen from the outside: the native picker truncates the path, so realpath then fails ENOENT and the folder cannot be added.

The cause is a one-line one. The picker locates the string's NUL terminator by testing only the low byte of each UTF-16LE code unit, but a terminator is a whole code unit — so any character encoded 00 xx reads as the end of the string. U+4E00 一 is 00 4E; U+5F00 开 is 00 5F.

That is why it looks like "mixed English and Chinese breaks it": what actually matters is whether the name happens to contain a character whose low byte is zero. A path of purely Chinese characters that all have non-zero low bytes works fine, which makes the pattern…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Cheeserackery
Comment options

You must be logged in to vote
1 reply
@Cheeserackery
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants