View previous topic :: View next topic |
Author |
Message |
oleglelchuk n00b
Joined: 29 Aug 2008 Posts: 16
|
Posted: Sun Sep 26, 2010 12:06 pm Post subject: How can I display utf8 on a bash console, without loading X? |
|
|
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 |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6103 Location: Dallas area
|
Posted: Sun Sep 26, 2010 12:54 pm Post subject: |
|
|
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 |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Sun Sep 26, 2010 1:13 pm Post subject: |
|
|
you also need to have a font that can display it check /etc/conf.d/consolefont (and consolefont must be start) |
|
Back to top |
|
|
oleglelchuk n00b
Joined: 29 Aug 2008 Posts: 16
|
Posted: Sun Sep 26, 2010 3:28 pm Post subject: |
|
|
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 |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Sun Sep 26, 2010 3:33 pm Post subject: |
|
|
i would have LC_ALL=C else looks ok for me
don't forget to USE="unicode" too |
|
Back to top |
|
|
oleglelchuk n00b
Joined: 29 Aug 2008 Posts: 16
|
Posted: Sun Sep 26, 2010 4:05 pm Post subject: |
|
|
okay, I restarted my system and I can clearly see that now it's using a different font (lat0-0, 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 |
|
|
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3267 Location: Canada
|
Posted: Sun Sep 26, 2010 5:01 pm Post subject: |
|
|
oleglelchuk wrote: | okay, I restarted my system and I can clearly see that now it's using a different font (lat0-0, 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 |
|
|
oleglelchuk n00b
Joined: 29 Aug 2008 Posts: 16
|
Posted: Sun Sep 26, 2010 5:18 pm Post subject: |
|
|
Well, I still would like to know how to display unicode characters on the console. |
|
Back to top |
|
|
Gusar Advocate
Joined: 09 Apr 2005 Posts: 2665 Location: Slovenia
|
Posted: Sun Sep 26, 2010 5:36 pm Post subject: |
|
|
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 |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Sun Sep 26, 2010 10:05 pm Post subject: |
|
|
give a try to lat9w-16 (if it fit you of course) |
|
Back to top |
|
|
dmpogo Advocate
Joined: 02 Sep 2004 Posts: 3267 Location: Canada
|
Posted: Sun Sep 26, 2010 11:08 pm Post subject: |
|
|
You could also try terminus-font with framebuffer console |
|
Back to top |
|
|
|