Skip to content
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

fix filename encode issue when download chinese filename #7542

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zlbruce
Copy link

@zlbruce zlbruce commented Nov 22, 2024

Description

OrcaSlicer: 2.2.0
Operator: Win10/11 Simplified Chinese

when download from makerworld.com.cn, if filename contain chinese, the downloaded filename is in wrong encode. if the invalid encode contain character not allowed in windows path, the download will failed.

check the wxwidget docs: https://docs.wxwidgets.org/3.2.6/overview_unicode.html

Notice that the narrow strings used with wxWidgets are always assumed to be in the current locale encoding

So, this code wxString(escaped_url), wxWidgets will think the string is in current locale(gbk in chinese windows).

test file: https://makerworld.com.cn/zh/models/648200?designId=648200#profileId-589194

Screenshots/Recordings/Graphs

before:
图片

after:
图片

this is also can use python to check:

'拉面套装分盘'.encode().decode("gbk", errors='replace')

图片

Tests

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

Successfully merging this pull request may close these issues.

1 participant