Skip to content

Commit e8c3205

Browse files
committed
Add PQmbdsplen() which returns the "display length" of a character.
Still some works needed: - UTF-8, MULE_INTERNAL always returns 1
1 parent 1bc2d54 commit e8c3205

File tree

6 files changed

+261
-45
lines changed

6 files changed

+261
-45
lines changed

src/backend/utils/mb/mbutils.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* (currently mule internal code (mic) is used)
55
* Tatsuo Ishii
66
*
7-
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.45 2003/11/29 19:52:02 pgsql Exp $
7+
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.46 2004/03/15 10:41:25 ishii Exp $
88
*/
99
#include "postgres.h"
1010

@@ -463,6 +463,13 @@ pg_mblen(const unsigned char *mbstr)
463463
return ((*pg_wchar_table[DatabaseEncoding->encoding].mblen) (mbstr));
464464
}
465465

466+
/* returns the display length of a multibyte word */
467+
int
468+
pg_dsplen(const unsigned char *mbstr)
469+
{
470+
return ((*pg_wchar_table[DatabaseEncoding->encoding].dsplen) (mbstr));
471+
}
472+
466473
/* returns the length (counted as a wchar) of a multibyte string */
467474
int
468475
pg_mbstrlen(const unsigned char *mbstr)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy