Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
My console cannot display unicode character
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
icyhearts
n00b
n00b


Joined: 24 Sep 2017
Posts: 31

PostPosted: Tue Nov 21, 2017 12:12 pm    Post subject: My console cannot display unicode character Reply with quote

To show utf-8 characters in consoles, I followed the gentoo UTF-8 wiki: https://wiki.gentoo.org/wiki/UTF-8
But when i use vim in normal mode, and type :digraphs, only characters under 256 is shown correctly, characters bigger than 256 is shown as a question mark.
UTF-8 works well in a Xwindow terminal, but not in console(command line interface), so it should not be the reason of vim.
Besides, if i insert unicode characters in a text file, such test.txt, and use cat command to display the text file, unicode characters is displayed as question marks in console.

In my /etc/rc.conf, I have
Code:

unicode="YES"

In /etc/conf.d/consolefont:
Code:

consolefont="lat9w-16"


Here is the result of locale command
Code:

[root@icefire etc]#locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

utf8 is alse enabled in kernel config file
Code:

[root@icefire linux-4.12.12-gentoo]#grep -i utf8 /usr/src/linux-4.12.12-gentoo/.config
CONFIG_FAT_DEFAULT_IOCHARSET="utf8"
# CONFIG_FAT_DEFAULT_UTF8 is not set
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_UTF8=y

and my /etc/env.d/02locale :
Code:

[root@icefire etc]#cat /etc/env.d/02locale
# Configuration file for eselect
# This file has been automatically generated.
LANG="en_US.utf8"

and locale is set as this:
Code:

[root@icefire etc]#eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   en_US.utf8 *
  [3]   POSIX
  [4]   zh_CN.utf8
  [ ]   (free form)

unicode is enabled globally in /etc/portage/make.conf:
Code:

USE="-* -bindist -cups -kde -gnome -minimal -systemd X unicode perl python php apache2 dbus alsa pulseaudio ppp cairo encode jpeg opengl lopengl ock session startup-notification udev mmx sse sse2 vaapi vdpau xinerama xv icu readline"

But my console just cannot display unicode characters correctly, what's the reason? Could anyone help me?
Many thanks.
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10658
Location: Somewhere over Atlanta, Georgia

PostPosted: Tue Nov 21, 2017 1:41 pm    Post subject: Reply with quote

Just a few pro-forma questions:
  • Have you rebuilt the recommended libraries after enabling the unicode USE flag?
  • Have you confirmed that the unicode USE flag properly set by looking for it in your "emerge --info"?
  • Is there a specific reason that you're disabling all of the profile specific USE flags?
It's been a while but that Wiki article worked for me.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
P.Kosunen
Guru
Guru


Joined: 21 Nov 2005
Posts: 309
Location: Finland

PostPosted: Tue Nov 21, 2017 2:01 pm    Post subject: Re: My console cannot display unicode character Reply with quote

icyhearts wrote:
In /etc/conf.d/consolefont:
Code:

consolefont="lat9w-16"


Code:
consolefont="default8x16"


Try default font.
Back to top
View user's profile Send private message
icyhearts
n00b
n00b


Joined: 24 Sep 2017
Posts: 31

PostPosted: Wed Nov 22, 2017 2:05 am    Post subject: Reply with quote

John R. Graham wrote:
Just a few pro-forma questions:
  • Have you rebuilt the recommended libraries after enabling the unicode USE flag?
  • Have you confirmed that the unicode USE flag properly set by looking for it in your "emerge --info"?
  • Is there a specific reason that you're disabling all of the profile specific USE flags?
It's been a while but that Wiki article worked for me.

- John


Yes, I rebuild the world after enabling the unicode USE flag
Code:

emerge -auDN  @world

And the result of emerge --info
Code:

[root@icefire etc]#emerge --info
Portage 2.3.13 (python 3.4.6-final-0, default/linux/amd64/13.0/desktop, gcc-5.4.0, glibc-2.25-r9, 4.12.12-gentoo.ice-3-20171001 x86_64)
=================================================================
System uname: Linux-4.12.12-gentoo.ice-3-20171001-x86_64-Intel-R-_Core-TM-_i7-7700_CPU_@_3.60GHz-with-gentoo-2.4.1
KiB Mem:     8195612 total,    141372 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Mon, 20 Nov 2017 15:00:01 +0000
Head commit of repository gentoo: 1cbdc5e34488e494485e66a1647ab272e000d957
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.28.1 p1.0) 2.28.1
ccache version 3.2.4 [disabled]
app-shells/bash:          4.3_p48-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14::gentoo, 3.4.6::gentoo
dev-util/ccache:          3.2.4::gentoo
dev-util/cmake:           3.8.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.8::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.15-r2::gentoo
sys-devel/binutils:       2.28.1::gentoo
sys-devel/gcc:            5.4.0-r3::gentoo, 6.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:

