panel icon indicating copy to clipboard operation
panel copied to clipboard

When uploading Chinese or non-English characters, garbled characters will appear and no operations can be performed in the panel

Open vlssu opened this issue 3 years ago • 6 comments

Current Behavior

When uploading Chinese or non-English characters, garbled characters will appear, and no operations can be performed in the panel, which will cause these players to be unable to use the panel normally. image

Expected Behavior

Uploading non-English characters, such as Chinese, will not appear garbled, and after decompression, the decompressed files can be displayed normally. These files can be manipulated or modified, renamed, etc. on the panel.

Steps to Reproduce

  1. Upload a file, zip file, or folder, all of which contain Chinese text, which can be named with 测试.
  2. Try to unzip the zip package 测试压缩包.zip, you will find that there are 测试文件夹 folders and 测试核心-paper-1.19-50.jar. There is also 测试核心-paper-1.19-50.jar in the 测试文件夹 folder, but after decompression, all those with Chinese cannot rename or delete it. And the 测试文件夹 can't even open.

Directory Structure

   测试压缩包.zip
    │  测试核心-paper-1.19-50.jar
    │
    └─测试文件夹
            测试核心-paper-1.19-50.jar

image

Panel Version

1.9.2

Wings Version

1.6.4

Games and/or Eggs Affected

No response

Docker Image

No response

Error Logs

http://bin.ptdl.co/kkjgb

Is there an existing issue for this?

  • [X] I have searched the existing issues before opening this issue.
  • [X] I have provided all relevant details, including the specific game and Docker images I am using if this issue is related to running a server.
  • [X] I have checked in the Discord server and believe this is a bug with the software, and not a configuration issue with my specific system.

vlssu avatar Jul 08 '22 12:07 vlssu

can partly confirm, had a folder named ''$'\365''6'$'\365''world'$'\365''8' (Name found with ssh) I couldn't delete/rename/view it using either sftp or the file browser as it had some wierd special chars like this above. (Rename would visually look like it worked, in the ui, however after page reload it would be reverted) Had to use ssh to delete the file

SimonStjernholm avatar Jul 08 '22 17:07 SimonStjernholm

I'm really sorry, I forgot to upload the compressed package, upload it now, the current directory structure is as follow 测试压缩包.zip

  测试压缩包.zip
    │  测试文档.md
    │
    └─测试文件夹
            测试核心-arclight-forge-1.18.2-1.0.5.jar

Below is the meaning of these documents will be marked in English

  测试压缩包.zip  # A compressed package packaged with zip
    │  测试文档.md   # A Markdown document, the content in it cannot be modified because the file name is Chinese.
    │
    └─测试文件夹  # A folder named in Chinese
            测试核心-arclight-forge-1.18.2-1.0.5.jar  # An Arclight1.18.2 startup core that contains Chinese.

vlssu avatar Jul 09 '22 02:07 vlssu

can partly confirm, had a folder named ''$'\365''6'$'\365''world'$'\365''8' (Name found with ssh) I couldn't delete/rename/view it using either sftp or the file browser as it had some wierd special chars like this above. (Rename would visually look like it worked, in the ui, however after page reload it would be reverted) Had to use ssh to delete the file

Yes, it is. But the folder or file created with Chinese on the panel can be edited.

Another point is that the Chinese files uploaded on the panel can be displayed normally, but when viewed in SFTP, it is garbled.

vlssu avatar Jul 09 '22 02:07 vlssu

https://www.jianshu.com/p/5721d2003860 https://pkg.go.dev/golang.org/x/text/transform https://pkg.go.dev/golang.org/x/text/encoding/simplifiedchinese

Maybe these fixes for wings will help?

vlssu avatar Aug 20 '22 13:08 vlssu

https://www.jianshu.com/p/5721d2003860 https://pkg.go.dev/golang.org/x/text/transform https://pkg.go.dev/golang.org/x/text/encoding/simplifiedchinese

Maybe these fixes for wings will help?

good idea but no enough general for other region.

shugen002 avatar Sep 08 '22 04:09 shugen002

I can confirm this issue.

1、Wings CAN'T handle zip encoding by local charset. For normal users , you can add cu=on to parameters to 7zip to force it use utf-8 to encode when you are creating a zip. For developer, we need to detect the encoding of the file .

2、SFTP or Panel can't correctly display Chinese File/Folder name I am using WinSCP , i notice these behaviour, it will try to detect the encoding of the server using and switch to it. when both appear it will switch to what it detect (Such as gbk). for the panel , it display just like what it actually store in the server but i have no idea why it can't delete or other operation

shugen002 avatar Sep 08 '22 05:09 shugen002