DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 5th May 2008
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default HOWTO: Encoding // Pure Terminal // Virtual Terminal

Purpose of this HOWTO is to show how to setup properly Pure [ISO] and Virtual [UTF] Terminals with syscons + xterm + urxvt + screen with English Language for manuals, commands and so, but withcorrectly displaing localized characters.

This example is based on polish language/characters, but may also be used with any other language, just change pl_PL.ISO8895-2 to You proper encoding.

Result of properly set localization [these characters are displayed and typed correctly]:
ę ó ą ś ł ż ź ć ń
We have to face little conflict, ISO under Pure Terminal and UTF8 under Virtual Terminal.

PURE TERMINAL // en_US.ISO-8859-1
Pure text terminal localization is very clean and easy:

/etc/rc.conf
Code:
# polish terminal settings // choose yours using sysinstall for example
font8x8="iso02-8x8"
font8x14="iso02-8x14"
font8x16="iso02-8x16"
keymap="pl_PL.ISO8859-2"
scrnmap="NO"
/etc/ttys
Code:
# polish virtual terminals // choose yours using sysinstall for example
ttyv0   "/usr/libexec/getty Pc"         cons25l2        on  secure
ttyv1   "/usr/libexec/getty Pc"         cons25l2        on  secure
ttyv2   "/usr/libexec/getty Pc"         cons25l2        on  secure
ttyv3   "/usr/libexec/getty Pc"         cons25l2        on  secure
PURE TERMINAL + SCREEN // en_US.ISO-8859-1
Also screen under pure terminal displays encodings fine but needs also this setting:
/etc/zprofile /etc/profile /etc/csh.login
Code:
LC_ALL=en_US.ISO8859-1
VIRTUAL TERMINAL [X11] +/- SCREEN // en_US.UTF-8

Setting encoding/localizing X11 Virtual Terminal is little enigmatic to me, although I have found a way to have it localized properly. For example I need to export LC_ALL=en_US.UTF-8 in ~/.xinitrc file which is very strange to me.

~/.xinitrc
Code:
export LC_ALL=en_US.UTF-8

exec fluxbox
/etc/zprofile /etc/profile /etc/csh.login
Code:
LC_ALL=en_US.UTF-8
~/.Xdefaults
Code:
urxvt.imLocale: en_US.UTF-8
So we have a problem, we cannot set LC_ALL both to en_US.UTF-8 and to en_US.ISO8859-1 :/ we also cannot use $TERM varible to set our encoding properly, because $TERM will be changed by screen to screen, so this will not work:

/etc/zprofile /etc/profile /etc/csh.login
Code:
case "$TERM" in
  cons25*|linux)
    export LC_ALL=en_US.ISO8859-1
    ;;
  *rxvt*|*xterm*)
    export LC_ALL=en_US.UTF-8
    ;;
  screen)
    export LC_ALL=en_US.UTF-8
    ;;
esac
The sollution is to check for terminal speed [at least it works for me]:
Pure Terminal speed:
Code:
% stty|grep speed
speed 9600 baud;
Virtual Terminal speed:
Code:
% stty|grep speed
speed 38400 baud;
final setup based on terminal speed:

/etc/zprofile /etc/profile /etc/csh.login
Code:
case $( stty | grep speed | cut -d ' ' -f 2 ) in
  (9600)
    # pure console
    export LC_ALL=en_US.ISO8859-1
    ;;
  (38400)
    # terminal emulator
    export LC_ALL=en_US.UTF-8
    ;;
esac
these files remain the same as showed upper:
/etc/rc.conf
/etc/ttys
~/.Xdefaults
~/.xinitrc
EDIT:
I gorgot to add one of the key files and realized that NOW

keyboard entry in /etc/X11/xorg.conf must be:
Code:
Section "InputDevice"
  Identifier  ...
  Driver      ...
  ...
  Option      "XkbModel"    "pc105"
  Option      "XkbLayout"   "pl"
EndSection



Of course You will need to change all export words to setenv and also remove '=' if You use csh/tcsh shell, but {t}csh users know that
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd

Last edited by vermaden; 11th September 2012 at 08:13 AM.
Reply With Quote
  #2   (View Single Post)  
Old 25th June 2010
chmiels chmiels is offline
New User
 
Join Date: Jun 2010
Posts: 1
Default

I'm using 8.1RC1 and terminal speed returned by stty is always 9600 baud.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Default terminal color disappearedng FreeBSD General 5 21st February 2012 01:28 AM
Favorite Terminal Emulator JMJ_coder General software and network 23 5th November 2008 06:30 PM
Terminal display behavior 18Googol2 FreeBSD General 8 26th September 2008 02:05 PM
terminal darken FreeBSD General 8 18th July 2008 07:12 PM
terminal software for freebsd rex FreeBSD General 21 12th May 2008 07:40 AM


All times are GMT. The time now is 08:44 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick