summaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-misc.c
diff options
context:
space:
mode:
authorTatsuo Ishii <ishii@postgresql.org>2004-03-15 10:41:26 +0000
committerTatsuo Ishii <ishii@postgresql.org>2004-03-15 10:41:26 +0000
commite8c32050371d06c0f61fed02acc554fe7a7e8c66 (patch)
treeeac210624a8f5b14c2aceafbe3ccae3d44172d7e /src/interfaces/libpq/fe-misc.c
parent1bc2d544b979164a276f9e6052f0b6d23af59b60 (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/interfaces/libpq/fe-misc.c')
-rw-r--r--src/interfaces/libpq/fe-misc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c
index 3717998a6b1..d484747b9c5 100644
--- a/src/interfaces/libpq/fe-misc.c
+++ b/src/interfaces/libpq/fe-misc.c
@@ -23,7 +23,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.104 2003/11/29 19:52:12 pgsql Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-misc.c,v 1.105 2004/03/15 10:41:26 ishii Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1096,6 +1096,16 @@ PQmblen(const unsigned char *s, int encoding)
}
/*
+ * returns the display length of the word beginning s, using the
+ * specified encoding.
+ */
+int
+PQdsplen(const unsigned char *s, int encoding)
+{
+ return (pg_encoding_dsplen(encoding, s));
+}
+
+/*
* Get encoding id from environment variable PGCLIENTENCODING.
*/
int