0

I've read Problems when using "New Windows Terminal" to ssh into non-UTF codepage servers where an answer suggests using LUIT or maybe Screen. But I am wondering if there is a different answer for the WSL console than for SSH

I am using Oracle Linux 8.5 under WSL on Windows 10.

I have a legacy Linux application that emits text encoded as CP437. It can't be configured to emit UTF-8.

This obviously doesn't display correctly as the WSL Console is understandably set for UTF-8 (code page 65001)

WSL console window properties showing code page 65001

The "Current Code Page" value here is 65001 but there is no obvious way to set it either temporarily or permanently.


I tried opening a command prompt and using chcp cp437 before invoking wsl but this didn't make any difference

screenshot of session with chsp then wsl and test

Between the >< is some 0xbf characters that I edited in using vim and can see in hexdump -C

I'd prefer not to make registry changes or affect my whole Windows environment.

Oracle Linux 8 is derived from Red Hat 8 and has deprecated screen. Its package installer yum doesn't find luit which exhausts my ideas so far for translating CP437 output to UTF-8 inside Linux.

I've tried Windows Terminal (invoked as terminal from the desktop search bar, but this doesn't seem to give me any options regarding code pages / encodings.

Windows Terminal running a test

Note: the white on green border is drawn using ANSI commands, not using the CP437 box-draw characters which I am trying to get working.


Can it be done?

1 Answers1

1

I haven't found an answer to my exact question but I have found a couple of usable workarounds.

SSHD + PuTTY

Initially, the only workaround I found was starting sshd and using Putty.

On Oracle 8.5 Linux in WSL I ran sudo ssh-keygen -A then sudo /usr/sbin/sshd. Then ran the Putty terminal-emulator, connected to localhost:22 (SSH protocol) and set Putty's translation to CP437 in Settings, Window, Translation.


LUIT

Eventually I decided to make a more determined effort to use LUIT

luit is probably packaged into X11 in the Oracle LInux repositories and I don't need all of X11

I downloaded the source for luit from https://invisible-island.net/luit/, compiled it and used that as follows.

sudo yum install gcc
wget https://invisible-island.net/datafiles/release/luit.tar.gz
tar xvzf luit.tar.gz
cd luit*/
./configure
make
sudo make install
man luit
luit -list
cd legacy_app_dir
luit -encoding CP437 legacy_app

enter image description here