Comment 16 for bug 1576411

Revision history for this message
Nish Aravamudan (nacc) wrote :

@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

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?