0

I've install Ubuntu as web server without desktop mode. I'm also running website and I need to develop it with Thai language.

Question 1: If I login on server directly, how can i read/write Thai language (with default command in English)?

Question 2: If I ssh remote from my Mac, how can i read/write Thai language same (this question after i pass first question i may adjust by myself)?

Thank you all.

Kaz Wolfe
  • 34,122
  • 21
  • 114
  • 172

1 Answers1

1

You can type Thai text quite normally inside programs and whatnot that are unicode compliant (for example, vi and nano).

However, the commands must still be run in English, as the system does not know what the translation of each command is to Thai. Note that you can usually pass arguments (like --name <name>) in Thai, but this depends on the application at hand.

In order to do this, you just need to set your keyboard layout to Thai format, and make sure your SSH client can forward and see the Thai letters and unicode symbols correctly. You can do this by setting your locale.

Edit your ~/.ssh/config (or whatever SSH config file you use) on your side of the link and add the below lines:

Host *
SendEnv LC_*

Restart your shell session, and be sure your local shell actually does support Thai.

Kaz Wolfe
  • 34,122
  • 21
  • 114
  • 172
  • 1
    Sorry Kaz, after i got your answer I try to open my file with vi and try to type Thai, but i don't know how to change keyboard language to thai. I means within text mode only because i don't have desktop mode, no gnome, no kde. – Thanasarut Sep 17 '16 at 00:33
  • @Thanasarut That needs to be done on your side of the machine, so however you normally swap layouts. The tunnel doesn't honestly care what layout you're using in this case. – Kaz Wolfe Sep 17 '16 at 00:35
  • Possibly helpful: http://askubuntu.com/questions/149876/how-can-i-install-one-language-by-command-lin I think the language code is th – Elder Geek Sep 17 '16 at 00:36
  • @KazWolfe if so... skip my first question... can you help me to answer the second question.... if I remote ssh from my mac in this way the application is my terminal on my mac, and surely i can configure my terminal to be able to read thai language, also on my mac i can switch to thai keyboard layout, how can the ssh terminal know that i typing the thai keyboard? – Thanasarut Sep 17 '16 at 00:55
  • @Thanasarut Because SSH doesn't care about how you're typing. It will just forward whatever characters are typed into it. Your computer decides what is typed. The SSH tunnel just moves that over, without doing any sort of thinking. – Kaz Wolfe Sep 17 '16 at 00:56
  • @KazWolfe you means, is there any way to accomplish my need?..... or i have to edit the file and upload to ubuntu server then just check the language from web browser to check typo only? – Thanasarut Sep 17 '16 at 01:19
  • @Thanasarut I mean, if you can type Thai on your local Mac, it should work the exact same over the SSH tunnel. – Kaz Wolfe Sep 17 '16 at 01:23
  • @KazWolfe, I can type Thai on my Mac, but the result show not correct thai, like i type "ทดสอบ" in vi but it's show "?~W ?~T ส อ ?~Z" like this in vi. – Thanasarut Sep 17 '16 at 01:27
  • @Thanasarut Ah. I understand now. Let me write a new answer. – Kaz Wolfe Sep 17 '16 at 01:31