Preface
 
    Today,I'm gonna say something what is related with the character set in Oracle database,the scenarios in changing character set from UTF8 to ZHS16GBK and the contra way as well.
    It' not recommended to modify character set in Oracle database because of the risk of lost data especially in changing superset to subset.Even though you can use "internal_use" option to change.
    You need to pay more attention in understanding some limitation in doing that.Data must be export with correct character set before you to really change it.Let's see the details below.
 
Environment
 
Hostname IP Linux Version Oracle Database SID
ogg 192.168.1.20 RHEL 5.7 11.2.0.1 ogg
 
Procedure
 
1. Set database character set from ZHS16GBK to UTF8.
 
Check the character set of database.
 SQL> set line  pages
SQL> col value for a40
SQL> select * from nls_database_parameters; PARAMETER VALUE
------------------------------ ----------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET ZHS16GBK
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 11.2.0.1. rows selected. SQL> select userenv('language') from dual; USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK
Create test user and test table.
 SQL> col file_name for a60
SQL> col tablespace_name for a30
SQL> select file_name,tablespace_name,bytes// from dba_data_files; FILE_NAME TABLESPACE_NAME BYTES//
------------------------------------------------------------ ------------------------------ ---------------
/u01/app/oracle/oradata/ogg/system01.dbf SYSTEM
/u01/app/oracle/oradata/ogg/sysaux01.dbf SYSAUX
/u01/app/oracle/oradata/ogg/undotbs01.dbf UNDOTBS1
/u01/app/oracle/oradata/ogg/zlm01.dbf ZLM SQL> create user zlm identified by zlm default tablespace zlm; User created. SQL> grant dba to zlm; Grant succeeded.
SQL> conn zlm/zlm
Connected.
SQL> create table zlm.test_charset(
id number,
name varchar2(),
primary key(id)
); Table created. SQL> insert into zlm.test_charset(id,name) values(,'黎明'); row created. SQL> commit; Commit complete. SQL> select * from test_charset; ID NAME
---------- ----------
黎明 SQL> select length('黎'),length('明') from dual; LENGTH('黎') LENGTH('明')
------------ ------------ SQL> select lengthb('黎'),lengthb('明') from dual; LENGTHB('黎') LENGTHB('明')
------------- ------------- //ZHS16GBK character set occupies 2 byte to store one Chinese character here.
//Be aware of the difference of length() function between MySQL and Oracle.
//In MySQL,length() returns bytes instead of characters.
Export the test table with expdp.
 SQL> select *from dba_directories;

 OWNER                   DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
