character_length for utf8
Posted in 2013
KAMRAN HAQ — — source: IIUG Forums & Mailing Lists
We are working on utf8 characters and using following test case to find number
of characters or string length:
create table test(col varchar(50));
select col, length(col), character_length(col), substr(col,1,3),substr(col,1,1), col[1,3] from test;
南大街 9 9 南 � 南
abc 3 3 abc a abc
ab大 5 5 ab� a ab�
The results we are getting are number of bytes consumed by a string rather
number of characters. Is ther any solution to get number of characters in a
string?
Here are additional properties used in JDBC URL:
NEWCODESET=UTF8,8859-1,819;IFX_USE_STRENC=true
Informix Version; IDS 11.5