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

Commitbe629ab

Browse files
committed
Add pg_database_encoding_max_length() function.
1 parentfae50f8 commitbe629ab

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

‎src/backend/utils/mb/wchar.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* conversion functions between pg_wchar and multi-byte streams.
33
* Tatsuo Ishii
4-
* $Id: wchar.c,v 1.21 2001/09/21 15:27:38 tgl Exp $
4+
* $Id: wchar.c,v 1.22 2001/09/23 10:59:45 ishii Exp $
55
*
66
* WIN1250 client encoding updated by Pavel Behal
77
*
@@ -573,4 +573,14 @@ pg_verifymbstr(const unsigned char *mbstr, int len)
573573
}
574574
returnNULL;
575575
}
576+
577+
/*
578+
* fetch maximum length of a char encoding for the current database
579+
*/
580+
int
581+
pg_database_encoding_max_length(void)
582+
{
583+
returnpg_wchar_table[GetDatabaseEncoding()].maxmblen;
584+
}
585+
576586
#endif

‎src/include/mb/pg_wchar.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: pg_wchar.h,v 1.31 2001/09/21 15:27:38 tgl Exp $ */
1+
/* $Id: pg_wchar.h,v 1.32 2001/09/23 10:59:45 ishii Exp $ */
22

33
#ifndefPG_WCHAR_H
44
#definePG_WCHAR_H
@@ -226,6 +226,7 @@ extern intpg_mbstrlen_with_len(const unsigned char *, int);
226226
externintpg_mbcliplen(constunsignedchar*,int,int);
227227
externintpg_mbcharcliplen(constunsignedchar*,int,int);
228228
externintpg_encoding_max_length(int);
229+
externintpg_database_encoding_max_length(void);
229230

230231
externintpg_set_client_encoding(int);
231232
externintpg_get_client_encoding(void);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp