[systemd-devel] Need suggsetion on weird characters on RHEL7 !

Mantas Mikulėnas grawity at gmail.com
Tue Oct 28 05:51:34 PDT 2014


On Tue, Oct 28, 2014 at 2:28 PM, Manish Saxena <msaxena at redhat.com> wrote:
> Hello,
>
> I need suggestion on a case 01270671, where customer is getting weird characters as below :
> Can some one suggest what is wrong?
>
> ------------------------
> Weird characters when displaying man pages on RHEL 7.0
>
> e.g. man firewall-cmd
>
> ample 2
>        Enable port 443/tcp immediately and permanently in default zone. To make the change effective immediately and
>        also after restart we need two commands. The first command makes the change in runtime configuration, i.e.
>        makes it effective immediately, until restart. The second command makes the change in permanent
>        configuration, i.e. makes it effective after restart.
>
>            firewall-cmd --add-port=443/tcp
>            firewall-cmd --permanent --add-port=443/tcp
>
> EXIT CODES
>        On success 0 is returned. On failure the output is red colored and exit code is either 2 in case of wrong
>        command-line option usage or one of the following error codes in other cases:
>
>        ┌────────────────────┬──────â”
>        │String              │ Code │
>        ├────────────────────┼──────┤
>        │ALREADY_ENABLED     │   11 │
>        ├────────────────────┼──────┤
>        │NOT_ENABLED         │   12 │
>        ├────────────────────┼──────┤
>        │COMMAND_FAILED      │   13 │
>        ├────────────────────┼──────┤
>        │NO_IPV6_NAT         │   14 │
>        ├────────────────────┼──────┤
>        │PANIC_MODE          │   15 │
>

What you're seeing here is a table or a tree drawn using the Unicode
line-drawing characters, which `man` outputs encoded as UTF-8 (due to
the correct $LANG), but your terminal emulator is trying to decode
each byte as ISO-8859-1 instead (usually due to wrong, or lack of,
$LANG in its own environment).

You didn't mention /which/ terminal emulator is used:

* For the Linux console, UTF-8 mode is enabled by
systemd-vconsole-setup.service, but only when the system locale is a
UTF-8 one (that is, when /etc/locale.conf has LANG=en_GB.UTF-8 or
something such). [Note that some things might accidentally turn off
the UTF-8 mode or prevent it from being enabled; there was another
thread just last week about such problems.] Check
src/vconsole-setup/vconsole-setup.c:enable_utf8 to see how it's done.

* For X11 terminal emulators, having $LANG in environment should be
enough. This problem usually occurs when $LANG is being set in the
wrong place (e.g. ~/.bashrc), so the shell has it but the terminal
emulator doesn't. You can verify this by checking
"/proc/<pid>/environ".

* Various layers like tmux or screen can also have the same problem as
X11 terminals above ($LANG correct "inside" but wrong "outside").

* Older versions of screen can't read locale settings and need UTF-8
mode enabled explicitly using `screen -U`.

-- 
Mantas Mikulėnas <grawity at gmail.com>


More information about the systemd-devel mailing list