Go back

Annoying locale issue with mosh

I'm a frequent user of mosh when connecting to remote machines. It's a tool to make ssh connections a bit more "mobile" so to say.

When switching my laptop to Fedora I no longer could connect to the remote openbsd machine using mosh. The following error showed up:

setlocale: Undefined error: 0
mosh-server needs a UTF-8 native locale to run.

Unfortunately, the local environment ([no charset variables]) specifies
the character set "US-ASCII",

The client-supplied environment (LC_ALL=sv_SE.UTF8) specifies
the character set "US-ASCII".

LANG=sv_SE.utf8
LC_COLLATE="C"
LC_CTYPE="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"
LC_ALL=sv_SE.UTF8
Connection to tilde.institute closed.
/usr/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)

I've tried everything with sending locale env variables to changing LANG, LC_ALL, LC_CTYPE etc both locally and remotely. Obviously I've checked the locale list on both systems to see that the locale exsists which it does. It was only today that I finally solved this little annoying problem. The solution? As simple as: In openbsd the locale is called sv_SE.UTF-8 and on fedora it's called sv_SE.UTF8.

So the annoying problem was simply a missing dash.