Thursday, October 10, 2019

How to print and type non-english locale symbols over ssh on Solaris ?

In short, it depends on the locale in both cases. This small note is not about how to configure the locale and terminal settings. There are too many dependent factors : supporting fonts on the source of connection, locale settings on source of connection, settings of the terminal, using unicode etc. Shortly:

1. To display locale symbols on the terminal, you have to set either LANG, or LC_CTYPE, or LC_ALL session variables, corresponding to your locale. You may be also required to use settings of individual program (vi(m)), implementing interim iconv operations etc.

2. To enter/type non-english symbols over ssh, you have to send locale variables from the source to the destination, using setting SendEnv in ssh client config file (SendEnv LC_* LANG for example). Without this I was unable to input non-english characters inside ssh session to Oracle Solaris (sparc) . On Linux systems all worked without it.

3. There could be other methods (echo -e \uHHHH etc.), it highly depends on your needs.

4. Do not forget to enable 'stty defeucw' setting for the terminal session. Without it sqlplus, for example, treat one non-english symbol as number of bytes (2 for russian symbols) during deleting it via backspace.

Good Luck !