Edit History Actions Discussion

Diff for "FAQ/Unicode"

Differences between revisions 8 and 9
Revision 8 as of 2007-12-16 15:38:50
Size: 1300
Editor: indigo176
Comment: ".bashrc" changed to ".profile" (as the shell-setup script writes the locale info to ".profile") to keep things consistent
Revision 9 as of 2008-01-04 00:26:07
Size: 1304
Comment: putty link
Deletions are marked like this. Additions are marked like this.
Line 28: Line 28:
Remember that you have to change the charset in your SSH-client as well! Use the translation option in putty for example. Remember that you have to change the charset in your SSH-client as well! Use the translation option in ["PuTTY"] for example.

Question

Does the shell provide unicode support?

Answer

Yes. Both for commandline programs and for webpages.

Problem #1 - Commandline programs

Localized characters doesn't display correctly in irssi, nano etc (they are replaced with question marks, squares or something similar.)

Solution:

Write this command at the shell prompt

echo 'export LC_ALL="en_US.UTF-8"' >> ~/.profile

Next time you log in your shell will be in unicode.

To use unicode in irssi, type this in the command prompt in irssi:

/set term_charset UTF-8

Use this command if you want to send text in another charset to other users that are still using ISO for example (note however that you will not be able to send UTF text with this setting):

/set recode_out_default_charset iso-8859-1

Remember that you have to change the charset in your SSH-client as well! Use the translation option in ["PuTTY"] for example.

Problem #2 - Webpages

Characters in webpages doesn't display correctly.

Solution:

Save the webpages in UTF-8 from your text-editor. Then create a new file named .htaccess in the same directory as your webpages (public_html) with the following content:

AddDefaultCharset UTF-8


  • ["CategoryFAQ"]