Skip to content

fix(input): read the input file from paths with non-ASCII characters - #4703

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
AlxcBTW:fix/input-config-non-ascii-path
Oct 14, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
AlxcBTW:fix/input-config-non-ascii-path

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

What

ANYPS5_INPUT_CONFIG is read with std::getenv, which returns the ANSI code page on Windows. A path containing ü fails with "Cannot convert character sequence: Illegal byte sequence" while the path is built, which stops input initialization; a path with 日本 arrives as ? and cannot be read. (With GCC 15 libstdc++ on MinGW, std::filesystem::path(const char*) treats narrow text as UTF-8, so the SDL_GetBasePath directory was already found; only the environment variable was broken.)

  • On Windows the variable is read with _wgetenv; elsewhere as UTF-8.
  • The SDL_GetBasePath directory is converted from UTF-8 explicitly.
  • Error messages print paths as UTF-8.

Test (pad_input_mapping): a temp directory named with ü and 日本 holds an ini that is read through ANYPS5_INPUT_CONFIG; a parse error and a missing file name the path in UTF-8. docs/user/INPUT_MAPPING.md notes that paths may contain any characters.

Tested

Not tested in a title; no game was run. Windows 11 build node (WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON): full build and the non-GPU ctest set, including pad_input_mapping. tools/check_conventions.py --base origin/main passes.

Checklist

🤖 Generated with Claude Code

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the diff, built it merged onto main and ran the libSceVideoOut ctest set (pad_input_mapping passes). The Windows-only path (_wgetenv, UTF-8 conversion) is covered by the full Build's windows job; merging once that is green.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 14, 2026
@adriadam10 adriadam10 self-assigned this Oct 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adriadam10

Copy link
Copy Markdown
Collaborator

Rebased onto current main: the only conflict was in tests/InputMapping.cpp (the new mouse-look tests next to nonAsciiPaths); both kept, no logic changes. Built and ran the libSceVideoOut ctest set (pad_input_mapping passes). The Windows-only path (_wgetenv, UTF-8 conversion) is covered by the full Build's windows job; merging once that is green.

@adriadam10
adriadam10 force-pushed the fix/input-config-non-ascii-path branch from d3f409f to b8ed789 Compare October 14, 2026 16:55
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 14, 2026
@adriadam10
adriadam10 merged commit 0ccf53d into boykopovar:main Oct 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants