{"slug": "solution-for-locale-and-character-encoding-issues-in-japanese-games-on-steam", "title": "Solution for locale and character encoding issues in Japanese games on Steam Deck", "summary": "The article explains two common issues when running Japanese games on Steam Deck: non-ASCII filenames not being accessible due to locale mismatches, and Japanese text displaying as mojibake or causing game crashes due to incorrect Windows ANSI codepage settings. It provides solutions for each problem, such as setting `LANG=en_US.utf8` in launch options for filename access and using `HOST_LC_ALL=ja_JP.UTF-8` for Japanese text support, but notes these fixes are mutually exclusive. The article then offers a workaround using a custom locale directory and `run.sh` script to enable both UTF-8 and Japanese Shift-JIS support simultaneously without requiring root access.", "body_md": "# Problem 1\n\nCannot access filenames containing non-ASCII characters.\n\nSteam Deck's SteamOS 3 provides only one locale named `en_US.utf8` (as configured in /etc/locale.gen) but /etc/locale.conf sets `LANG` to `en_US.UTF-8`. They don't match, so the effective locale for programs is `C` and the character set becomes limited to ASCII.\n\nSet the game's launch options in Steam to `LANG=en_US.utf8 %command%` to solve this.\n\nTo fix this for all applications running in desktop mode (eg. to correctly extract games), create a file named `~/.config/plasma-workspace/env/utf8.sh` containing (restart desktop mode to apply):\n\n```sh\n#!/bin/sh\nexport LANG=en_US.utf8\n```\n\n# Problem 2\n\nJapanese text displays as mojibake or question marks. Some games may even completely fail to load due to script compilation errors (common in visual novels). The Windows ANSI codepage must be set to SHIFT-JIS to fix this.\n\nWine uses the current system locale (set via `LANG`) or the `LC_ALL` environment variable to determine which ANSI codepage to use. This is equivalent to using Locale Emulator on Windows.\n\nSteam Deck's SteamOS 3 doesn't provide a `ja_JP.UTF-8` locale so this leaves `LC_ALL`.\n\nHowever Steam may override it, so instead set the game's launch options to `HOST_LC_ALL=ja_JP.UTF-8 %command%` to have Proton set `LC_ALL` to the desired value.\n\n# Problem 3\n\nThe simple solutions shown above to problem 1 and 2 are unfortunately mutually exclusive.\n\n`ja_JP.UTF-8` is not provided by SteamOS 3 so requesting it makes the effective Unix locale fallback to `C` (ASCII) again.\n\n# Complete solution\n\nThis sets the Wine codepage to Japanese and the Unix character set to UTF-8 without requiring root access or unlocking the readonly system partition of the Steam Deck.\n\n1. Extract the archive [steam-deck-jp-locale-utf8.tar.zst](https://gist.github.com/cfillion/4394c3b8cd051fb45721187053e92296/raw/28178bed85fb027e99a4cfae431a36240f21acd8/steam-deck-jp-locale-utf8.tar.zst) using Ark into the home directory on the Steam Deck (`/home/deck`).\n2. Double-check that `/home/deck/locales/run.sh` is executable (right click > properties > permissions).\n3. Set the game's launch options to `LANG=ja_JP.UTF-8 ~/locales/run.sh %command%` to fix locale and encoding issues.\n\n## Alternative steps\n\nFollow these steps instead to generate the files manually. A full install of Arch Linux is required (commands may need adjustments to work in other distributions).  \n\n1. On an Arch Linux install:\n    1. Uncomment `ja_JP.UTF-8` in /etc/locale.gen\n    2. Run the following commands:\n       ```sh\n       sudo locale-gen\n\n       mkdir locales\n       export LOCPATH=\"$HOME/locales\"\n       localedef -f UTF-8 -i ja_JP \"$LOCPATH/ja_JP.UTF-8\"\n       ```\n2. Transfer the `locales` directory created above into `/home/deck` on your Steam Deck (SteamOS 3).\n3. Create a file named `run.sh` inside that folder containing:\n   ```sh\n   #!/bin/bash\n   # https://gist.github.com/cfillion/4394c3b8cd051fb45721187053e92296\n   newlocpath=$(dirname \"$(realpath \"$0\")\")\n   script='\n     BEGIN { FS=OFS=\" '\"'--'\"' \" }\n     NF > 1 { for(i = 1; i < NF; ++i) printf \"%s\", $i OFS; }\n     { print \"env LOCPATH='\"'\"'\" newlocpath \"'\"'\"' \" $NF }\n   '\n   command=\"$(awk -v newlocpath=\"$newlocpath\" \"$script\" <<< \"${@@Q}\")\"\n   eval \"$command\"\n   ```\n4. Make `run.sh` executable: `chmod +x ~/locales/run.sh`\n5. Set the game's launch options to `LANG=ja_JP.UTF-8 ~/locales/run.sh %command%` to fix locale and encoding issues.\n\n# Sources and tips\n\n- https://github.com/wine-mirror/wine/blob/120ca2ff52d145faa925a41d494035842d47a967/dlls/ntdll/unix/env.c#L804-L805\n- https://github.com/wine-mirror/wine/blob/120ca2ff52d145faa925a41d494035842d47a967/dlls/ntdll/unix/env.c#L715-L719\n- https://github.com/ValveSoftware/Proton/blob/4221d9ef07cc38209ff93dbbbca9473581a38255/proton#L1081-L1087\n- `PROTON_LOG=1 WINEDEBUG=+file,+nls,+msgbox %command%` to troubleshoot file accesses, locales/character set conversions and message box contents.\n", "url": "https://wpnews.pro/news/solution-for-locale-and-character-encoding-issues-in-japanese-games-on-steam", "canonical_source": "https://gist.github.com/cfillion/4394c3b8cd051fb45721187053e92296", "published_at": "2022-08-22 05:20:40+00:00", "updated_at": "2026-05-24 05:35:31.761865+00:00", "lang": "en", "topics": ["hardware", "open-source", "developer-tools", "products"], "entities": ["Steam Deck", "SteamOS", "Wine", "Proton", "Steam", "Plasma", "Shift-JIS", "Locale Emulator"], "alternates": {"html": "https://wpnews.pro/news/solution-for-locale-and-character-encoding-issues-in-japanese-games-on-steam", "markdown": "https://wpnews.pro/news/solution-for-locale-and-character-encoding-issues-in-japanese-games-on-steam.md", "text": "https://wpnews.pro/news/solution-for-locale-and-character-encoding-issues-in-japanese-games-on-steam.txt", "jsonld": "https://wpnews.pro/news/solution-for-locale-and-character-encoding-issues-in-japanese-games-on-steam.jsonld"}}