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:
@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user