1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +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

@ -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)