How to change the system language in Solaris

Source: Internet
Author: User
Tags expression locale

A Solaris system was installed on the virtual machine, but when the connection with the client was garbled, Google a bit and the problem was fixed. So tidy up, and then spare.

1, the language environment includes language specification, region, code set and other characteristics. The Solaris operating environment in Simplified Chinese includes the following locales:

c--to the English ASCII environment, the locale must be set to C.

zh--for the Simplified Chinese EUC environment, the locale must be set to En.

Zh. gbk--for the Simplified Chinese GBK environment, the locale must be set to En. GBK.

Zh. utf-8--for the Simplified Chinese Unicode environment, the locale must be set to En. UTF-8.

2, the kind is the characteristic set that composes the language environment. For example, a character display or a time/date expression whose performance depends on the locale. The Solaris categories in Simplified Chinese include the following:

LC_CTYPE sets the type of character to classify and convert.

Lc_time sets the locale used to express dates and times.

Lc_numeric sets the locale of the digital expression (also for I/O).

Lc_monetary sets the language environment for currency expression.

Lc_messages the locale to which messages are set to the user.

Lc_collate sets the string proofing that depends on the locale.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/unix/

environment variable Lc_all explicitly sets the same locale for all kinds; It has the highest priority. If the kind or lc_all is not set, the LANG environment variable determines the type setting.

Users can use shell environment variables to change locale settings. Each kind names an existing language environment. The setlocale () function directly sets or queries these kinds of settings. Internationalized features use these settings to access the appropriate table for the locale you want.

Environment variables can be used to set types indirectly: When setlocale () sets the type to the default setting for that location, it uses the set value of each environment variable to set the related kind. The setlocale () function does not change the setting values of environment variables, but only reads their set values.

3, Examples:

Use the following steps to change the system-wide default locale.

#chmod U+w/etc/default/init

#vi/etc/default/init

$ cat Init

#

# Copyright 1992, 1999-2002 Sun Microsystems, Inc. All rights reserved.

# Use are 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 isn't. To maintain

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

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

#

# Lines of this file should to the form Var=value, where VAR is one of

# TZ, LANG, Cmask, or any of the lc_* environment variables. Value May

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

#

Tz=prc

cmask=022

lang=en//Use English fonts

#LANG =ZH_CN. UTF-8

#LANG =zh. UTF-8

#:wq

#reboot

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.