utf-8 console

Please post all general support questions for LXDE here.
Locked
Albretch Mueller
Posts: 3
Joined: Wed May 12, 2010 9:47 pm

utf-8 console

Post by Albretch Mueller »

~
I code java and I use international characters that are not part of latin-1
~
How can I make the console print these characters as they are supposed to be?
~
Thank you
lbrtchx
Marty Jack
Posts: 381
Joined: Mon Mar 23, 2009 5:14 am

Re: utf-8 console

Post by Marty Jack »

You need to ensure that the environment variable LANG is appropriately defined to include the desired encoding which in your case is UTF-8. Many people put this definition into their shell initialization script.

So for example if you were German you might have in your .bashrc

export LANG=de_DE.UTF-8
Albretch Mueller
Posts: 3
Joined: Wed May 12, 2010 9:47 pm

Re: utf-8 console

Post by Albretch Mueller »

You need to ensure that the environment variable LANG is appropriately defined to include the desired encoding which in your case is UTF-8. Many people put this definition into their shell initialization script.
So for example if you were German you might have in your .bashrc
~
OK, since in my case knoppix 6.2 .bashrc
~

Code: Select all

knoppix@Microknoppix:~$ cat .bashrc
# /etc/bash.bashrc
[ -f /etc/profile ] && . /etc/profile
~
reads off its data from /etc/profile I did change it there:
~

Code: Select all

$ cat /proc/cmdline
ramdisk_size=100000 lang=en vt.default_utf8=0 apm=power-off vga=791 initrd=minirt.gz nomce quiet loglevel=0 tz=localtime BOOT_IMAGE=linux init 2 xmodule=vesa fb1280x1024 depth=16 fromhd=/dev/sdb5
knoppix@Microknoppix:/media/sdb3/prjx/KorpusMuse/SRodDom/sIlabas_Espan~ol$ cat /etc/profile
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
   PATH="$HOME/bin:$PATH"
fi

if [ "$PS1" ]; then
  if [ "$BASH" ]; then
    PS1='\u@\h:\w\$ '
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

export PATH
export LANG=en_US.UTF-8
export CHARSET=UTF-8

alias ..="cd .."
alias which="type -path"
alias where="type -all"
alias ll="ls -l --color=auto"
alias l="ls -a --color=auto"
alias rm="rm -i"
alias mv="mv -i"
alias cp="cp -i"
alias la="ls -la --color=auto"
alias ls="ls --color=auto"
alias grep="grep --colour=auto"
# This is very KNOPPIX-specific
alias su="sudo su"
umask 022
~
but data is still displayed on the console with lots of "?"
~
How can I debug/troubleshoot those encoding/utf-8 console issues?
~
Thank you
lbrtchx
Albretch Mueller
Posts: 3
Joined: Wed May 12, 2010 9:47 pm

Re: utf-8 console

Post by Albretch Mueller »

~
Sorry that I have repeatedly posted the same messages, but for some weird reason my posts don't seem to get to your servers, I even got the following error:
~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~
http://forum.lxde.org/posting.php?mode=reply&f=8&t=1528

ERROR
The requested URL could not be retrieved

While trying to retrieve the URL: http://forum.lxde.org/posting.php?

The following error was encountered:

* Read Timeout

The system returned:

[No Error]

A Timeout occurred while waiting to read data from the network. The network or server may be down or congested. Please retry your request.

Your cache administrator is webmaster.
Generated Thu, 13 May 2010 14:49:22 GMT by webgate (squid/2.7.STABLE3)
maces
Posts: 503
Joined: Sat Oct 25, 2008 6:04 pm
Contact:

Re: utf-8 console

Post by maces »

@Albretch Mueller: fixed.

maces
Marty Jack
Posts: 381
Joined: Mon Mar 23, 2009 5:14 am

Re: utf-8 console

Post by Marty Jack »

Troubleshooting anything to do with environment variables:

echo $LANG, or whatever variable is causing you trouble
printenv

Or, ask your distro for help. We do not control how they do startup.
Locked