9001 / 9001/copyparty

Charset handling issues with diacratics in created folder name

未关闭
#605 3 条评论 0 个 reaction 已指派 1 人 已被 @9001 认领 在 GitHub 查看
bug
主要语言
Python
星标
46.7k
派生
1.9k
平均合并
9 天 2 小时
30 天内合并 PR
4

描述

### Describe the bug
Creating a folder with diacratics from within Copyparty, and dragging a folder of the same name from your OS will create two different folders.

Here's how I realized it:

I was moving a lot of files from various disks to Copyparty, strictly through drag&drop via up2k, and I just realized that a folder is seemingly appearing twice.

Image

They have the same name. Clicking the second folder does show me being in the second folder in the sidebar, but as soon as I refresh (so, keep the same URL), copyparty puts me into the first one.

A regular `ls -l` shows both folders as being unique.
```
drwxr-xr-x 11 admin administrators 4096 2025-08-14 02:09 ZZ-Téléphones/
drwxr-xr-x 11 admin administrators 4096 2025-08-14 00:03 ZZ-Téléphones/
```

However, using `printf "%s\n" * | cat -vte` reveals that the "é" characters are printed differently:
```
[sora@lillie Photographie]$ printf "%s\n" * | cat -vte
ZZ-TeM-LM-^AleM-LM-^Aphones$
ZZ-TM-CM-)lM-CM-)phones$
```
one being `e` + `m-Lm-^A` to represent an é, coming from my drag & drop. the other being `M-CM-)` to represent that same character, coming from when I created the folder through Copyparty's UI.

### To Reproduce

https://github.com/user-attachments/assets/2a3cf1de-849a-46fa-901d-2b7acfe65e88

### Expected behavior
Copyparty notices the folder already exists / Sanitizes the incoming folder name to not encode diacratics in a different way.

### Server details
* **server OS / version:** Linux, QNAP QTS (NAS software)
* **how you're running copyparty:** Docker 5.10.60
* **docker image:** copyparty/ac, linux/amd64

### Client details
This is not particularly specific to my client, but just in case:
* the device type and model: MacBook Pro
* OS version: macOS Sequoia 15.6 (24G84)
* browser version: Safari 18.6 (20621.3.11.11.3)

贡献指南

打开贡献指南

调研方向

查看 copyparty 中的文件夹创建和名称规范化逻辑,相关代码可能位于上传处理或文件系统交互部分。该 issue 涉及变音符号的字符集规范化(NFD vs NFC)。检查通过 UI 创建文件夹与通过拖放(up2k)创建文件夹时,文件夹名称的处理方式。目标是确保 Unicode 规范化保持一致,使包含变音符号的名称被视为同一个文件夹。通过两种方式创建包含变音符号的文件夹,并验证它们是否被视为相同,以进行测试。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
backend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。