archenroot
    location: /var/lib/layman/archenroot
    sync-type: laymansync
    sync-uri: https://github.com/archenroot/gentoo-overlay.git
    masters: gentoo
    priority: 50

gentoo-zh
    location: /var/lib/layman/gentoo-zh
    sync-type: laymansync
    sync-uri: git://github.com/microcai/gentoo-zh.git
    masters: gentoo
    priority: 50

science
    location: /var/lib/layman/science
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/proj/sci.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirrors.163.com/gentoo/ http://ftp.swin.edu.au/gentoo http://gentoo.c3sl.ufpr.br/ ftp://ftp.iij.ad.jp/pub/linux/gentoo/ ftp://gentoo.bloodhost.ru/ http://gentoo.bloodhost.ru/ https://ftp.lanet.kr/pub/gentoo/ rsync://ftp.linux.org.tr/gentoo-distfiles/  http://lug.mtu.edu/gentoo/ ftp://lug.mtu.edu/gentoo/ http://gd.tuwien.ac.at/opsys/linux/gentoo/ ftp://gd.tuwien.ac.at/opsys/linux/gentoo/ rsync://gentoo.c3sl.ufpr.br/gentoo/ ftp://gentoo.c3sl.ufpr.br/gentoo/ http://mirrors.telepoint.bg/gentoo/ rsync://mirrors.telepoint.bg/gentoo/ rsync://gentoo.gossamerhost.com/gentoo-distfiles/ ftp://mirrors.xmu.edu.cn/gentoo http://mirrors.xmu.edu.cn/gentoo ftp://ftp.fi.muni.cz/pub/linux/gentoo/ ftp://gentoo.mirror.web4u.cz/ http://gentoo.mirror.web4u.cz/ ftp://gentoo.imj.fr/pub/gentoo/ http://gentoo.modulix.net/gentoo/ http://gentoo.mirrors.ovh.net/gentoo-distfiles/ ftp://gentoo.mirrors.ovh.net/gentoo-distfiles/ ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo http://ftp.halifax.rwth-aachen.de/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://files.gentoo.gr ftp://files.gentoo.gr rsync://ftp.heanet.ie/pub/gentoo/ http://mirror.isoc.org.il/pub/gentoo/ "
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X alsa amd64 apache2 cairo dbus encode icu jpeg lopengl mmx ock opengl perl php ppp pulseaudio python readline session sse sse2 startup-notification udev unicode vaapi vdpau xinerama xv" ABI_X86="64" ELIBC="glibc" GRUB_PLATFORMS="pc emu efi-32 efi-64" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" USERLAND="GNU" VIDEO_CARDS="nouveau intel i915 nvidia" XFCE_PLUGINS="brightness clock trash"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

As for the third point, do you mean the -* in my global USE flag in /etc/portage/make.conf ? I think i just want to disable all the flags and enable what i really need to have more control of my system.
I did this by following the installation wiki https://wiki.gentoo.org/wiki/Handbook:AMD64/Full/Installation, it says :

When USE is defined in /etc/portage/make.conf it is added (or removed if the USE flag starts with the - sign) from that default list. Users who want to ignore any default USE settings and manage it completely themselves should start the USE definition in make.conf with -*:
Back to top
View user's profile Send private message
icyhearts
n00b
n00b


Joined: 24 Sep 2017
Posts: 31

PostPosted: Wed Nov 22, 2017 2:15 am    Post subject: Re: My console cannot display unicode character Reply with quote

P.Kosunen wrote:
icyhearts wrote:
In /etc/conf.d/consolefont:
Code:

consolefont="lat9w-16"


Code:
consolefont="default8x16"


Try default font.


I have tried the default, the result is even worse, even part of characters whose code is under 255 cannot be displayed when i typed :digraphs in vim normal mode.
I have tried

    consolefont="default8x16"
    consolefont="lat9w-16"
    consolefont="lat0-12"
    consolefont="latarcyrheb-sun32"
    consolefont="lat9u-16"

All of them cannot work well.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Wed Nov 22, 2017 12:02 pm    Post subject: Reply with quote

I'm afraid your USE flags don't make sense:
Quote:
USE="-* -bindist -cups -kde -gnome -minimal -systemd ...

is pointless and
Quote:
USE="-* ... perl python php apache2 ...

seems strange...

You should use "-*" only if you really want a minimal system and if you know exactly what you are doing. And even then I wouldn't simply write "-*" to make.conf. I would start with a working system and remove use flag after use flag and test after each step.

I have one server which defines (only) the USE flags below in make.conf:
Quote:
USE="-* bzip2 gpm logrotate ncurses netifrc openrc pam pie readline udev unicode xattr zlib"

It works and unicode works as well. But it took me weeks to get to this minimal set of use flags. Furthermore, I have about 20 lines in package.use, where I define additional use flags for some packages.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum