Get the App
SLTechnology News&Howtos  ›  Database  › 

Oracle to view the character set and the handling of Chinese garbled

Shulou Source: shulou.com Published: 2022-06-01 09:00:45 11月17日 Update

Col VALUE format a20

Select PARAMETER,VALUE from nls_database_parameters where PARAMETER like'% CHARACTERSET%'

PARAMETER VALUE---NLS_CHARACTERSET AL32UTF8NLS_NCHAR_CHARACTERSET AL16UTF16

Select userenv ('language') from dual

USERENV ('LANGUAGE')-AMERICAN_AMERICA.AL32UTF8

LANG is a setting for the language, region, and character set of the Linux system, and is valid for applications under linux, such as date

NLS_LANG is set for Oracle language, region and character set, and is valid for tools in oracle

Export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

Export NLS_LANG=AMERICAN_AMERICA.UTF8 # cannot be set to this. If set to this, sqlplus cannot log in.

Export NLS_LANG=SIMPLIFIED CHINESE_AMERICA.UTF8

LANG=en_US.UTF-8

Export LANG= zh_CN.GB2312

Export LANG= en_US.UTF-8

Locale View character set

Locale-a view local character set

Locale-m view all supported character sets

Alter session set nls_date_format = 'yyyy-MM-dd HH24:mi:ss'

Select to_char (sysdate,'yyyy-MM-dd HH24:mi:ss') from dual

Select to_date ('2005-01-01 13-14-14-20-13-14-14-20) from dual

Ways to ensure that Chinese is not garbled:

1. Remote tools, such as CRT,xshell character set, are set to support Chinese character sets such as utf-8

2. Set operating system environment variables to support Chinese character sets, such as utf-8 LANG or NLS_LANG.

3. The database supports Chinese character set utf-8.

Tags: Character character set Chinese support valid region tool system language utf-8 garbled operating system variable Application data Database method Environment Program guarantee Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Xiaomi Shulou Technology Docker Apple