Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unicode characters in console and konsole
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
sturaipo
n00b
n00b


Joined: 29 Mar 2009
Posts: 3

PostPosted: Sun Mar 29, 2009 12:41 pm    Post subject: Unicode characters in console and konsole Reply with quote

Hi everyone.
I'm experiencing a problem with unicode support and I don't know where to find the solution.

My box is an Athlon X2 5000+ running 64bit gentoo.
I tried to enable unicode support for all the system, but it's not working: in firefox and all other X application I can use multibyte character such as 'è' or 'ò' without any problem, but when I am in console (textual enviroment, not X) or I'm using konsole in kde 4.2 I have no support for this charcters.

If I try to digit a 'è' char in konsole I get
Quote:
Ã?

in textual enviroment the 'è' char is displaied correctly, but if I try to delete it, I can delete also the # char in the prompt.

I post some relevant configuration files:
/etc/rc.conf
Quote:
# UNICODE specifies whether you want to have UNICODE support in the console.
# If you set to yes, please make sure to set a UNICODE aware CONSOLEFONT and
# KEYMAP in the /etc/conf.d/consolefont and /etc/conf.d/keymaps config files.

UNICODE="yes"


/etc/conf.d/
Quote:
# Use KEYMAP to specify the default console keymap. There is a complete tree
# of keymaps in /usr/share/keymaps to choose from.

KEYMAP="it"


# Should we first load the 'windowkeys' console keymap? Most x86 users will
# say "yes" here. Note that non-x86 users should leave it as "no".

SET_WINDOWKEYS="no"


# The maps to load for extended keyboards. Most users will leave this as is.

EXTENDED_KEYMAPS=""
#EXTENDED_KEYMAPS="backspace keypad euro"


# Tell dumpkeys(1) to interpret character action codes to be
# from the specified character set.
# This only matters if you set UNICODE="yes" in /etc/rc.conf.
# For a list of valid sets, run `dumpkeys --help`

DUMPKEYS_CHARSET=""


/etc/conf.d/consolefont
Quote:
# /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="default8x16"

# 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"


/etc/env.d/02locale
Quote:
LANG="it_IT.UTF-8"
LC_ALL="it_IT.UTF-8"


Everything looks correct to me. Can someone suggest wherelse can I look?

Thanks in advice for your help!

Sturaipo
Back to top
View user's profile Send private message
Nerevar
l33t
l33t


Joined: 31 May 2008
Posts: 720

PostPosted: Sun Mar 29, 2009 12:52 pm    Post subject: Reply with quote

Have you tried "lat9w-08" or "lat9w-16" for your CONSOLEFONT font? You'll have to restart the consolefont init script after making the change.
Back to top
View user's profile Send private message
sturaipo
n00b
n00b


Joined: 29 Mar 2009
Posts: 3

PostPosted: Sun Mar 29, 2009 1:03 pm    Post subject: Reply with quote

I've just tried, but this doesn't solve anything. :(
Back to top
View user's profile Send private message
Nerevar
l33t
l33t


Joined: 31 May 2008
Posts: 720

PostPosted: Sun Mar 29, 2009 1:24 pm    Post subject: Reply with quote

See this general UTF-8 guide: http://www.gentoo-wiki.info/UTF-8
Back to top
View user's profile Send private message
sturaipo
n00b
n00b


Joined: 29 Mar 2009
Posts: 3

PostPosted: Sun Mar 29, 2009 2:18 pm    Post subject: Reply with quote

I have already read this guide.
As far as I can see everything should be ok.
I have enabled by default unicode and nls use flags and no package has been emerged without these use flags.
Moreover if I try to run the unicode init script I completely loose the non-ascii character in textual console (they don't even be visualized).
Back to top
View user's profile Send private message
luispa
Guru
Guru


Joined: 17 Mar 2006
Posts: 359
Location: España

PostPosted: Tue Mar 31, 2009 7:03 am    Post subject: Reply with quote

Hi sturaipo, please check my config, it's working everywhere: X apps, Gnome terminal, Konsole, even textual console. But it took me a while :-), in particular I found a difference when I created 02locale and when I started using UTF-8 instead of UTF8, suddenly text console and gnome-terminal started to work. Still having an issue with emacs... read below.

/etc/env.d/02locale
Code:

LC_ALL="es_ES.UTF-8"
LC_COLLATE="es_ES.UTF-8"
LC_CTYPE="es_ES.UTF-8"
LC_MESSAGES="es_ES.UTF-8"
LC_MONETARY="es_ES.UTF-8"
LC_NUMERIC="es_ES.UTF-8"
LC_PAPER="es_ES.UTF-8"
LANG="es_ES.UTF-8"


/etc/rc.conf
Code:
UNICODE="yes"
CONSOLEFONT="lat9w-16"
EDITOR="/bin/nano"
XSESSION="Gnome"


/etc/conf.d/keymaps
Code:
KEYMAP="-u es"
SET_WINDOWKEYS="yes"
EXTENDED_KEYMAPS="backspace euro2"
DUMPKEYS_CHARSET=""


/etc/conf.d/consolefont
Code:
CONSOLEFONT="lat9w-16"



And... I have the following running on my "luis" user, since long ago and I have NOT removed (in theory with the 02locale it's not necessary). I'll test to remove it to do some testing:

/home/luis/.bashrc
Code:
:
source ~/.bashrc.environment-utf8
LESSCHARSET=utf-8
:


/home/luis/.bashrc.environment-utf8
Code:
export LANG=es_ES.UTF-8
export LC_CTYPE="es_ES.UTF-8"
export LC_NUMERIC="es_ES.UTF-8"
export LC_TIME="es_ES.UTF-8"
export LC_COLLATE="es_ES.UTF-8"
export LC_MONETARY="es_ES.UTF-8"
export LC_MESSAGES="es_ES.UTF-8"
export LC_PAPER="es_ES.UTF-8"
export LC_NAME="es_ES.UTF-8"
export LC_ADDRESS="es_ES.UTF-8"
export LC_TELEPHONE="es_ES.UTF-8"
export LC_MEASUREMENT="es_ES.UTF-8"
export LC_IDENTIFICATION="es_ES.UTF-8"
export LC_ALL=es_ES.UTF-8


Also, since long ago this is the locale.gen that I'm using. It's probably wrong having too much locales. I'll take a look at this one with more time...

# confcat /etc/locale.gen
Code:
en_US ISO-8859-1
en_US.UTF-8 UTF-8
es_ES ISO-8859-1
es_ES@euro ISO-8859-15
es_ES.UTF-8 UTF-8
es_ES.UTF-8@euro UTF-8



However, NOT EVERYTHING works as I would like :-). I'm an emacs user and I'm frustated with UTF-8 support, so upgraded to emacs-cvs (23.0.91.1) where it's expected to be much more unicode compliant, but havent had luck (still investigating).

Take a look at this tests, very interesting. To finish the "cat" I use the auto-complete feature of the bash.

From Xorg using Konsole and bash. WORKS!
Code:

bolica prog $ echo "áéíóúñÑ" > konsole-echo-áéíóú.txt
bolica prog $ cat konsole-echo-áéíóú.txt
áéíóúñÑ


From Xorg using Konsole and emacs. FAILS!
Code:

bolica prog $ emacs -nw konsole-áéíóú.txt          (While typing inside emacs, characters appear correctly)
bolica prog $ cat konsole-�����.txt
�������.txt
bolica prog $                     



From Xorg using Gnome-terminal and bash. WORKS!
Code:

bolica prog $ echo "áéíóúñÑ" > gnome-echo-áéíóú.txt
bolica prog $ cat gnome-echo-áéíóú.txt
áéíóúñÑ


From Xorg using Gnome-terminal and emacs. FAILS!
Code:

bolica prog $ emacs -nw gnome-terminal-áéíóú.txt     (While typing inside emacs, characters appear correctly)
bolica prog $ cat gnome-terminal-�����.txt
����



From textual console and bash. WORKS!.
Code:

bolica ~ # echo "áéíóú" > text-console-echo-áéíóú.txt
bolica ~ # cat text-console-echo-áéíóú.txt
áéíóú


From textual console and emacs. FAILS PARTIALLY.
Code:

bolica ~ # emacs -nw text-console-emacs-áéíóú.txt  (While typing inside emacs, characters appear incorrectly, anyway I save the file)
bolica ~ # cat text-console-emacs-?????.txt
áéíóúñÑ



From remote MacOSX with Terminal.app vía SSH and bash. WORKS!
Code:

bolica ~ # echo "áéíóú" > Terminal.app-echo-áéíóú.txt
bolica ~ # cat Terminal.app-echo-áéíóú.txt
áéíóú


From remote MacOSX with Terminal.app vía SSH and emacs. FAILS PARTIALLY!
Code:

bolica ~ # emacs -nw Terminal.app-emacs-áéíóú.txt  (While typing inside emacs, characters appear incorrectly, anyway I save the file)
bolica ~ # cat Terminal.app-emacs-?????.txt
áéíóúñÑ


Lessons learnt:
1) UTF-8 support is "application" dependant or even configuration dependant on each application.
One example: emacs <23.0 has bad unicode support.
Another example: Under gnome-terminal double check it's detecting utf-8 under its setting or it will never work.
2) Everything complicates when working through your LAN sharing files/disks...
One example: rsync needs to be utf-8 compliant...


Hope it helps,
Luis
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