Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite8c3205

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 parent1bc2d54 commite8c3205

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(constunsignedchar*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(constunsignedchar*mbstr)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp