Folder display garbage charcters when the name has some particular characters?

Advertisement

better_not_say
Guest

Folder display garbage charcters when the name has some particular characters?

See attached log. I'm using SCP to connect to a Windows 10-based computer, which is configured with Git's bash.

The folder name is in Chinese.

The folder I want to create is `上线前备份`. After creating it, the refreshed list shows `上线前备�`.

The naming UTF-8 is set to ON. But I could have same problems with AUTO.

I don't know what other information I should also provide. If any, please let me know.
  • scp.log (37.93 KB, Private file)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,392
Location:
Prague, Czechia

Re: Folder display garbage charcters when the name has some particular characters?

Can you create a folder with that name in a shell?

Reply with quote

Guest

Yes I can.

In putty, in that folder, I ls:
''$'\344\270\212\347\272\277\345\211\215\345\244\207\357\277\275'
''$'\345\244\207\344\273\275'

The first one should be the garbage one.

I mkdir 上线前备份, then ls:
''$'\344\270\212\347\272\277\345\211\215\345\244\207\344\273\275'
''$'\344\270\212\347\272\277\345\211\215\345\244\207\357\277\275'
''$'\345\244\207\344\273\275'

The folder content display correctly in Windows.
A first refresh in WinSCP, the list show 3 items:
备份
上线前备�
上线前备份


When I try to delete the 3rd one, it says no such file, then the list become garbage:
澶囦唤
涓婄嚎鍓嶅锟?
涓婄嚎鍓嶅浠?

There's also displaying problem. Some folder/file name that are in Chinese will prevent itself and other folders/files from displaying in list.

Should I provide more detailed log?

Reply with quote

Advertisement

Guest

In the log files:
I've replaced remote HOST/IP with `XXX.XXX.XXX.XXX`, remote login name with `REMOTE_ACCOUNT`;
I've replaced local HOST with `LOCAL_HOSTNAME`, local account with `LOCAL_ACCOUNT`;
I've replaced private key path with `PRIVATE_KEY`.

The remote path where I make logging is `E:\temp\`. Files & folders under `E:\` are (I've modified something here, but not in the log file):
2015/12/02 15:10 <DIR> ftproot
2019/01/27 21:28 <DIR> Games
2019/10/24 18:32 <DIR> My.Documents
2019/10/15 23:22 <DIR> My.Hosts
2019/10/23 02:51 <DIR> Programs
2019/10/27 01:09 <DIR> temp
2019/01/22 19:52 <DIR> XXXX.Documents
2019/08/07 17:16 <DIR> upload
2019/08/18 15:45 <DIR> xampp
2019/06/17 16:43 <DIR> xampp-1.7.3
2019/06/27 23:11 <DIR> xampp-1.7.3-used
2019/06/27 23:04 <DIR> xampp-1.8.2
2019/06/22 22:13 <DIR> xampp-173
2019/08/16 22:58 <DIR> xampp-7.0.33
2019/08/18 17:06 <DIR> xampp-7.1.31
2019/09/15 21:06 <DIR> xampp-7.3.9

OK, here come the operations & log files.
---------------------------------------------------------------
For the 1st log file (2019-10-27-log-1.log):
In the `E:\temp\` folder, there are files & folders:
2019/10/27 01:09 <DIR> .
2019/10/27 01:09 <DIR> ..
2019/10/23 00:07 <DIR> 上线前备份
2019/10/20 03:58 <DIR> 备份
2019/10/27 01:09 <DIR> 微信订阅号

When entering the `temp` folder, WinSCP only shows one folder:
备份

---------------------------------------------------------------
For the 2nd log file (2019-10-27-log-2.log), the remote folder has:
In the `E:\temp\` folder, there are files & folders:
2019/10/27 01:26 <DIR> .
2019/10/27 01:26 <DIR> ..
2019/10/20 03:58 <DIR> 备份

When entering the `temp` folder, WinSCP shows exactly what's in this folder:
备份

Then, I create a folder named `上线前备份`, the listing in WinSCP become garbage:
澶囦唤
涓婄嚎鍓嶅锟?
---------------------------------------------------------------
For the 3rd log file (2019-10-27-log-3.log):
Just maintain what the remote folder has in the 2nd log file, exit WinSCP and restart it then enter the remote folder and WinSCP shows:
备份
上线前备�

---------------------------------------------------------------
For the 4th log file (2019-10-27-log-4.log):
In the `E:\temp\` folder, there are files & folders:
2019/10/27 01:40 <DIR> .
2019/10/27 01:40 <DIR> ..
2019/10/27 01:26 <DIR> 上线
2019/10/20 03:58 <DIR> 备份

When entering the `temp` folder, WinSCP shows exactly what's in this folder:
备份
上线

Then, I rename the folder named `上线` to `上线前备份`, the listing in WinSCP become garbage:
备份
上线前备�


---------------------------------------------------------------

The OSes & softwares I'm using are:
* local:
Windows 10 x64 Pro 1903 (18362.449) Chinese
WinSCP 5.15.5 9925 with Chinese Simplified language pack.
* remote:
Windows 10 x64 Ent 1903 (18362.449) Chinese
Windows's built-in OpenSSH server
with Default shell changed to `C:\Program Files\Git\bin\bash.exe`
(via https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_server_configuration#configuring-the-default-shell-for-openssh-in-windows )
Git 2.23.0.windows.1
OpenSSH SFTP 7.7.2.1 (OpenSSH_7.7p1 for Windows)
The SFTP server invoked by OpenSSH is `C:\Windows\System32\OpenSSH\sftp-server.exe` which is the Windows's built-in one.
  • 2019-10-27-log.zip (24.23 KB, Private file)
Description: Contains all 4 log files.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,392
Location:
Prague, Czechia

For the 1st log file (2019-10-27-log-1.log):
In the `E:\temp\` folder, there are files & folders:
2019/10/27 01:09 <DIR> .
2019/10/27 01:09 <DIR> ..
2019/10/23 00:07 <DIR> 上线前备份
2019/10/20 03:58 <DIR> 备份
2019/10/27 01:09 <DIR> 微信订阅号

When entering the `temp` folder, WinSCP only shows one folder:
备份
And that actually what the server returns. Not WinSCP fault.

Then, I create a folder named `上线前备份`, the listing in WinSCP become garbage:
澶囦唤
涓婄嚎鍓嶅锟?
WinSCP asks the server for a canonical path to /E:/temp/上线前备份 and the server returns /E:/temp/上线前备 followed by an invalid UTF-8 code. That makes WinSCP believe the server does not use UTF-8 encoding and falls back to a legacy encoding, what breaks everything after.

Again, not really WinSCP fault.

Reply with quote

Guest

Thanks for looking into this problem.

I've reported it to Win32-OpenSSH. Looks like it's an already existing problem for a long time, and others have such problem as well.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum