@ogra, thank you for your example from nethack! I hit the same issue with a simple python3 script that was failing due to sys.getfilesystemencoding() returning 'ascii'. Modifying my wrapper to do the following:
export LOCPATH=$SNAP_USER_DATA
LANG=en_US
ENC=UTF-8
LOC="$LANG.$ENC"
if [ ! -e $SNAP_USER_DATA/$LOC ]; then
localedef --prefix=$SNAP_USER_DATA -f $ENC -i $LANG $SNAP_USER_DATA/$LOC
fi
@ogra, thank you for your example from nethack! I hit the same issue with a simple python3 script that was failing due to sys.getfilesyst emencoding( ) returning 'ascii'. Modifying my wrapper to do the following:
export LOCPATH= $SNAP_USER_ DATA
LANG=en_US
ENC=UTF-8
LOC="$LANG.$ENC"
if [ ! -e $SNAP_USER_ DATA/$LOC ]; then $SNAP_USER_ DATA -f $ENC -i $LANG $SNAP_USER_ DATA/$LOC
localedef --prefix=
fi
export LC_ALL=$LOC
export LANG=$LOC
export LANGUAGE=${LANG%_*}
seems to be a necessary step for my script. It seems like this is something we would want to eventually internalize to snapcraft/snapd?