Skip to content

Chinese characters become mojibake when using custom text on Windows build and the font cannot be specified by --text-font flag #236

@GitHubonline1396529

Description

@GitHubonline1396529

Brief Description

I'm using Activate Linux on Windows. But When I specifying Chinese text via -t, --text-title/-m, --text-message flags in the Windows version (activate-windows64.exe), the rendered text shows mojibake (tofu characters). However, the default Chinese localization works correctly without any encoding issues.

Steps to Reproduce

In MSYS2 shell (UTF-8 environment):

./activate-windows64.exe -t "激活 MSYS 2" -m "转到“设置”以激活 MSYS 2"

Then observe corrupted text rendering:

���� MSYS 2
Л�������á��L��� MSYS 2

Expected Behavior

Correct display matching the default Chinese localization text.

激活 MSYS 2
转到“设置”以激活 MSYS 2

Environment

  • OS: Windows 10 22H2 (Simplified Chinese locale)
  • Shell: MSYS2 Zsh 5.9 (UTF-8 mode confirmed by $LANG=zh_CN.UTF-8)
  • Tested binaries: Both prebuilt v1.1.0 release and self-compiled version
  • Font issue: Custom fonts via --text-font flag have no effect

Critical Observations

Encoding Paradox

  • Default localization works: Program can render Chinese correctly. If I just run activate-windows64.exe Chinese text would be shown correctly.
  • English text works correctly: ./activate-windows64.exe -t "Activate MSYS 2" -m "Go to Settings to activate MSYS 2".
  • Custom parameters fail: Possible UTF-8 (chcp 65001) / GBK (chcp 936) conversion mismatch in argument handling.

Font Rendering Anomaly

I've noticed that the text appears in a low-resolution serif font (see screenshot below), even when specifying --text-font Arial. I guess this suggests Cairo may not be loading system fonts properly.

The Font

Analysis

Based on mojibake patterns, 激活���� and 转到设置Л������� might suggests GBK bytes misdecoded as UTF-8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions