Sunday, April 28, 2024
25
rated 0 times [  25] [ 0]  / answers: 1 / hits: 62490  / 3 Years ago, fri, november 5, 2021, 9:58:54

One of the servers I quite often ssh to uses western encoding instead of utf-8 (and there's no way I can change that).



I've started writing a bash script to connect to this server, so I won't have to type out the entire address every time, but I would like to improve this script so it also changes the encoding of the terminal window correctly.



The change I need to do can be performed using the mouse by navigating to "Terminal"->"Set Character Encoding..."->"Western (ISO-8859-1)". Is there a terminal command that does the same thing, for the current terminal window/screen?



To clarify:

I'm not interested in ways of switching the locale of the system on the remote site - that system is administered by someone else, and I have no idea what stuff might depend on the latin-1 encoding there. What I want to do is to let this terminal window on my side switch character encoding to the above mentioned, in the same way I can do with my mouse and the menus.


More From » command-line

 Answers
4

You are looking for luit which is designed for this purpose:



$ luit -encoding ISO-8859-1 ssh remote.host



It will convert the output of the ssh command to UTF-8 so you don’t need to change the encoding of the terminal.


[#41496] Saturday, November 6, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
stantildlike

Total Points: 363
Total Questions: 135
Total Answers: 120

Location: Pitcairn Islands
Member since Fri, Dec 17, 2021
2 Years ago
;