Bug: Win32 directory picker truncates paths containing certain Unicode characters (e.g. 一 U+4E00) #761
applekaraa
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Bug Description
When selecting a workspace directory on Windows, paths containing Unicode characters whose UTF-16LE low byte is
0x00are truncated, causingENOENTerrors.For example, the directory
去重的单一装置数据is truncated to去重的单, and selecting it fails with:workspace-invalid-path: cannot create a workspace at "E:\Work\直流油色谱分析\导出全量7月数据\去重的单": ENOENT: no such file or directory
Root Cause
The
readUtf16()function inpackages/host/directory-picker-native/src/win32-dialog-bindings.ts(line 40) scans for the NUL terminator by only checking the low byte:All reactions