Re: Strange characters in systemd-cgls output

658 views
Skip to first unread message

Greg KH

unread,
Mar 11, 2014, 6:47:32 PM3/11/14
to coreo...@googlegroups.com
On Tue, Mar 11, 2014 at 05:17:44AM -0700, John Ky wrote:
> Hi Everyone,
>
> I typed systemd-cgls at the shell prompt and got a bunch of weird characters.
> Why does this happen?
>
> If it is relevant, I'm running this from MacOS in iTerm.

That's probably the issue, it works here for me in other terminals, on
Linux.

> core@ip-10-0-0-14 ~/devenv-staging $ systemd-cgls
> <E2><94><94><E2><94><80>system.slice
> <E2><94><9C><E2><94><80>1 /usr/lib/systemd/systemd noswap cros_legacy
> <E2><94><9C><E2><94><80>fleet.service

It thinks your terminal can handle extended characters, so it doesn't
fall back to "7-bit" characters. Make sure your terminal emulation mode
is set properly, or perhaps try some other osx terminal program?

sorry,

greg k-h

Donald Endres

unread,
Apr 17, 2014, 5:51:01 PM4/17/14
to coreo...@googlegroups.com

I see the same symptom on a coreos AMI with no modifications. 
I get the same output from ubuntu terminal as well as iterm2 and terminal app on mac

UTF-8 seems to display fine:

# echo -e "\xE2\x98\xA0"

but the output of systemd-cgls does not:

# systemd-cgls
<E2><94><9C><E2><94><80>1 /usr/lib/systemd/systemd...

Donald Endres

unread,
Jul 13, 2014, 5:32:01 PM7/13/14
to coreo...@googlegroups.com
Setting LANG environment variable allowed systemd-cgls to display as expected.

$ locale -a
C
POSIX
$ export LANG=POSIX
$ systemd-cgls 
|-1 /usr/lib/systemd/systemd...

Michael Marineau

unread,
Jul 13, 2014, 5:43:35 PM7/13/14
to coreos-dev
The issue here was that in the absence of a locale to say otherwise
systemd defaults to UTF-8 while less defaults to latin1/iso8859. This
should be fixed in recent images which switch less to UTF-8 via an
environment variable.

Darren Shepherd

unread,
Jul 13, 2014, 5:43:46 PM7/13/14
to coreo...@googlegroups.com
This is fixed in the alpha images already.  It was fixed by setting LESSCHARSET=utf-8 in /etc/env.d

Darren
Reply all
Reply to author
Forward
0 new messages