Results 1 to 10 of 12

Thread: utf-8 console

Hybrid View

  1. #1
    Senior Member registered user
    Join Date
    Dec 2004
    Posts
    168

    utf-8 console

    ~
    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?
    ~
    this is the conf I am using
    ~
    $ 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
    ~
    LXDE's leafpad does show characters as utf8, but the console and kate (which I install after starting up) do not
    ~
    Thank you
    lbrtchx

  2. #2
    Senior Member registered user
    Join Date
    Feb 2010
    Posts
    198
    For the console setup you may want to have a look at this site:

    http://sourcemage.org/HowTo/Language

    It is well explained. About Kate I don't really know. I use Geany and it has support for international locales. I personally use Cyrillic fonts with Geany. It is also very feature rich

  3. #3
    Senior Member registered user
    Join Date
    Dec 2004
    Posts
    168
    ~
    Well I tried to follow the instructions on that link:
    ~
    http://sourcemage.org/HowTo/Language
    ~
    but I wan't able to reset my terminal. I have noticed leafpad does display non latin-1 chars (as those with accents)
    ~
    // __ /etc/sysconfig/keymap file not there even though a number of apparently similar files were found
    ~
    # cat /etc/sysconfig/keymap
    cat: /etc/sysconfig/keymap: No such file or directory
    ~
    # find / -type f -name keymap
    /media/sdb6/knet/knoppix/.xine/keymap
    /UNIONFS/usr/share/initramfs-tools/hooks/keymap
    /UNIONFS/usr/share/initramfs-tools/scripts/init-top/keymap
    /UNIONFS/lib/udev/keymap
    /KNOPPIX/lib/udev/keymap
    /KNOPPIX/usr/share/initramfs-tools/hooks/keymap
    /KNOPPIX/usr/share/initramfs-tools/scripts/init-top/keymap
    ~
    // __ I guess knoppix 6.2 uses console-tools
    ~
    # ls -l /usr/share/keymaps
    total 18
    drwxr-xr-x 2 root root 2048 Jul 19 2009 amiga
    drwxr-xr-x 2 root root 2048 Jul 19 2009 atari
    drwxr-xr-x 8 root root 2048 Jul 8 2008 i386
    drwxr-xr-x 2 root root 2048 Jul 19 2009 include
    drwxr-xr-x 2 root root 6144 Jul 19 2009 mac
    drwxr-xr-x 2 root root 4096 Jul 19 2009 sun
    ~
    # cat /usr/share/kbd/keymaps
    cat: /usr/share/kbd/keymaps: No such file or directory
    ~
    # dpkg -l | grep console
    ii console-common 0.7.80 basic infrastructure for text console config
    ii console-data 2:1.09-2 keymaps, fonts, charset maps, fallback table
    ii console-setup 1.46 console font and keymap setup program
    ii console-terminus 4.28-2 Fixed-width fonts for fast reading on the Li
    ii console-tools 1:0.2.3dbs-65.1 Linux console and font utilities
    ii consolekit 0.4.1-2 framework for defining and tracking users, s
    ii libconsole 1:0.2.3dbs-65.1 Shared libraries for Linux console and font
    ii libjline-java 0.9.94-1 Java library for handling console input
    ii libsvga1 1:1.4.3-27 console SVGA display libraries
    ii linphone-nox 3.2.1-1 SIP softphone - console-only client
    ii pppstatus 0.4.2-10 console-based PPP status monitor
    ~
    so I couldn't set KEYMAP
    ~
    Are you using knoppix 6,2? How exactly did you reset your terminal to use UTF-8?
    ~
    Thanks
    lbrtchx

  4. #4
    Senior Member registered user
    Join Date
    Feb 2010
    Posts
    198
    Hi, I am sorry for the late answer. This is how I set my console to display Cyrillic character properly. I removed completely console-tools package and setup kbd package instead.
    Then enter this commands as root:

    echo -n -e '\033%G' - tells the console that incoming data is UTF-8
    setfont Cyr_a8x16 - loads my Cyrillic font
    kbd_mode -u - sets the keyboard mode to be UTF-8
    loadkeys bg_pho-utf8 - loads my Cyrillic phonetic keyboard layout

    I have this in a shell script and run it whenever I need Cyrillic in console. I still don't know how to save the configuration. Hope this was in any way helpful
    Last edited by mecho; 05-18-2010 at 06:54 AM.

  5. #5
    Senior Member registered user
    Join Date
    Feb 2010
    Posts
    198
    Please discard my previous message. I figured it out how to set special characters without the kbd package-only using what's available in knoppix.
    You have to open and edit the configuration file /etc/default/console-setup
    There you can change your encodings, codesets and load different fonts. The file is pretty explenatory. Here is mine just to give you an idea how I load cyrillic characters and end even switch between latin and cyrillic in console :
    charmap for cyrillic phonetic is cp1251
    codeset for my cyrillic is CyrKoi
    I am loading fontface Terminus
    Then I have my keyboard info and I am switching between latin and cyrillic using Alt+SHift
    using : grp:alt_shift_toggle

    # A configuration file for setupcon

    # Change to "yes" and setupcon will explain what is being doing
    VERBOSE_OUTPUT=yes

    # Setup these consoles. Most people do not need to change this.
    ACTIVE_CONSOLES="/dev/tty[1-4]"

    # Put here your encoding. Valid charmaps are: UTF-8 ARMSCII-8 CP1251
    # CP1255 CP1256 GEORGIAN-ACADEMY GEORGIAN-PS IBM1133 ISIRI-3342
    # ISO-8859-1 ISO-8859-2 ISO-8859-3 ISO-8859-4 ISO-8859-5 ISO-8859-6
    # ISO-8859-7 ISO-8859-8 ISO-8859-9 ISO-8859-10 ISO-8859-11 ISO-8859-13
    # ISO-8859-14 ISO-8859-15 ISO-8859-16 KOI8-R KOI8-U TIS-620 VISCII
    # CHARMAP="ISO-8859-15"
    CHARMAP="CP1251"

    # The codeset determines which symbols are supported by the font.
    # Valid codesets are: Arabic Armenian CyrAsia CyrKoi CyrSlav Ethiopian
    # Georgian Greek Hebrew Lao Lat15 Lat2 Lat38 Lat7 Thai Uni1 Uni2 Uni3
    # Vietnamese. Read README.fonts for explanation.
    # CODESET="Lat15"
    CODESET="CyrKoi"

    # Valid font faces are: VGA (sizes 8, 14 and 16), Terminus (sizes
    # 12x6, 14, 16, 20x10, 24x12, 28x14 and 32x16), TerminusBold (sizes
    # 14, 16, 20x10, 24x12, 28x14 and 32x16), TerminusBoldVGA (sizes 14
    # and 16), Fixed (sizes 13, 14, 15, 16 and 1, Goha (sizes 12, 14 and
    # 16), GohaClassic (sizes 12, 14 and 16).
    # Set FONTFACE and FONTSIZE to an empty string if you want setupcon to
    # set up the keyboard but to leave the console font unchanged.
    FONTFACE="Terminus"
    FONTSIZE="16"

    # You can also directly specify nonstandard font and ACM to load.
    # Use space as separator if you want to load more than one font.
    # FONT='lat9w-08.psf.gz /usr/local/share/braillefonts/brl-08.psf'
    # ACM=/usr/local/share/consoletrans/my_special_encoding.acm


    # The following variables describe your keyboard and can have the same
    # values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options
    # in /etc/X11/xorg.conf.
    XKBMODEL="pc105"
    XKBLAYOUT="us,bg"
    # XKBVARIANT="nodeadkeys"
    XKBVARIANT="altgr-intl"
    # XKBOPTIONS="lv3:ralt_switch,terminate:ctrl_alt_bks p"
    XKBOPTIONS="grp:alt_shift_toggle,terminate:ctrl_al t_bksp"

    Hope that helps

  6. #6
    Senior Member registered user
    Join Date
    Feb 2010
    Posts
    198
    You can use UTF-8 encoding even though its not mentioned in the config file. Also I forgot to mention - you have to run SETUPCON in console to apply the configuration

  7. #7
    Senior Member registered user
    Join Date
    Dec 2004
    Posts
    168
    ~
    Once the desktop finishes the initialization all the way to init 5
    ~
    $ sudo ls -l /etc/default/console-setup
    -rw-r--r-- 1 root root 1882 May 21 06:57 /etc/default/console-setup
    ~
    knoppix@Microknoppix:~$ sudo vi /etc/default/console-setup
    ~
    knoppix@Microknoppix:~$ cat /etc/default/console-setup
    VERBOSE_OUTPUT=no

    ACTIVE_CONSOLES="/dev/tty[1-4]"

    #CHARMAP="ISO-8859-15"
    CHARMAP="UTF-8"

    CODESET="Lat15"

    FONTFACE=""
    FONTSIZE=""

    # FONT='lat9w-08.psf.gz /usr/local/share/braillefonts/brl-08.psf'
    # ACM=/usr/local/share/consoletrans/my_special_encoding.acm

    XKBMODEL="pc105"
    XKBLAYOUT="us,gb"
    #XKBVARIANT="nodeadkeys"
    XKBVARIANT="altgr-intl"
    #XKBOPTIONS="lv3:ralt_switch,terminate:ctrl_a lt_bksp"
    XKBOPTIONS="grp:alt_shift_toggle,terminate:ct rl_alt_bksp"

    ~
    I have also tried:
    ~
    CODESET="Lat38"
    ~
    $ sudo setupcon -v
    We are not on the Linux console, exiting.
    ~
    $ sudo setupcon -v --force >& ~/tmp/setupcon.out
    ~
    $ cat ~/tmp/setupcon.out
    Loading /etc/console-setup/cached.kmap.gz
    ~
    $ sudo ls -l /etc/console-setup/cached.kmap.gz
    -rw-r--r-- 1 root root 3886 May 21 07:21 /etc/console-setup/cached.kmap.gz
    ~
    $ javac -encoding UTF-8 esp_Silabas00Test.java
    ~
    $ java esp_Silabas00Test

    "?Ay!"
    ~
    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
    ~
    If I open the file using leafpad I can see what I need to see
    ~
    "ĦAy!"
    ~
    ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
    ~
    I have also done a few searches and I don't find much explanation it, even though many people should have these problems (I guess). Where did you get your info from?
    ~
    Thank you
    lbrtchx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Gigabyte 4U AI Server 10x Nvidia GPU 2x Xeon Gold 6150 36 Core 2.7GHz DDR4 RAM picture

Gigabyte 4U AI Server 10x Nvidia GPU 2x Xeon Gold 6150 36 Core 2.7GHz DDR4 RAM

$1625.00



Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram  2x 550W PSU No HDD picture

Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram 2x 550W PSU No HDD

$275.00



867959-B21 HPE ProLiant DL360 G10 CTO Server W/ 2x 865414-B21 1x 840140-001 picture

867959-B21 HPE ProLiant DL360 G10 CTO Server W/ 2x 865414-B21 1x 840140-001

$245.00



Dell PowerEdge R240 Intel Xeon E-2224 3.50GHz 8GB DDR4 ECC NO HDD 250W picture

Dell PowerEdge R240 Intel Xeon E-2224 3.50GHz 8GB DDR4 ECC NO HDD 250W

$285.97



Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 32GB RAM No HDD picture

Dell PowerEdge R730XD 28 Core Server 2X Xeon E5-2680 V4 H730 32GB RAM No HDD

$378.93



Dell PowerEdge C4130 1U AI GPU Server | 2x E5-2690 v3 | 64gb Ram | 2x 1600W picture

Dell PowerEdge C4130 1U AI GPU Server | 2x E5-2690 v3 | 64gb Ram | 2x 1600W

$524.99



Dell PowerEdge C4130 1U AI GPU Server | 2x E5-2680 v3 | 32gb Ram | 2x 1600W picture

Dell PowerEdge C4130 1U AI GPU Server | 2x E5-2680 v3 | 32gb Ram | 2x 1600W

$409.99



Supermicro 2U GPU Server SYS-2029GP-TR 2x Xeon 6130 32C 6x PCIe 3.0 x16 Slots picture

Supermicro 2U GPU Server SYS-2029GP-TR 2x Xeon 6130 32C 6x PCIe 3.0 x16 Slots

$745.00



Dell PowerEdge FX2s + 8x FC430 Blades 16x E5-2630v4 160 Cores Rails No PSU/RAM picture

Dell PowerEdge FX2s + 8x FC430 Blades 16x E5-2630v4 160 Cores Rails No PSU/RAM

$699.00



Dell PowerEdge R530 2x E5-2630v4 H330 iDRAC8 Port Card Riser No PSU/RAM/HDD picture

Dell PowerEdge R530 2x E5-2630v4 H330 iDRAC8 Port Card Riser No PSU/RAM/HDD

$99.99