eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« MogDB 是什么?- 云和恩墨的数据库产品 | Blog首页 | openGauss 入门指南:这些文档你不能错过 »

MogDB 对于生僻字的存储和显示:㼆 㱔 䶮
modb.pro

最近在云和恩墨大讲堂的微信群里,有朋友讨论生僻字的存储,其实无论任何数据库,MogDB 还是 Oracle ,在任何数据库中存储生僻字,其实都和一个因素有关:字符集。

能否正常存储一个字符,首先是要看要存储的字符在数据库的当前字符集中是否能够表达。如果包含在数据库字符集中,则能够正常存储。

但是注意,很多时候,本应正常存储的字符,可能在写入过程中,因为环境问题转换错误,丢失了正确的字符,而出现乱码。

标题中出现的生僻字读音:㼆 yíng ,㱔 suǒ,䶮 yǎn

这里面有一个特殊的字:(王莹) 。注意,如果你的客户端没有支持的字库,则可能无法看到这个字。

我们看一下 MogDB 的表现,我们使用了墨天轮的实训平台,字符集如下:

enmotech=# select * from v$nls_parameters;
      parameter       |           value            |                                 description                                  
----------------------+----------------------------+------------------------------------------------------------------------------
 lc_collate           | en_US.UTF-8                | Shows the collation order locale.
 lc_ctype             | en_US.UTF-8                | Shows the character classification and case conversion locale.
 lc_messages          | en_US.UTF-8                | Sets the language in which messages are displayed.
 lc_monetary          | en_US.UTF-8                | Sets the locale for formatting monetary amounts.
 lc_numeric           | en_US.UTF-8                | Sets the locale for formatting numbers.
 lc_time              | en_US.UTF-8                | Sets the locale for formatting date and time values.
 nls_timestamp_format | DD-Mon-YYYY HH:MI:SS.FF AM | defines the default timestamp format to use with the TO_TIMESTAMP functions.
 NLS_CHARACTERSET     | UTF8                       | Database/Server encoding
(8 rows)

生僻字的示范:


如果直接贴代码,不支持的客户端可能就看不到其中的部分汉字:

enmotech=# create table mogdb (cname varchar2(10));
CREATE TABLE
enmotech=# 
enmotech=# insert into mogdb values('䶮');
INSERT 0 1
enmotech=# insert into mogdb values('㼆');
INSERT 0 1
enmotech=# insert into mogdb values('

...

竟然无法存储,参考链接:
https://www.modb.pro/db/130498

历史上的今天...
    >> 2015-10-12文章:
    >> 2009-10-12文章:
    >> 2008-10-12文章:
    >> 2006-10-12文章:
    >> 2005-10-12文章:
    >> 2004-10-12文章:
           Use RMAN to Manage BackupSet

By eygle on 2021-10-12 10:23 | Comments (0) | modb.pro | 3419 |


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com