VI涔辩��, cat �� more姝e父

VI涔辩��, cat �� more姝e父

璁剧疆 export LC_ALL="zh_CN.GB2312" 锛� ��瀹����ョ��澧�~/.bashrc涓���棰�灏辫В�充���
Locale��杞�浠跺�ㄨ�琛��剁��璇�瑷���澧�, 瀹�����璇�瑷�(Language), �板�� (Territory) ��瀛�绗���
Codeset)��
涓�涓�locale��涔����煎�涓�: 璇�瑷�[�板��[.瀛�绗���]]��瀹��ㄧ��locale琛ㄨ揪�瑰��� [璇�瑷�[�板��][.瀛�绗���] [@淇�姝e��]��
zh_CN.GB2312 锛�涓���_涓���浜烘��卞���斤��芥��2312瀛�绗�����

[nick@ubuntu~]$ locale
LANG=en_US.UTF-8
LANGUAGE="zh_CN:en"
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"

LC_ALL=zh_CN.UTF-8

locale�����ф��娑����扮������浼�缁�����涓��归�㈠����12涓�澶х被锛�杩�12涓�澶х被������锛�
1��瀛�绗�杈���(LC_CTYPE)
2���板��(LC_NUMERIC)
3��姣�杈�����搴�涔���(LC_COLLATE)
4���堕�存�剧ず�煎�(LC_TIME)
5��璐у���浣�(LC_MONETARY)
6��淇℃��锛�涓昏�����绀轰俊��,��璇�淇℃��,�舵��淇℃��,��棰�,��绛�,����������绛�(LC_MESSAGES)
7��濮���涔����瑰�(LC_NAME)
8���板��涔����瑰�(LC_ADDRESS)
9���佃���风��涔����瑰�(LC_TELEPHONE)
10��搴���琛¤〃杈炬�瑰� (LC_MEASUREMENT)
11��榛�璁ょ焊寮�灏哄�稿ぇ灏�(LC_PAPER)
12��瀵�locale��韬�����淇℃����姒�杩�(LC_IDENTIFICATION)

locale��璁惧��锛�

LC_ALL��LANG浼���绾х���崇郴锛�LC_ALL > LC_* > LANG

淇��规��浠�(debian绯诲��)锛�/etc/default/locale
淇��规��浠�(redhat绯诲��)锛�/etc/sysconfig/i18n
1��濡�����瑕�涓�涓�绾�涓�����绯荤���璇�锛�璁惧��LC_ALL=zh_CN.XXXX锛�����LANG=zh_CN.XXXX�藉��浠ャ��
2��濡������宠�涓�涓���浠ヨ��ヤ腑������澧�锛���淇�����������棰�锛�绯荤�淇℃��绛�绛�涓鸿�辨������锛��d�����瑕�璁惧�� LC_CTYPE=zh_CN.XXXX锛�LANG=en_US.XXXX灏卞��浠ヤ���
3����濡�浠�涔�涔�涓�����璇�锛�涔�灏辨��LC_ALL锛�LC_*��LANG��涓���瀹��瑰���肩��璇�锛�绯荤�灏�����POSIX浣�涓�lcoale锛�涔�灏辨��C locale��

LANG��LANGUAGE���哄��锛�
LANG - Specifies the default locale for all unset locale variables
LANGUAGE - Most programs use this for the language of its interface

LANGUAGE��璁剧疆搴��ㄧ�搴������㈣��瑷�����LANG��浼���绾у�浣���涓�涓�����锛�瀹���瀹�����涓�locale���崇��������榛�璁ゅ��

�荤�涓�涓�锛�
璁惧��浜�LC_ALL灏变��ㄨ�剧疆�朵���浜�锛�浠�浼�寮哄�惰�����LC_.璁剧疆�ㄥ��LC_��LANG��璇�锛�娌℃��璁剧疆��LC_*���ㄧ����LANG���笺��

1��涓存�惰�惧��缂���锛�[nick@ubuntu~]$ export LC_ALL="zh_CN.GBK"
2��姘镐�璁惧��缂���锛�淇��规��浠�/etc/profile锛�瀵规�����ㄦ�锋����锛�����~/.bash_profile���ㄦ��浠跺熬����export LC_ALL=zh_CN.GBK

�朵�宸ュ�风��璁剧疆锛�
1��SecureCRT锛�Options->SessionOptions->Appearance->Character encoding璁剧疆����linux绯荤�涓��风��瀛�绗�缂�����
2��Vim锛�set termencoding=gbk encoding=utf-8��set fileencodings=gbk,utf-8

你可能感兴趣的:(VI涔辩��, cat �� more姝e父)