stackblitz / core

Online IDE powered by Visual Studio Code ⚡️
https://stackblitz.com
MIT License
10.26k stars 899 forks source link

When the files and folders in the repository contain Chinese or spaces, an error will occur in the import #2006

Open blueju opened 2 years ago

blueju commented 2 years ago

When the files and folders in the warehouse contain Chinese or spaces, an error will occur in the import

当仓库中的文件和文件夹含有中文或者空格时,导入会发生错误

example github repo url: https://github.com/blueju/blue-design

Click on the following link to try: https://stackblitz.com/github/blueju/blue-design

error image: image

blueju commented 2 years ago

@EricSimons @fvsch

fvsch commented 2 years ago

Thanks for the report @blueju! We managed to confirm the bug on a separate repo as well. We're tracking this and are hoping to fix it soon.

fvsch commented 2 years ago

Spaces seem to be working, at least the regular non-breaking space:

https://stackblitz.com/github/fvsch/sb-import-unicode-test/tree/spaces

But indeed non-ASCII characters (which could include some of Unicode's dozen of spaces including narrow non-breaking space, no-width space, etc.), including Chinese, Russian and Hebrew ones seem to break the import:

https://stackblitz.com/github/fvsch/sb-import-unicode-test/tree/chinese https://stackblitz.com/github/fvsch/sb-import-unicode-test/tree/hebrew https://stackblitz.com/github/fvsch/sb-import-unicode-test/tree/russian

FossPrime commented 2 years ago

It would be good to test with Microsoft zone identity files as well... they use a special character in the file name.

of note, this isn't just about folders or path resolution... if even a single file anywhere is non ASCII, the import will fail with no good user facing error. I've been unknowingly afflicted by this for over 5 months due to translation files in a large project breaking the whole import.

the windows security files look like: "movedfile•Zone.Identifier", but instead of a bullet it is the character 0xF03A (Unicode: U+F03A). They can only be created on Windows by windows, and are known to crash extraction, so including them in the zip download and sending them to a large customer will upset the intellect. https://www.npmjs.com/package/sanitize-filename#details