Problem displaying non-ASCII characters in OOD SSH client

Hi All,
I’m having a motd in place that creates tables using the terminaltables python module.
It gets displayed correctly when opening up an ssh session from the MobaXterm SSH client.
image
However, this is not the case for the OOD SSH client.
image

I also noticed that LANG has the value C assigned in OOD, whereas in Moba it contains the value C.UTF-8. Simply running export LANG=C.UTF-8 in ~/.bashrc doesn’t help.
Do you have an idea what is wrong here?
Thanks

You can set LANG in /etc/ood/config/nginx_stage.yml like so. Though in 1.7+ we force it to en_US.UTF-8.

# /etc/ood/config/nginx_stage.yml
pun_custom_env:
  LANG: "en_US.UTF-8"

A couple quick tests show that

  • loading ~/.bashrc is after the MOTD (this is why it ididn’t do anything for you)
  • the ssh session on the remote host seems to inherit LANG from the originating process if it’s not set explicitly (this is why setting LANG on the OOD server side may work).

Unfortunately setting LANG to en_US.UTF-8 didn’t help. I’ve printed LANG inside the motd to make sure it really is set correctly. Perhaps there are some other variables that should be changed?
When connecting from Putty and MobaXTerm the table gets displayed correctly. This is not the case for OOD’s web SSH-client and also for mremote.

This is a problem in terminaltable (see https://github.com/Robpol86/terminaltables/issues/57).
Using DoubleTable works fine - so there is nothing wrong with the encoding of OOD’s SSH web client.
Thanks

Hi, our workaround of using DoubleTable stopped working after upgrading to OOD v1.8-18.

We’ve tested rich.table as an alternative but that won’t render in OOD SSH client either.

We’d appreciate it if you can have a look.

Thanks,
–Alex

Weak. Are you able to share the script that generates the message of the day? Or a very simplified version of it?

By this you mean it is correctly being set as en_US.UTF-8?

Hi -

I am working with sashka on the DoubleTable issue. To reproduce the issue using the rich table alternative, I am using the code from the rich.table link sashka included.

from rich.console import Console
from rich.table import Table

table = Table(title="Star Wars Movies")

table.add_column("Released", justify="right", style="cyan", no_wrap=True)
table.add_column("Title", style="magenta")
table.add_column("Box Office", justify="right", style="green")

table.add_row("Dec 20, 2019", "Star Wars: The Rise of Skywalker", "$952,110,690")
table.add_row("May 25, 2018", "Solo: A Star Wars Story", "$393,151,347")
table.add_row("Dec 15, 2017", "Star Wars Ep. V111: The Last Jedi", "$1,332,539,889")
table.add_row("Dec 16, 2016", "Rogue One: A Star Wars Story", "$1,332,439,889")

console = Console()
console.print(table)

davepow> python --version
Python 3.6.5
davepow>

Here is a screenshot from successfully running the test in a MobaXterm terminal

image

Here is a screenshot from an unsuccessful test in OOD 1.8

image

Thanks,
Dave