Cannot access filenames containing non-ASCII characters.
Steam 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.
Set the game's launch options in Steam to LANG=en_US.utf8 %command%
to solve this.
To 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):
#!/bin/sh
export LANG=en_US.utf8
Japanese 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.
Wine 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.
Steam Deck's SteamOS 3 doesn't provide a ja_JP.UTF-8
locale so this leaves LC_ALL
.
However 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.
The simple solutions shown above to problem 1 and 2 are unfortunately mutually exclusive.
ja_JP.UTF-8
is not provided by SteamOS 3 so requesting it makes the effective Unix locale fallback to C
(ASCII) again.
This 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.
- Extract the archive steam-deck-jp-locale-utf8.tar.zst using Ark into the home directory on the Steam Deck (
/home/deck
). - Double-check that
/home/deck/locales/run.sh
is executable (right click > properties > permissions). - Set the game's launch options to
LANG=ja_JP.UTF-8 ~/locales/run.sh %command%
to fix locale and encoding issues.
Follow 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).
- On an Arch Linux install:
- Uncomment
ja_JP.UTF-8
in /etc/locale.gen - Run the following commands:
sudo locale-gen mkdir locales export LOCPATH="$HOME/locales" localedef -f UTF-8 -i ja_JP "$LOCPATH/ja_JP.UTF-8"
- Uncomment
- Transfer the
locales
directory created above into/home/deck
on your Steam Deck (SteamOS 3). - Create a file named
run.sh
inside that folder containing:#!/bin/bash # https://gist.github.com/cfillion/4394c3b8cd051fb45721187053e92296 newlocpath=$(dirname "$(realpath "$0")") script=' BEGIN { FS=OFS=" '"'--'"' " } NF > 1 { for(i = 1; i < NF; ++i) printf "%s", $i OFS; } { print "env LOCPATH='"'"'" newlocpath "'"'"' " $NF } ' command="$(awk -v newlocpath="$newlocpath" "$script" <<< "${@@Q}")" eval "$command"
- Make
run.sh
executable:chmod +x ~/locales/run.sh
- Set the game's launch options to
LANG=ja_JP.UTF-8 ~/locales/run.sh %command%
to fix locale and encoding issues.
- https://github.com/wine-mirror/wine/blob/120ca2ff52d145faa925a41d494035842d47a967/dlls/ntdll/unix/env.c#L804-L805
- https://github.com/wine-mirror/wine/blob/120ca2ff52d145faa925a41d494035842d47a967/dlls/ntdll/unix/env.c#L715-L719
- https://github.com/ValveSoftware/Proton/blob/4221d9ef07cc38209ff93dbbbca9473581a38255/proton#L1081-L1087
PROTON_LOG=1 WINEDEBUG=+file,+nls,+msgbox %command%
to troubleshoot file accesses, locales/character set conversions and message box contents.
Is there a Solution for zh_CN.utf8 ?