Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How can I display utf8 on a bash console, without loading X?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
oleglelchuk
n00b
n00b


Joined: 29 Aug 2008
Posts: 16

PostPosted: Sun Sep 26, 2010 12:06 pm    Post subject: How can I display utf8 on a bash console, without loading X? Reply with quote

How can I display utf8 characters on a bash console, without loading X? I am trying to follow the gentoo guide, but bash still doesn't display utf8 characters. For example, I compile the following program:

#include <iostream>
using namespace std;

int main()
{
cout << "Hi\u2763" << endl;
}


but plain bash without X loaded can't display that utf8 character correctly; however, uxterm displays it correctly, but as I said, I don't wanna load X in order to be able to display utf8 characters. So, what do you think is the problem here?
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6103
Location: Dallas area

PostPosted: Sun Sep 26, 2010 12:54 pm    Post subject: Reply with quote

what is LANG and LC_COLLATE set to?
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sun Sep 26, 2010 1:13 pm    Post subject: Reply with quote

you also need to have a font that can display it check /etc/conf.d/consolefont (and consolefont must be start)
Back to top
View user's profile Send private message
oleglelchuk
n00b
n00b


Joined: 29 Aug 2008
Posts: 16

PostPosted: Sun Sep 26, 2010 3:28 pm    Post subject: Reply with quote

This is what I have in my /etc/conf.d/consolefont file:

# /etc/conf.d/consolefont

# CONSOLEFONT specifies the default font that you'd like Linux to use on the
# console. You can find a good selection of fonts in /usr/share/consolefonts;
# you shouldn't specify the trailing ".psf.gz", just the font name below.
# To use the default console font, comment out the CONSOLEFONT setting below.
# This setting is used by the /etc/init.d/consolefont script (NOTE: if you do
# not want to use it, run "rc-update del consolefont" as root).

CONSOLEFONT="lat0-08"

# CONSOLETRANSLATION is the charset map file to use. Leave commented to use
# the default one. Have a look in /usr/share/consoletrans for a selection of
# map files you can use.

#CONSOLETRANSLATION="8859-1_to_uni"


And when I type locale, this is displayed:
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=en_US.UTF-8

You see anything here that needs to be fixed?
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sun Sep 26, 2010 3:33 pm    Post subject: Reply with quote

i would have LC_ALL=C else looks ok for me
don't forget to USE="unicode" too
Back to top
View user's profile Send private message
oleglelchuk
n00b
n00b


Joined: 29 Aug 2008
Posts: 16

PostPosted: Sun Sep 26, 2010 4:05 pm    Post subject: Reply with quote

okay, I restarted my system and I can clearly see that now it's using a different font (lat0-08), but I still can't see unicode characters. What font should I choose that supports unicode characters?

Weird... When I load X, unicode characters can be displayed, but they don't get displayed when I don't load X.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3267
Location: Canada

PostPosted: Sun Sep 26, 2010 5:01 pm    Post subject: Reply with quote

oleglelchuk wrote:
okay, I restarted my system and I can clearly see that now it's using a different font (lat0-08), but I still can't see unicode characters. What font should I choose that supports unicode characters?

Weird... When I load X, unicode characters can be displayed, but they don't get displayed when I don't load X.



console and X are two completely different beasts, font rendering is totally independent.
Back to top
View user's profile Send private message
oleglelchuk
n00b
n00b


Joined: 29 Aug 2008
Posts: 16

PostPosted: Sun Sep 26, 2010 5:18 pm    Post subject: Reply with quote

Well, I still would like to know how to display unicode characters on the console. :)
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Sun Sep 26, 2010 5:36 pm    Post subject: Reply with quote

You need a font that contains unicode characters. It seems lat0-08 doesn't, at least not those that you wish to display.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sun Sep 26, 2010 10:05 pm    Post subject: Reply with quote

give a try to lat9w-16 (if it fit you of course)
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3267
Location: Canada

PostPosted: Sun Sep 26, 2010 11:08 pm    Post subject: Reply with quote

You could also try terminus-font with framebuffer console
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things 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