--------------------------------------------------------------------------------
SYS ORACLE_OCM_CONFIG_DIR
/u01/app/oracle/product/11.2./db_1/ccr/state SYS DATA_PUMP_DIR
/u01/app/oracle/admin/ogg/dpdump/ SYS XMLDIR
/u01/app/oracle/product/11.2./db_1/rdbms/xml SQL> create directory datapump as '/u01/'; Directory created. SQL> grant read,write on directory datapump to zlm;
grant read,write on directory datapump to zlm
*
ERROR at line :
ORA-: you may not GRANT/REVOKE privileges to/from yourself SQL> conn / as sysdba
Connected.
SQL> grant read,write on directory datapump to zlm; Grant succeeded. SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1. - 64bit Production
With the Partitioning option
[oracle@ogg ~]$ expdp zlm/zlm directory=datapump dumpfile=zlm_datapump_`date +%Y%m%d`.dmp logfile=zlm_datapump_`date +%Y%m%d`.log schemas=zlm Export: Release 11.2.0.1. - Production on Wed Jul :: Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1. - 64bit Production
With the Partitioning option
Starting "ZLM"."SYS_EXPORT_SCHEMA_01": zlm/******** directory=datapump dumpfile=zlm_datapump_20180711.dmp logfile=zlm_datapump_20180711.log schemas=zlm
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
. . exported "ZLM"."TEST_CHARSET" 5.414 KB 1 rows
Master table "ZLM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for ZLM.SYS_EXPORT_SCHEMA_01 is:
/u01/zlm_datapump_20180711.dmp
Job "ZLM"."SYS_EXPORT_SCHEMA_01" successfully completed at 12:51:31 [oracle@ogg ~]$ cd /u01
[oracle@ogg u01]$ ls -l
total 200
drwxrwxr-x 4 oracle oinstall 4096 May 19 2017 app
drwxrwxr-x 3 oracle oinstall 4096 Mar 29 15:40 arch
drwxrwxr-x 14 oracle oinstall 4096 Feb 7 17:01 ogg
-rw-r----- 1 oracle oinstall 184320 Jul 11 12:51 zlm_datapump_20180711.dmp
-rw-r--r-- 1 oracle oinstall 1500 Jul 11 12:51 zlm_datapump_20180711.log
[oracle@ogg u01]$
Modify the character set into "UTF8".
 SQL> alter database character set utf8;
alter database character set utf8
*
ERROR at line :
ORA-: new character set must be a superset of old character set //Notice!This means that UTF8 is not the superset of ZHS16GBK. SQL> alter database character set internal_use utf8;
alter database character set internal_use utf8
*
ERROR at line :
ORA-: operation requires database is in RESTRICTED mode SQL> shutdown immediate
ORA-: insufficient privileges
SQL> conn / as sysdba
Connected.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount exclusive;
ORACLE instance started. Total System Global Area bytes
Fixed Size bytes
Variable Size bytes
Database Buffers bytes
Redo Buffers bytes
Database mounted.
SQL> alter system enable restricted session; System altered. SQL> alter database open; Database altered. SQL> alter database character set internal_use utf8;
alter database character set internal_use utf8
*
ERROR at line :
ORA-: operation cannot execute when other sessions are active //Exit the other sessions who are active. SQL> alter database character set internal_use utf8; Database altered. SQL>
Check the new database character set.
 SQL> set line  pages
SQL> col value for a40
SQL> select * from nls_database_parameters; PARAMETER VALUE
------------------------------------------------------------ ----------------------------------------
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CHARACTERSET UTF8
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-RR
NLS_DATE_LANGUAGE AMERICAN
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_RDBMS_VERSION 11.2.0.1. rows selected. SQL> select userenv('language') from dual; USERENV('LANGUAGE')
--------------------------------------------------------------------------------------------------------
AMERICAN_AMERICA.UTF8 SQL>
Check the original data in test table.
 SQL> conn zlm/zlm
Connected.
SQL> select * from test_charset; ID NAME
---------- --------------------
?? //My client character set of Xshell is still GBK now,change it to utf8 and check again. SQL> select * from test_charset; ID NAME
---------- --------------------
?£¿ //The NLS_LANG variable is still GBK,modify the oracle profile to correct the character set to UTF8. SQL> !
[oracle@ogg u01]$ cat ~/.bash_profile|grep NLS_LANG
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
[oracle@ogg u01]$ vi ~/.bash_profile
[oracle@ogg u01]$ cat ~/.bash_profile|grep NLS_LANG
export NLS_LANG=AMERICAN_AMERICA.UTF8
[oracle@ogg u01]$ . ~/.bash_profile
[oracle@ogg u01]$ echo $NLS_LANG
AMERICAN_AMERICA.UTF8
[oracle@ogg u01]$ sqlplus zlm/zlm SQL*Plus: Release 11.2.0.1. Production on Wed Jul :: Copyright (c) , , Oracle. All rights reserved. Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1. - 64bit Production
With the Partitioning option SQL> select * from test_charset; ID NAME
---------- ----------
hķ //It's still messy code here after i've unified the character set with server,client,NLS_LANG.
Drop test user and import it into database with the previous dump file.
 SQL> show user;
USER is "ZLM"
SQL> conn / as sysdba
Connected.
SQL> drop user zlm cascade;
drop user zlm cascade
*
ERROR at line :
ORA-: cannot drop a user that is currently connected SQL> select sid,serial#,status from v$session where username='ZLM'; SID SERIAL# STATUS
---------- ---------- --------
INACTIVE SQL> alter system kill session '1,7'; System altered. SQL> select sid,serial#,status from v$session where username='ZLM'; SID SERIAL# STATUS
---------- ---------- --------
KILLED SQL> drop user zlm cascade; User dropped. SQL> alter user system identified by 'Passw0rd';
alter user system identified by 'Passw0rd'
*
ERROR at line :
ORA-: missing or invalid password(s) SQL> alter user system identified by Passw0rd; User altered. SQL> !
[oracle@ogg u01]$ ls -l
total
drwxrwxr-x oracle oinstall May app
drwxrwxr-x oracle oinstall Jul : arch
drwxrwxr-x oracle oinstall Feb : ogg
-rw-r----- oracle oinstall Jul : zlm_datapump_20180711.dmp
-rw-r--r-- oracle oinstall Jul : zlm_datapump_20180711.log
[oracle@ogg u01]$ impdp system/Passw0rd directory=datapump dumpfile=zlm_datapump_20180711.dmp Import: Release 11.2.0.1. - Production on Wed Jul :: Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1. - 64bit Production
With the Partitioning option
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01": system/******** directory=datapump dumpfile=zlm_datapump_20180711.dmp
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "ZLM"."TEST_CHARSET" 5.414 KB 1 rows
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at 15:32:56 [oracle@ogg u01]$
Check the data in user zlm again.
 [oracle@ogg u01]$ exit
exit SQL> conn zlm/zlm
ERROR:
ORA-: your session has been killed Connected.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1. - 64bit Production
With the Partitioning option
[oracle@ogg u01]$ sqlplus zlm/zlm SQL*Plus: Release 11.2.0.1. Production on Wed Jul :: Copyright (c) , , Oracle. All rights reserved. Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1. - 64bit Production
With the Partitioning option SQL> select * from test_charset; ID NAME
---------- --------------------
hķ SQL> select userenv('language') from dual; USERENV('LANGUAGE')
--------------------------------------------------------------------------------
AMERICAN_AMERICA.UTF8 SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1. - 64bit Production
With the Partitioning option
[oracle@ogg u01]$ echo $NLS_LANG
AMERICAN_AMERICA.ZHS16GBK //The NLS_LANG is not equal with the character set in database.
[oracle@ogg u01]$ sed -i 's/ZHS16GBK/UTF8/g' ~/.bash_profile
[oracle@ogg u01]$ cat ~/.bash_profile|grep NLS_LANG
export NLS_LANG=AMERICAN_AMERICA.UTF8
[oracle@ogg u01]$ . ~/.bash_profile
[oracle@ogg u01]$ echo $NLS_LANG
AMERICAN_AMERICA.UTF8
[oracle@ogg u01]$ sqlplus zlm/zlm SQL*Plus: Release 11.2.0.1. Production on Wed Jul :: Copyright (c) , , Oracle. All rights reserved. Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1. - 64bit Production
With the Partitioning option SQL> select * from test_charset; ID NAME
---------- ----------
黎明 SQL> select length('黎'),length('明') from dual; LENGTH('黎') LENGTH('明')
------------ ------------ SQL> select lengthb('黎'),lengthb('明') from dual; LENGTHB('黎') LENGTHB('明')
------------- ------------- SQL> //The character set of database has been changed to UTF8 now and the data is either equal with the orgiginal data.
2. Set database character set from UTF8 to ZHS16GBK.
 
Insert a test record into test_charset table and shutdown instance to change character set again.
 SQL> insert into test_charset values(,'上海');

  row created.

 SQL> commit;

 Commit complete.

 SQL> select * from test_charset;

     ID NAME
---------- ----------
黎明
上海 SQL> select length('上'),length('海') from dual; LENGTH('上') LENGTH('海')
------------ ------------ SQL> select lengthb('上'),lengthb('海') from dual; LENGTHB('上') LENGTHB('海')
------------- ------------- SQL> alter database character set ZHS16GBK;
alter database character set ZHS16GBK
*
ERROR at line :
ORA-: new character set must be a superset of old character set SQL> alter database character set internal_use ZHS16GBK;
alter database character set internal_use ZHS16GBK
*
ERROR at line :
ORA-: operation requires database is in RESTRICTED mode SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup restrict
ORACLE instance started. Total System Global Area bytes
Fixed Size bytes
Variable Size bytes
Database Buffers bytes
Redo Buffers bytes
Database mounted.
Database opened.
SQL> alter database character set internal_use ZHS16GBK; Database altered. SQL> select userenv('language') from dual; USERENV('LANGUAGE')
--------------------------------------------------------------------------------
AMERICAN_AMERICA.ZHS16GBK SQL>
Modify the character set of NLS_LANG togeter with that in client tool such as Xshell in my environment.
 SQL> !
[oracle@ogg u01]$ echo $NLS_LANG
AMERICAN_AMERICA.UTF8
[oracle@ogg u01]$ sed -i 's/UTF8/ZHS16GBK/g' ~/.bash_profile
[oracle@ogg u01]$ echo $NLS_LANG
AMERICAN_AMERICA.UTF8
[oracle@ogg u01]$ . ~/.bash_profile
[oracle@ogg u01]$ echo $NLS_LANG
AMERICAN_AMERICA.ZHS16GBK
[oracle@ogg u01]$ exit
exit SQL> select * from test_charset;
select * from test_charset
*
ERROR at line :
ORA-: table or view does not exist SQL> conn zlm/zlm
Connected.
SQL> select * from test_charset; ID NAME
---------- ------------------------------
姒涘孩妲
娑撳﹥鎹 SQL> //It's messy code now only if you've exported the data with datapump before you change the character set.Unfortunetely,I didn't to that this time.The characters in the test table test_charset has been destroyed.Can it come back again then?
Change it back to utf8 and check what will happen then?
 SQL> alter database character set utf8;
alter database character set utf8
*
ERROR at line :
ORA-: new character set must be a superset of old character set SQL> alter database character set internal_use utf8;
alter database character set internal_use utf8
*
ERROR at line :
ORA-: operation requires connection as SYS //It needs sys role privilege to finish the work. SQL> show user;
USER is "ZLM"
SQL> conn / as sysdba
Connected.
SQL> alter database character set internal_use utf8; Database altered. SQL> select * from zlm.test_charset; ID NAME
---------- ----------
榛庢槑
涓婃捣 SQL> select userenv('language') from dual; USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.UTF8 //Character set of database server is UTF8 now. SQL> !
[oracle@ogg u01]$ echo $NLS_LANG
AMERICAN_AMERICA.UTF8 //NLS_LANG is UTF8,too.
[oracle@ogg u01]$ //Character set of client tool has been changed to UTF8 as well.But the data cannot show the correct characters anymore.Have they been really destroyed?
Notice,only the user who has sys role privelge  can login instance after using "restrict" mode.See below.
 [oracle@ogg ~]$ sqlplus / as sysdba

 SQL*Plus: Release 11.2.0.1. Production on Wed Jul  :: 

 Copyright (c) , , Oracle.  All rights reserved.

 Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1. - 64bit Production
With the Partitioning option SQL> create user aaron8219 identified by aaron8219; User created. SQL> grant session,connect to aaron8219;
grant session,connect to aaron8219
*
ERROR at line :
ORA-: role 'SESSION' does not exist SQL> grant connect,resource to aaron8219; Grant succeeded. SQL> conn aaron8219/aaron8219
ERROR:
ORA-: ORACLE only available to users with RESTRICTED SESSION privilege Warning: You are no longer connected to ORACLE.
SQL>

Supplemented on July 12

 SQL> select userenv('language') from dual;

 USERENV('LANGUAGE')
--------------------------------------------------------------------------------------------------------
AMERICAN_AMERICA.UTF8 SQL> select * from zlm.test_charset; ID NAME
---------- --------------------

ʏº£ SQL> !
[oracle@ogg ~]$ echo $NLS_LANG
AMERICAN_AMERICA.ZHS16GBK
[oracle@ogg ~]$ sed -i 's/ZHS16GBK/UTF8/g' .bash_profile
[oracle@ogg ~]$ cat .bash_profile|grep NLS
export NLS_LANG=AMERICAN_AMERICA.UTF8
[oracle@ogg ~]$ . .bash_profile
[oracle@ogg ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1. Production on Thu Jul :: Copyright (c) , , Oracle. All rights reserved. Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1. - 64bit Production
With the Partitioning option SQL> select * from zlm.test_charset; ID NAME
---------- ----------
黎明
上海 SQL> select userenv('language') from dual; USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.UTF8 SQL> select lengthb('上'),lengthb('海') from dual; LENGTHB('上') LENGTHB('海')
------------- ------------- //Change the character set of client tool to utf8,then the messy code came back again. SQL> select * from zlm.test_charset; ID NAME
---------- ----------
榛庢槑
涓婃捣 SQL> //Actually,the reason why messy code occurs yesterday is due to the discordance between the character set of database,NLS_LANG,client tool.
//Although it proves that the data haven't been destroyed but there's a risk of mismatch of data if you change character set without backing up your whole data.
Summary
  • "internal_use" can help you to change character set without the constraint of subset to superset.
  • Only sys privilege users can login instance while database is running in restrict mode.
  • Be aware of ZHS16GBK is not subset of UTF8.It may baffle us most people.
  • It's not recommeded to change character set in oracle database which contains Chinese characters.
  • Don't forget to backup your data(logically) with datapump before you change the character set.
  • Make your  character set equal in client tool,NLS_LANG,db server anytime.This is the most important thing to keep in mind.
 

谨慎修改Oracle数据库字符集(UTF8<->ZHS16GBK)的更多相关文章

  1. Linux下修改Oracle数据库字符集命令

    常见情形:从服务器备份Oracle数据库后再到本地机器上还原Oracle数据库的时候经常会碰见数据库字符编码不一致的情况,可以用以下命令来修改本地的Oracle数据库字符编码,然后顺利还原Oracle ...

  2. oracle_修改Oracle数据库字符集 AL32UTF8;

    修改数据库字符集 以支持维文等  utf8 停掉库 进入装载模式 ALTER SYSTEM ENABLE RESTRICTED SESSION; ALTER SYSTEM SET JOB_QUEUE_ ...

  3. 修改Oracle数据库的字符集为UTF-8

    1.改客户端字符集:通过WINDOWS的运行菜单运行Regedit,修改注册表 Start -> Run -> Rededit <-| Under registry Editor - ...

  4. 修改oracle数据库的编码为utf-8

    1.查看数据库字符集 ? 数据库服务器字符集select * from nls_database_parameters,其来源于props$,是表示数据库的字符集. 客户端字符集环境select * ...

  5. oracle数据库字符集的修改

    本文摘自:http://blog.csdn.net/nsj820/article/details/65711051.改客户端字符集:通过WINDOWS的运行菜单运行Regedit,修改注册表 Star ...

  6. linux下oracle数据库字符集修改

    linux下oracle数据库字符集修改 0.RHEL6.7.oracle11gr2 1.登录oracle.在安装oracle的用户下进入数据库. $ sqlplus / as sysdba 2.查询 ...

  7. Oracle数据库字符集问题解析

    Oracle数据库字符集问题解析 经常看到一些朋友问ORACLE字符集方面的问题,我想以迭代的方式来介绍一下.第一次迭代:掌握字符集方面的基本概念.有些朋友可能会认为这是多此一举,但实际上正是由于对相 ...

  8. Oracle数据库字符集问题

    Oracle数据库的字符集问题,也涉及作为服务器操作系统的CentOS或者Windows的字符集与Oracle字符集之间的关联关系Oracle的字符集,这个问题的提出是因为两个原因:一是遇到一个DMP ...

  9. 选择ORACLE数据库字符集

    如何选择数据库的字符集是一个有争议的话题,字符集本身涉及的范围很广,它与应用程序.客户的本地环境.操作系统.服务器等关系很密切,因此要做出合适的 选择,需要明白这些因素之间的关系.另外对字符集的基本概 ...

随机推荐

  1. mysql三表联合查询

    -- SELECT d.userId, d.userPhoNum, a.orderId, a.productType, b.courseId, b.courseName, c.payJe -- FRO ...

  2. CSS的伪类 :before 和 :after

    CSS 有两个说不上常用的伪类 :before 和 :after,偶尔会被人用来添加些自定义格式什么的,但是它们的功用不仅于此.前几天发现了 Creative Link Effects 这个非常有意思 ...

  3. Angularjs之依赖注入

    一个对象通常有三种方式可以获得对其依赖的控制权: 在内部创建依赖: 通过全局变量进行引用: 在需要的地方通过参数进行传递 依赖注入是通过第三种方式实现的.比如: function SomeClass( ...

  4. HTML5 localstorage和session操作

    setStorage={ getLocal : function(key){ //获得localStorage里面的值 var storage = window.localStorage; if(st ...

  5. stylish——一键为网页换肤,改变字体大小,去除广告

    今天给大家介绍的是一款非常好用的插件stylishstylish是一款可以为网站自定义主题的插件 可以在chrome的应用商店找到也可以通过网址访问https://userstyles.org/ 应用 ...

  6. Thinkphp中在本地测试很好,在服务器上出错,有可能是因为debug缓存的问题

    define('APP_DEBUG',false); 这个设置从true改为false后,一定要清空缓存,否则会出错.

  7. C#复制粘贴

    用C#程序复制粘贴非常简单,这里为了实用,只介绍对文字的操作,其他情况类似: Clipboard.SetText(“我是需要复制到系统剪贴板的文字”); 执行以上代码后,即可ctrl+V进行粘贴.是不 ...

  8. memcached安装及.NET中的Memcached.ClientLibrary使用

    一.安装服务端: 服务端:http://code.jellycan.com/files/memcached-1.2.6-win32-bin.zip 64:http://blog.couchbase.c ...

  9. Windows 实用小工具

    超实用的Windows工具 ====================================================================================== ...

  10. Docker的安装及加速

    使用 yum 安装(CentOS 7下) Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker . 通过 uname ...