I've just changed default motd in Ubuntu (I edited /etc/update-motd.d/* files) and added some string in polish:

echo "Aby uzyskać dodatkowe informacje i przykładowe skrypty wpisz:"

but autogenerated /etc/motd is without accent characters:

Aby uzyska dodatkowe informacje i przykadowe skrypty wpisz:

So "ć" and "ł" is missing. So how to enable utf-8 encoding in motd?


You can use the LANG environment variable to enable UTF-8 encoding. Just edit your script file (under /etc/update-motd.d/*) by adding the line:

export LANG="en_US.UTF-8"
  • I've already tried this and it is not working. – klew Nov 30 '10 at 12:10
  • I've just tried it again and now it is working. When I edited my files with motd there was no accecnt characters at all (it is strange, because I was writing motd with them several times). I added them and now it works. Thanks for your answer! – klew Dec 2 '10 at 17:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.