Windows – How to use UTF-8 on Linux from Windows 7 via PuTTY

latin1postgresqlputtyutf-8windows 7

I use PuTTY on Windows 7 to access a Linux machine with Ubuntu 10.10. I think that Windows 7 is using Latin-1. But I need to use UTF-8 on the Linux machine and in a PostgreSQL database.

How can I do this with PuTTY?

Best Answer

  • You can set PuTTY to use UTF-8 from the configuration dialog when you connect. Go to Window -> Translation, and set "Received data assumed to be in which character set" to UTF-8.

    Also check that your locale is something ending in UTF-8 by running locale after connecting.

    If it's not, run locale -a to see all the locales you have available. If there are no UTF-8 locales available, you need to configure your /etc/locale.gen, it's usually fairly well commented and it should be obvious what to add or uncomment. Then run locale-gen and check locale -a again to see the UTF-8 locale that was generated.

    Something like export LC_ALL="sv_SE.UTF-8" ought to do the trick of actually setting the locale if and when it's generated.

  • Related Question