diff options
author | Tatsuo Ishii <ishii@postgresql.org> | 2004-03-15 10:41:26 +0000 |
---|---|---|
committer | Tatsuo Ishii <ishii@postgresql.org> | 2004-03-15 10:41:26 +0000 |
commit | e8c32050371d06c0f61fed02acc554fe7a7e8c66 (patch) | |
tree | eac210624a8f5b14c2aceafbe3ccae3d44172d7e /src/backend/utils/mb/mbutils.c | |
parent | 1bc2d544b979164a276f9e6052f0b6d23af59b60 (diff) |
Add PQmbdsplen() which returns the "display length" of a character.
Still some works needed:
- UTF-8, MULE_INTERNAL always returns 1
Diffstat (limited to 'src/backend/utils/mb/mbutils.c')
-rw-r--r-- | src/backend/utils/mb/mbutils.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/utils/mb/mbutils.c b/src/backend/utils/mb/mbutils.c index 3838a0a0979..96dd563862e 100644 --- a/src/backend/utils/mb/mbutils.c +++ b/src/backend/utils/mb/mbutils.c @@ -4,7 +4,7 @@ * (currently mule internal code (mic) is used) * Tatsuo Ishii * - * $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.45 2003/11/29 19:52:02 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.46 2004/03/15 10:41:25 ishii Exp $ */ #include "postgres.h" @@ -463,6 +463,13 @@ pg_mblen(const unsigned char *mbstr) return ((*pg_wchar_table[DatabaseEncoding->encoding].mblen) (mbstr)); } +/* returns the display length of a multibyte word */ +int +pg_dsplen(const unsigned char *mbstr) +{ + return ((*pg_wchar_table[DatabaseEncoding->encoding].dsplen) (mbstr)); +} + /* returns the length (counted as a wchar) of a multibyte string */ int pg_mbstrlen(const unsigned char *mbstr) |