You are not logged in.

#1 2017-11-06 01:48:12

impguard
Member
Registered: 2017-11-06
Posts: 3

[Solved] Can't setup Unicode properly

I've searched around and I can't seem to setup Unicode properly on my installation.

Context: Setup ArchLinux on my Virtualbox with Grub/xfce following Youtube + the Wiki guide. When I run something like

echo -e "\xE2\x98\xA0"

I get a weird string of english characters with accent marks.

locale prints out

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

I'm using the default terminal emulator xfce provides. I'm not actually sure which one that is.

What am I missing here?

Last edited by impguard (2017-11-07 03:51:03)

Offline

#2 2017-11-06 03:24:20

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: [Solved] Can't setup Unicode properly

Do you have a font installed that supports that character?  Your echo command works fine for me.  Also, you should not follow random youtube videos, because they are almost always out of date or just plain wrong.

Offline

#3 2017-11-06 04:13:14

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [Solved] Can't setup Unicode properly

You probably want LC_COLLATE to be C, but that isn't the problem here.

Assuming the echo should give something a bit like an 'x' (maybe a multiplication symbol), it works fine for me.

Is the problem specific to that emulator? What if you try on another tty outside X?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#4 2017-11-06 04:18:46

fuyuki
Member
Registered: 2017-10-20
Posts: 23

Re: [Solved] Can't setup Unicode properly

The only time I've had bizarre text spat at me under UTF-8 anything is when I haven't had a compatible font available...

The default Xfce terminal is just the (simply named enough) Xfce(4) Terminal. I used it just yesterday and it had no trouble with non-ASCII characters, so I don't think that's the problem, though it wouldn't hurt to check.


Arch | amd64 | rEFInd | OpenRC | MATE | PulseAudio

Offline

#5 2017-11-06 04:26:37

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [Solved] Can't setup Unicode properly

fuyuki wrote:

The only time I've had bizarre text spat at me under UTF-8 anything is when I haven't had a compatible font available...

You've evidently led a sheltered life. tongue


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2017-11-06 04:48:57

fuyuki
Member
Registered: 2017-10-20
Posts: 23

Re: [Solved] Can't setup Unicode properly

cfr wrote:

You've evidently led a sheltered life. tongue

?☜☹☹????✌✡?☜


Arch | amd64 | rEFInd | OpenRC | MATE | PulseAudio

Offline

#7 2017-11-06 06:27:55

impguard
Member
Registered: 2017-11-06
Posts: 3

Re: [Solved] Can't setup Unicode properly

Well, I'll take a look thanks for the information.

I installed ttf-freefont and ttf-dejavu because I thought it might be the font. My understanding is that they support unicode but it still shows like when I run the echo command above. This is the same when I run in the default tty environment.

Ôÿá

I don't believe I followed a "random" youtube video. I double checked most of the steps with the wiki and with Google (this forum helped a bit) just to understand each command and what the purpose was. Overall, everything worked out great except this.

Two side questions that may be related:

(1) When selecting the fonts in the terminal (through the GUI) it seems to only show a few of the fonts. For example, I can't select Dejavu Sans Mono, and only Dejavu Sand Mono Book. Is there a limitation on which fonts can be used in a terminal emulator?
(2) The emulator suggests the use of a "default system font" if you don't select a custom font. How does one set the "default system font"? The GUI suggests being able to set a system font, but apparently there's a difference between the system font and the system mono font?

Thanks for the help!

Offline

#8 2017-11-06 06:31:51

impguard
Member
Registered: 2017-11-06
Posts: 3

Re: [Solved] Can't setup Unicode properly

The heck the answer is simple...

Under the menu Terminal>Set Encoding it wasn't defaulting to my default encoding (utf-8). Instead it was set to IBM 850.

Strange that it wasn't set to the default, I swear I never set that myself...

But now it's fine!

Offline

#9 2017-11-06 07:13:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Can't setup Unicode properly

Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2017-11-06 16:45:33

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [Solved] Can't setup Unicode properly

For system font configuration, checkout fontconfig in the wiki.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB