Solaris 更改系統語言

2021-09-05 23:09:28 字數 1825 閱讀 4002

在虛擬機器上裝了乙個solaris的系統, 不過用客戶端進行連線的時候出現了亂碼, google 了一下, 問題搞定了。 故整理一下,以後備用。 

1. 語言環境包括語言規範、地域、**集和其它特徵

。簡體中文 solaris 操作環境包括下列語言環境:

c--對英文 ascii 環境,該語言環境必須設定為 c。

zh--對簡體中文 euc 環境,該語言環境必須設定為 zh。

zh.gbk--對簡體中文 gbk 環境,該語言環境必須設定為zh.gbk。

zh.utf-8--對簡體中文 unicode 環境,該語言環境必須設定為zh.utf-8。

2. 種類是組成語言環境的特徵集

簡體中文 solaris 種類包括下列內容:

lc_ctype 設定分類和轉換的字元型別。

lc_time 設定用於表達日期和時間的語言環境。

lc_numeric 設定數字表達的語言環境(也用於 i/o)。

lc_monetary 設定貨幣表達的語言環境。

lc_messages 設定給使用者的訊息的語言環境。

lc_collate 設定取決語言環境的字串校對。

環境變數 lc_all 明確為所有種類設定相同的語言環境;它有最高端優先權。如果種類或 lc_all 未設定,則 lang 環境變數將決定種類設定。

使用者可使用 shell 環境變數來改變語言環境設定。每個種類命名乙個現有的語言環境。setlocale() 函式直接設定或查詢這些種類的設定。國際化的功能使用這些設定來訪問所需語言環境相應的表。

環境變數可用以間接設定種類:當 setlocale() 將種類設定為該地點的預設設定值時,它使用每個環境變數的設定值來設定相關種類。setlocale() 函式不改變環境變數的設定值,只是讀取它們的設定值。

3. 示例:

用下列步驟改變系統範圍的預設語言環境。

#chmod u+w /etc/default/init

#vi /etc/default/init

$ cat init

# # use is subject to license terms.

##ident  "@(#)init.dfl   1.7     02/12/03 smi"

## this file is /etc/default/init.  /etc/timezone is a symlink to this file.

# this file looks like a shell script, but it is not.  to maintain

# compatibility with old versions of /etc/timezone, some shell constructs

# (i.e., export commands) are allowed in this file, but are ignored.

## lines of this file should be of the form var=value, where var is one of

# tz, lang, cmask, or any of the lc_* environment variables.  value may

# be enclosed in double quotes (") or single quotes (').

#tz=prc

cmask=022

lang=en //使用英文本型

#lang=zh_cn.utf-8  

#lang=zh.utf-8 

#:wq

#reboot

注: 相關資料來自google. 

Solaris 更改系統語言

在虛擬機器上裝了乙個solaris的系統,不過用客戶端進行連線的時候出現了亂碼,google了一下,問題搞定了。故整理一下,以後備用。1.語言環境包括語言規範 地域 集和其它特徵 簡體中文solaris操作環境包括下列語言環境 c 對英文ascii環境,該語言環境必須設定為c。zh 對簡體中文euc...

Solaris更改系統語言

1.語言環境包括語言規範 地域 集和其它特徵。簡體中文 solaris 操作環境包括下列語言環境 c 對英文 ascii 環境,該語言環境必須設定為 c。zh 對簡體中文 euc 環境,該語言環境必須設定為 zh。zh.gbk 對簡體中文 gbk 環境,該語言環境必須設定為zh.gbk。zh.utf...

Solaris下更改IP位址

solaris下更改ip位址 1 ifconfig命令暫時修改 ifconfig用來配置網絡卡的ip位址,改動後即生效,但並不儲存,下次啟動後失效。ifconfig a 得出網絡卡的名字,一般第一塊100m網絡卡名為 hme0 ifconfig hme0 down 先把網絡卡hme0的服務暫時停止 ...