Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charset seem to be ISO-8859 even when system is set to UTF-8 #70

Closed
kuttkutt opened this issue Jun 6, 2020 · 18 comments
Closed

Charset seem to be ISO-8859 even when system is set to UTF-8 #70

kuttkutt opened this issue Jun 6, 2020 · 18 comments

Comments

@kuttkutt
Copy link

kuttkutt commented Jun 6, 2020

Hello,
I set the Raspberry to UTF-8 and the character encoding of the terminal (screenshot is Terminus, but it's the same, when I try Putty) to UTF-8 aswell.

Screenshot_20200606-084505_Termius

The borders seem to use the wrong encoding. MC for example works fine without any crumbled screen.

If I set the character encoding to ISO-8859 on putty/terminus, wavemon looks pretty again, but mc is crumbled. Actually this would be right, because the Raspberry rUns still on UTF-8

So my guess is that wavemon does not regotnize the charset of the system and falls back to ISO-8859...
Is there a way to tell wavemon to use UTF-8 e.g. in the config file?

I forgot: These are my locales settings:
root@raspberrypi:/home/pi# locale LANG=en_GB.UTF-8
LANGUAGE=
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

The problem persist aswell, when I set LC_ALL and LANGUAGE

@grrtrr
Copy link
Contributor

grrtrr commented Jun 7, 2020

I am not sure that this an encoding issue. My terminal uses en_CA.UTF-8 without problems.
Can you check what the value of the $TERM variable is? Mine is xterm-256color.

@kuttkutt
Copy link
Author

kuttkutt commented Jun 8, 2020

hmm same here:

pi@raspberrypi:~ $ echo $TERM
xterm-256color

I mean it's really odd. I am used to have this issue with my, when I set the wrong encoding in my terminal tool. Is there a way (command line parameter) on wavemon to check which character encoding is currently in use? Or maybe force a different encoding (may be by recompiling it)?

@grrtrr
Copy link
Contributor

grrtrr commented Jun 9, 2020

I even generated en_GB.UTF-8, unable to reproduce this on my Linux system.

You said that you use both putty and terminus (this terminus?). Both are terminal emulators, so the problem could be sitting there.

Does the problem persist when you ssh into the pi from a Linux terminal and run mc/wavemon?

@kuttkutt
Copy link
Author

kuttkutt commented Jun 9, 2020

Well, to ssh in from an other linux machine is a bit difficult ;)

Just let me briefly describe my situation :)
I'm on a sailboat anchoring at the island Dominica. It's a few meters to my WiFi Hotspot (a Bar) and so I build a small WiFi Repeater out of a HighGain Netgear A6210 USB WLAN Stick and build a small WiFi onboard for alle the Tablets and Mobile Phones.

I use Putty on my Laptop and Terminus on my Android Tablet. I guess the "Terminus" I use is a port of the one you linked in from GitHub.

I got wavemon via the apt reposity. Could it be that thats the problem? Maybe I should try to compile it from source ...

@grrtrr
Copy link
Contributor

grrtrr commented Jun 9, 2020

wavemon already seems to be relatively new, though you did not include a version. It could be ncurses, which is where mc comes in handy.
htop is another strawman to use, would be interesting for comparison.

@grrtrr
Copy link
Contributor

grrtrr commented Jun 9, 2020

I was able to reproduce the issue with Android Termius. A fix is to set the terminal type (Settings -> Terminal Type) to vt100.
This is still not ideal (black/white only), but the box lines are rendered better.

@kuttkutt
Copy link
Author

Thanks for the info. Yea, with vt100 it looks alright.

Actually I don't care much about the colors - as long the output is readable, it's ok with me.

PS: I compiled it from source, but it didn't made any change

@Disassembler0
Copy link

Encountered the same, also on RPi. In PuTTY the fix is to check "Enable VT100 line drawing even in UTF-8 mode" checkbox under Window > Translation

I also confirm that other apps (mc, htop etc.) work without any issues even without this setting. PuTTY usually sets $TERM to plain xterm.

@grrtrr
Copy link
Contributor

grrtrr commented Sep 23, 2020

I will look into this eventually when I get time.

Busy with other things, so this sinks to the bottom of my priority list.

@kuttkutt
Copy link
Author

No prob, it's not such a big hassle. If you find time to look / fix that, then it will be fixed ;)

@hrr2020
Copy link

hrr2020 commented Oct 3, 2020

I'm also facing this issue on an RPi, connecting from Bash on Windows Subsystem for Linux (Windows 10). Level histogram "curve" font does not look right + in the scan window some SSIDs which contain unicode umlaut characters are not showing up correctly. They show in literal form, like "\xc3\xa4".

grrtrr pushed a commit that referenced this issue Oct 3, 2020
@hrr2020
Copy link

hrr2020 commented Oct 4, 2020

I'm also facing this issue on an RPi, connecting from Bash on Windows Subsystem for Linux (Windows 10). Level histogram "curve" font does not look right + in the scan window some SSIDs which contain unicode umlaut characters are not showing up correctly. They show in literal form, like "\xc3\xa4".

Just FYI: the same thing with local terminal directly, on two different RPis. Bash itself prints out unicode characters just fine (at least the ones I've tested).

grrtrr pushed a commit that referenced this issue Oct 11, 2020
@grrtrr
Copy link
Contributor

grrtrr commented Oct 11, 2020

I just added ncursesw support in master and I believe the problem is fixed:

  1. Clone from current master,
  2. make sure that libncursesw{6,5} and libncursesw{6,5}-dev are installed (6 is the more recent version).
  3. Rebuild (./config/bootstrap; ./configure && make && sudo make install).
  4. Export the environment variable NCURSES_NO_UTF8_ACS:
> export NCURSES_NO_UTF8_ACS=1
  1. Start wavemon.

Try if (4) is needed by skipping the step. If it is needed, you can add this to your ~/.bashrc:

> echo -e "\n# ncurses(3) initialization for vt100 line drawing\nexport NCURSES_NO_UTF8_ACS=1" >> ~/.bashrc

I confirmed this to work by logging in from a chromebook and from Android termius.

@Disassembler0
Copy link

Works for me on Raspbian 10 + PuTTY, but NCURSES_NO_UTF8_ACS=1 is needed. Without it, it looks still the same as on OP's screenshot.

As a side note, on Raspbian 10 the package is called just libncurses-dev. The packages libncurses5-dev and libncursesw5-dev exist, but they are just transitional packages for libncurses-dev in version 6.1 anyway.

@grrtrr
Copy link
Contributor

grrtrr commented Oct 13, 2020

Thanks for testing. Some other tricks (like changing the terminal settings) or putty-specific settings might help in corner cases.

I will add this to the documentation and wrap up the fix soon.

grrtrr pushed a commit that referenced this issue Oct 18, 2020
When linking against libncursew, make use of the available
wide-character support for line drawing.
@grrtrr
Copy link
Contributor

grrtrr commented Oct 18, 2020

I added another improvement - when linking against libncursesw, the NCURSES_NO_UTF8_ACS is not needed, it will use the wide-character variants for drawing the box outlines. Tested to work on Android with putty/termius and on chromebook with the ssh extension.

grrtrr pushed a commit that referenced this issue Oct 18, 2020
When linking against libncursew, make use of the available
wide-character support for line drawing.
@Disassembler0
Copy link

Yesss! I confirm that on Raspbian 10 + PuTTY, NCURSES_NO_UTF8_ACS=1 is no longer needed either.

@grrtrr
Copy link
Contributor

grrtrr commented Oct 19, 2020

Thank you for testing. I will update the documentation to close the issue.

grrtrr pushed a commit that referenced this issue Oct 21, 2020
@grrtrr grrtrr closed this as completed Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants