Skip to content

[Windows] UnicodeEncodeError when running mempalace mine on GBK console #1034

@kidwords

Description

@kidwords

Environment

  • OS: Windows 11
  • Python: 3.12
  • mempalace version: 3.3.0
  • Console: PowerShell/CMD with GBK encoding

Problem

When running mempalace mine, the command fails with UnicodeEncodeError:

UnicodeEncodeError: 'gbk' codec can't encode character '\u2713' in position 2: illegal multibyte sequence

This happens in miner.py line 596:

print(f"  ✓ [{i:4}/{len(files)}] {filepath.name[:50]:50} +{drawers}")

The checkmark character (U+2713) cannot be encoded in GBK.

Workaround

Set environment variable before running:

chcp 65001 >nul 2>&1 && set PYTHONIOENCODING=utf-8 && mempalace mine <path>

Suggested Fix

Replace with ASCII character or make it conditional.

Error Log

Traceback (most recent call last):
  File "...\mempalace\miner.py", line 596, in cmd_mine
    print(f"  \u2713 [{i:4}/{len(files)}] {filepath.name[:50]:50} +{drawers}")
UnicodeEncodeError: 'gbk' codec can't encode character '\u2713' in position 2: illegal multibyte sequence

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/miningFile and conversation miningarea/windowsWindows-specific bugs and compatibilitybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions