tip/tip. Ubuntu2013. 4. 29. 13:46

http://www.tldp.org/HOWTO/Unicode-HOWTO.html#toc4


--> http://www.tldp.org/HOWTO/Unicode-HOWTO-3.html


locale setup


1. file & kernel


vfat / msdos / iso9660 / ntfs 는 utf8 mount 옵션 가짐.


2. Upgrading the C library


glibc-2.1.x  : multibyte locales 지원 불가!

glibc-2.2 : multibyte locales을 지원함.


항상 glibc-2.2부터 설치할것.


3. General data conversion


iconv : glibc-2.2에 딸려오는 프로그램임.


$ iconv --from-code=ISO-8859-1 --to-code=UTF-8 < old_file > new_file

4. Locale environment variables

LANGUAGE

override for LC_MESSAGES, used by GNU gettext only

LC_ALL

override for all other LC_* variables

LC_CTYPE, LC_MESSAGES, LC_COLLATE, LC_NUMERIC, LC_MONETARY, LC_TIME

individual variables for: character types and encoding, natural language messages, sorting rules, number formatting, money amount formatting, date and time display

LANG

default value for all LC_* variables


5. Creating the locale support files

UTF-8 locale 을 지원하려면 아래와 같이

$ localedef -v -c -i de_DE -f UTF-8 de_DE.UTF-8
옵션을 보자면
-v : verbose (상세설명)
-c : Create permanent output
-i locale_definition : locale_definition (/usr/share/locale 참조) 파일을 input으로 가져옴
-f charmap_file : charmap 파일 설정

마지막은 locale_name으로 -i -f의 특성을 가진 locale을 만든다.


요약~)

원하는 locale (예 ko_KR.eucKR)이 있다면

먼저
1. /usr/share/i18n/locales에서 ko_KR 존재 확인
2. /usr/share/i18n/charmaps에서 eucKR 존재 확인


방법1)
$ localedef -vci ko_KR -f eucKR ko_KR.eucKR
로 로케일 생성

방법2)
/etc/locale.gen 에 ko_KR.eucKR eucKR 추가후
locale-get 실행

방법3)
/etc/locale.gen에 ko_KR.eucKR에 주석되어 있다면
주석 삭제후
locale-gen


locale 관련 명령)

locale -a
locale-gen : template에서 현지화 정보 file을 생성 ( template locale.gen )
locale-get
localedef :
compile locale definition files ( template거치지 않고 direct 생성 )
dpkg-reconfigure locales : 충돌나는 locale 을 삭제
apt-get install localepurge


  추가예정

terminal 관련)

xterm은 xterm -u8로 실행해야 utf8을 지원한다.

http://www.ubuntu.or.kr/viewtopic.php?p=107726

'tip > tip. Ubuntu' 카테고리의 다른 글

linux memory cache 정리하기  (0) 2014.03.05
cygwin 1.7.x 한글 설정 & sshd  (0) 2013.07.12
[Ubuntu] Unix $ variables  (0) 2013.04.26
[Ubuntu] unix signal codes  (0) 2013.04.26
[linux] apt-get dpkg  (0) 2013.04.21
Posted by wooix