Skip to content

Languages: LANG keeps its UTF-8 codeset; df, gamelist.xml and theme l… - #368

Merged
kloptops merged 1 commit into
PortsMaster:mainfrom
kloptops:fix-locale-utf8
Nov 2, 2026
Merged

kloptops merged 1 commit into
PortsMaster:mainfrom
kloptops:fix-locale-utf8

Conversation

@kloptops

@kloptops kloptops commented Nov 2, 2026

Copy link
Copy Markdown
Member

…ookups don't depend on the locale

pugwash.lang set LANG (or LC_ALL) to the bare language, "ru_RU", "en_US". Where the locale exists, as on dArkOS (a full Debian with every locale), a bare name is a legacy codeset: ISO-8859-5 for ru_RU, GB2312 for zh_CN, Latin-1 for en_US. Every program PortMaster starts inherited it. Found by the PortMaster Test Suite on an RG353V with dArkOS 08282026, and checked there with harbourmaster:

  • df printed "Файловая система" in ISO-8859-5 (0xC4 first), get_path_fs() failed to decode it, and every port install failed (Russian, Ukrainian, Chinese, Japanese, Korean users).
  • gamelist.xml was written with open()'s locale default: under en_US (Latin-1) a "’" in the list made every update fail and roll back, and "é" went out as Latin-1 in a file that declares utf-8.
  • The theme server's renderers started with a Latin-1 filename encoding; looking up the button text "Zurück" as a file gave EPERM on exFAT, which Path.is_file() lets through, and the render crashed.

So:

  • LANG, LC_ALL and LC_MESSAGES get ".UTF-8" (LANGUAGE, a gettext list, keeps the bare language); CURRENT_LANG is still the language.
  • get_path_fs() runs df with LC_ALL=C, decodes leniently, and gives None when df can't be run (a CFW without df: installs go on).
  • gamelist.xml, gameinfo.xml, muOS's description .txt and TrimUI's config.json are written as UTF-8.
  • ResourceManager.find() treats a name the filesystem refuses as not found.

Claude-Session: https://claude.ai/code/session_01NxABmR1rUUgi4iicVLZchY

…ookups don't depend on the locale

pugwash.lang set LANG (or LC_ALL) to the bare language, "ru_RU", "en_US". Where the
locale exists, as on dArkOS (a full Debian with every locale), a bare name is a
legacy codeset: ISO-8859-5 for ru_RU, GB2312 for zh_CN, Latin-1 for en_US. Every
program PortMaster starts inherited it. Found by the PortMaster Test Suite on an
RG353V with dArkOS 08282026, and checked there with harbourmaster:

- df printed "Файловая система" in ISO-8859-5 (0xC4 first), get_path_fs() failed
  to decode it, and every port install failed (Russian, Ukrainian, Chinese,
  Japanese, Korean users).
- gamelist.xml was written with open()'s locale default: under en_US (Latin-1)
  a "’" in the list made every update fail and roll back, and "é" went out as
  Latin-1 in a file that declares utf-8.
- The theme server's renderers started with a Latin-1 filename encoding;
  looking up the button text "Zurück" as a file gave EPERM on exFAT, which
  Path.is_file() lets through, and the render crashed.

So:
- LANG, LC_ALL and LC_MESSAGES get "<language>.UTF-8" (LANGUAGE, a gettext
  list, keeps the bare language); CURRENT_LANG is still the language.
- get_path_fs() runs df with LC_ALL=C, decodes leniently, and gives None
  when df can't be run (a CFW without df: installs go on).
- gamelist.xml, gameinfo.xml, muOS's description .txt and TrimUI's
  config.json are written as UTF-8.
- ResourceManager.find() treats a name the filesystem refuses as not found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxABmR1rUUgi4iicVLZchY
@kloptops
kloptops merged commit 70e8ae2 into PortsMaster:main Nov 2, 2026
4 checks passed
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