Home Oracle 查看汉字所占字节
Post
Cancel

Oracle 查看汉字所占字节

使用以下语句查询

1
select userenv('language') from dual;

如果显示如下,一个汉字占用两个字节

1
SIMPLIFIED CHINESE_CHINA.ZHS16GBK

如果显示如下,一个汉字占用三个字节

1
SIMPLIFIED CHINESE_CHINA.AL32UTF8

也可以用以下语句查询一个汉字占用的字节长度

1
select lengthb('你') from dual;
This post is licensed under CC BY 4.0 by the author.