How can I use UTF-8 on Linux from Windows 7 via PuTTY?

4

1

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?

Jonas

Posted 2011-03-30T07:57:02.170

Reputation: 21 007

Answers

5

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.

jho

Posted 2011-03-30T07:57:02.170

Reputation: 868

@Jonas: That seems fine, UTF-8 locales all support the same symbols. sv_SE.UTF-8 is just the Swedish locale, whereas en_US.UTF-8 is the United States locale. In practice this only affects for example month names, date/time formatting and other minor stuff that varies by country. – jho – 2011-03-30T08:24:57.503

Thanks, just changing the setting in PuTTY: Window > Translate as you mentioned was enough. – Jonas – 2011-03-30T08:29:28.600

3

Related: How to make the setting persistent.

– user1686 – 2011-03-30T10:50:17.390

0

The two basic factors are Window/Translation in putty and locale settings in Linux, as instructed here and many other places.

In addition, it may help in putty to set Connection/Data/Terminal-type string to "putty", and/or in Linux to export NCURSES_NO_UTF8_ACS=1. These two are also mentioned multiple places.

But: you may still get blocks for certain characters because the default fonts like Courier and Lucida Console don't have all unicode chars. Download and install http://dejavu-fonts.org/wiki/Download, and set putty to use it.

This last trick was necessary for me to get noping (recommended!) to show all graphic characters.

GauteLund

Posted 2011-03-30T07:57:02.170

Reputation: 1