1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

Add PQmbdsplen() which returns the "display length" of a character.

Still some works needed:
- UTF-8, MULE_INTERNAL always returns 1
This commit is contained in:
Tatsuo Ishii
2004-03-15 10:41:26 +00:00
parent 1bc2d544b9
commit e8c3205037
6 changed files with 261 additions and 45 deletions

View File

@ -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 $
*
*-------------------------------------------------------------------------
*/
@ -1095,6 +1095,16 @@ PQmblen(const unsigned char *s, int encoding)
return (pg_encoding_mblen(encoding, s));
}
/*
* 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.
*/