Skip to content

[Bug] The directory before zip is compressed using Chinese name, and the image cannot be recognized after importing. #2859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
shenkaibo opened this issue Apr 11, 2025 · 2 comments

Comments

@shenkaibo
Copy link

Contact Information

shenkaibo

MaxKB Version

1.10.3-lts

Problem Description

zip 压缩前的目录使用中文名,导入后图片识别不出来

中文引用图片.zip

Steps to Reproduce

zip 压缩前的目录使用中文名,导入后图片识别不出来

Image

The expected correct result

No response

Related log output

Additional Information

No response

@shaohuzhang1 shaohuzhang1 changed the title [Bug] zip 压缩前的目录使用中文名,导入后图片识别不出来 [Bug] The directory before zip is compressed using Chinese name, and the image cannot be recognized after importing. Apr 11, 2025
@Shenguobin0102
Copy link

您好,请确认一下打包压缩时操作系统的编码。我们下载您提供的文件后重新解压后再次压缩,上传到知识库是正常的,没有乱码,图片也正常显示。重新压缩后的文件见附件,您可以下载后导入确认。
default (2).zip
操作系统使用的编码不同,生成的文件名的编码也不相同,导致MK在得到文件后解码的结果也不一样,图片文件找不到的情况是依照解码后的文件路径找不到相关图片导致的。目前研发也没有很好的解决方案来处理这个问题。
不过这个问题可以通过修改操作系统的默认编码作为用户方的临时解决方案。

@shaohuzhang1
Copy link
Contributor

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Hello, please confirm the encoding of the operating system when packaging compression. We download the file you provided and re-decompress it and compress it again. It is normal to upload it to the knowledge base, without garbled code, and the pictures are also displayed normally. See the attachment for the recompressed file, you can download it and import it to confirm.
default (2).zip
The encoding used by the operating system is different, and the encoding of the generated file names is also different, resulting in the decoding results of MK after obtaining the file. The situation where the image file cannot be found is that the relevant picture cannot be found according to the decoded file path. There is no good solution for R&D to deal with this problem at present.
However, this problem can be used as a temporary solution for the user by modifying the default code of the operating system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants