PostgreSQL Source Code
git master
|
Go to the source code of this file.
Data Structures | |
struct | pg_enc2name |
struct | pg_wchar_tbl |
struct | pg_mb_radix_tree |
struct | pg_utf_to_local_combined |
struct | pg_local_to_utf_combined |
Macros | |
#define | MAX_MULTIBYTE_CHAR_LEN 4 |
#define | SS2 0x8e /* single shift 2 (JIS0201) */ |
#define | SS3 0x8f /* single shift 3 (JIS0212) */ |
#define | ISSJISHEAD(c) (((c) >= 0x81 && (c) <= 0x9f) || ((c) >= 0xe0 && (c) <= 0xfc)) |
#define | ISSJISTAIL(c) (((c) >= 0x40 && (c) <= 0x7e) || ((c) >= 0x80 && (c) <= 0xfc)) |
#define | LC_ISO8859_1 0x81 /* ISO8859 Latin 1 */ |
#define | LC_ISO8859_2 0x82 /* ISO8859 Latin 2 */ |
#define | LC_ISO8859_3 0x83 /* ISO8859 Latin 3 */ |
#define | LC_ISO8859_4 0x84 /* ISO8859 Latin 4 */ |
#define | LC_TIS620 0x85 /* Thai (not supported yet) */ |
#define | LC_ISO8859_7 0x86 /* Greek (not supported yet) */ |
#define | LC_ISO8859_6 0x87 /* Arabic (not supported yet) */ |
#define | LC_ISO8859_8 0x88 /* Hebrew (not supported yet) */ |
#define | LC_JISX0201K 0x89 /* Japanese 1 byte kana */ |
#define | LC_JISX0201R 0x8a /* Japanese 1 byte Roman */ |
#define | LC_KOI8_R 0x8b /* Cyrillic KOI8-R */ |
#define | LC_ISO8859_5 0x8c /* ISO8859 Cyrillic */ |
#define | LC_ISO8859_9 0x8d /* ISO8859 Latin 5 (not supported yet) */ |
#define | LC_ISO8859_15 0x8e /* ISO8859 Latin 15 (not supported yet) */ |
#define | IS_LC1(c) ((unsigned char)(c) >= 0x81 && (unsigned char)(c) <= 0x8d) |
#define | LC_JISX0208_1978 0x90 /* Japanese Kanji, old JIS (not supported) */ |
#define | LC_GB2312_80 0x91 /* Chinese */ |
#define | LC_JISX0208 0x92 /* Japanese Kanji (JIS X 0208) */ |
#define | LC_KS5601 0x93 /* Korean */ |
#define | LC_JISX0212 0x94 /* Japanese Kanji (JIS X 0212) */ |
#define | LC_CNS11643_1 0x95 /* CNS 11643-1992 Plane 1 */ |
#define | LC_CNS11643_2 0x96 /* CNS 11643-1992 Plane 2 */ |
#define | LC_JISX0213_1 |
#define | LC_BIG5_1 |
#define | LC_BIG5_2 |
#define | IS_LC2(c) ((unsigned char)(c) >= 0x90 && (unsigned char)(c) <= 0x99) |
#define | LCPRV1_A 0x9a |
#define | LCPRV1_B 0x9b |
#define | IS_LCPRV1(c) ((unsigned char)(c) == LCPRV1_A || (unsigned char)(c) == LCPRV1_B) |
#define | IS_LCPRV1_A_RANGE(c) ((unsigned char)(c) >= 0xa0 && (unsigned char)(c) <= 0xdf) |
#define | IS_LCPRV1_B_RANGE(c) ((unsigned char)(c) >= 0xe0 && (unsigned char)(c) <= 0xef) |
#define | LCPRV2_A 0x9c |
#define | LCPRV2_B 0x9d |
#define | IS_LCPRV2(c) ((unsigned char)(c) == LCPRV2_A || (unsigned char)(c) == LCPRV2_B) |
#define | IS_LCPRV2_A_RANGE(c) ((unsigned char)(c) >= 0xf0 && (unsigned char)(c) <= 0xf4) |
#define | IS_LCPRV2_B_RANGE(c) ((unsigned char)(c) >= 0xf5 && (unsigned char)(c) <= 0xfe) |
#define | LC_SISHENG |
#define | LC_IPA |
#define | LC_VISCII_LOWER |
#define | LC_VISCII_UPPER |
#define | LC_ARABIC_DIGIT 0xa4 /* Arabic digit (not supported) */ |
#define | LC_ARABIC_1_COLUMN 0xa5 /* Arabic 1-column (not supported) */ |
#define | LC_ASCII_RIGHT_TO_LEFT |
#define | LC_LAO |
#define | LC_ARABIC_2_COLUMN 0xa8 /* Arabic 1-column (not supported) */ |
#define | LC_INDIAN_1_COLUMN |
#define | LC_TIBETAN_1_COLUMN |
#define | LC_UNICODE_SUBSET_2 |
#define | LC_UNICODE_SUBSET_3 |
#define | LC_UNICODE_SUBSET |
#define | LC_ETHIOPIC 0xf5 /* Ethiopic characters (not supported) */ |
#define | LC_CNS11643_3 0xf6 /* CNS 11643-1992 Plane 3 */ |
#define | LC_CNS11643_4 0xf7 /* CNS 11643-1992 Plane 4 */ |
#define | LC_CNS11643_5 0xf8 /* CNS 11643-1992 Plane 5 */ |
#define | LC_CNS11643_6 0xf9 /* CNS 11643-1992 Plane 6 */ |
#define | LC_CNS11643_7 0xfa /* CNS 11643-1992 Plane 7 */ |
#define | LC_INDIAN_2_COLUMN |
#define | LC_TIBETAN 0xfc /* Tibetan (not supported) */ |
#define | PG_ENCODING_BE_LAST PG_KOI8U |
#define | PG_VALID_BE_ENCODING(_enc) ((_enc) >= 0 && (_enc) <= PG_ENCODING_BE_LAST) |
#define | PG_ENCODING_IS_CLIENT_ONLY(_enc) ((_enc) > PG_ENCODING_BE_LAST && (_enc) < _PG_LAST_ENCODING_) |
#define | PG_VALID_ENCODING(_enc) ((_enc) >= 0 && (_enc) < _PG_LAST_ENCODING_) |
#define | PG_VALID_FE_ENCODING(_enc) PG_VALID_ENCODING(_enc) |
#define | MAX_CONVERSION_GROWTH 4 |
#define | MAX_CONVERSION_INPUT_LENGTH 16 |
#define | MAX_UNICODE_EQUIVALENT_STRING 16 |
#define | CHECK_ENCODING_CONVERSION_ARGS(srcencoding, destencoding) |
#define | pg_char_to_encoding pg_char_to_encoding_private |
#define | pg_encoding_to_char pg_encoding_to_char_private |
#define | pg_valid_server_encoding pg_valid_server_encoding_private |
#define | pg_valid_server_encoding_id pg_valid_server_encoding_id_private |
#define | pg_utf_mblen pg_utf_mblen_private |
Typedefs | |
typedef unsigned int | pg_wchar |
typedef enum pg_enc | pg_enc |
typedef struct pg_enc2name | pg_enc2name |
typedef int(* | mb2wchar_with_len_converter) (const unsigned char *from, pg_wchar *to, int len) |
typedef int(* | wchar2mb_with_len_converter) (const pg_wchar *from, unsigned char *to, int len) |
typedef int(* | mblen_converter) (const unsigned char *mbstr) |
typedef int(* | mbdisplaylen_converter) (const unsigned char *mbstr) |
typedef bool(* | mbcharacter_incrementer) (unsigned char *mbstr, int len) |
typedef int(* | mbchar_verifier) (const unsigned char *mbstr, int len) |
typedef int(* | mbstr_verifier) (const unsigned char *mbstr, int len) |
typedef uint32(* | utf_local_conversion_func) (uint32 code) |
Enumerations | |
enum | pg_enc { PG_SQL_ASCII = 0 , PG_EUC_JP , PG_EUC_CN , PG_EUC_KR , PG_EUC_TW , PG_EUC_JIS_2004 , PG_UTF8 , PG_MULE_INTERNAL , PG_LATIN1 , PG_LATIN2 , PG_LATIN3 , PG_LATIN4 , PG_LATIN5 , PG_LATIN6 , PG_LATIN7 , PG_LATIN8 , PG_LATIN9 , PG_LATIN10 , PG_WIN1256 , PG_WIN1258 , PG_WIN866 , PG_WIN874 , PG_KOI8R , PG_WIN1251 , PG_WIN1252 , PG_ISO_8859_5 , PG_ISO_8859_6 , PG_ISO_8859_7 , PG_ISO_8859_8 , PG_WIN1250 , PG_WIN1253 , PG_WIN1254 , PG_WIN1255 , PG_WIN1257 , PG_KOI8U , PG_SJIS , PG_BIG5 , PG_GBK , PG_UHC , PG_GB18030 , PG_JOHAB , PG_SHIFT_JIS_2004 , _PG_LAST_ENCODING_ } |
Functions | |
static bool | is_valid_unicode_codepoint (pg_wchar c) |
static bool | is_utf16_surrogate_first (pg_wchar c) |
static bool | is_utf16_surrogate_second (pg_wchar c) |
static pg_wchar | surrogate_pair_to_codepoint (pg_wchar first, pg_wchar second) |
static pg_wchar | utf8_to_unicode (const unsigned char *c) |
static unsigned char * | unicode_to_utf8 (pg_wchar c, unsigned char *utf8string) |
static int | unicode_utf8len (pg_wchar c) |
int | pg_char_to_encoding (const char *name) |
const char * | pg_encoding_to_char (int encoding) |
int | pg_valid_server_encoding_id (int encoding) |
int | pg_encoding_mblen (int encoding, const char *mbstr) |
int | pg_encoding_mblen_bounded (int encoding, const char *mbstr) |
int | pg_encoding_dsplen (int encoding, const char *mbstr) |
int | pg_encoding_verifymbchar (int encoding, const char *mbstr, int len) |
int | pg_encoding_verifymbstr (int encoding, const char *mbstr, int len) |
int | pg_encoding_max_length (int encoding) |
int | pg_valid_client_encoding (const char *name) |
int | pg_valid_server_encoding (const char *name) |
bool | is_encoding_supported_by_icu (int encoding) |
const char * | get_encoding_name_for_icu (int encoding) |
bool | pg_utf8_islegal (const unsigned char *source, int length) |
int | pg_utf_mblen (const unsigned char *s) |
int | pg_mule_mblen (const unsigned char *s) |
int | pg_mb2wchar (const char *from, pg_wchar *to) |
int | pg_mb2wchar_with_len (const char *from, pg_wchar *to, int len) |
int | pg_encoding_mb2wchar_with_len (int encoding, const char *from, pg_wchar *to, int len) |
int | pg_wchar2mb (const pg_wchar *from, char *to) |
int | pg_wchar2mb_with_len (const pg_wchar *from, char *to, int len) |
int | pg_encoding_wchar2mb_with_len (int encoding, const pg_wchar *from, char *to, int len) |
int | pg_char_and_wchar_strcmp (const char *s1, const pg_wchar *s2) |
int | pg_wchar_strncmp (const pg_wchar *s1, const pg_wchar *s2, size_t n) |
int | pg_char_and_wchar_strncmp (const char *s1, const pg_wchar *s2, size_t n) |
size_t | pg_wchar_strlen (const pg_wchar *str) |
int | pg_mblen (const char *mbstr) |
int | pg_dsplen (const char *mbstr) |
int | pg_mbstrlen (const char *mbstr) |
int | pg_mbstrlen_with_len (const char *mbstr, int limit) |
int | pg_mbcliplen (const char *mbstr, int len, int limit) |
int | pg_encoding_mbcliplen (int encoding, const char *mbstr, int len, int limit) |
int | pg_mbcharcliplen (const char *mbstr, int len, int limit) |
int | pg_database_encoding_max_length (void) |
mbcharacter_incrementer | pg_database_encoding_character_incrementer (void) |
int | PrepareClientEncoding (int encoding) |
int | SetClientEncoding (int encoding) |
void | InitializeClientEncoding (void) |
int | pg_get_client_encoding (void) |
const char * | pg_get_client_encoding_name (void) |
void | SetDatabaseEncoding (int encoding) |
int | GetDatabaseEncoding (void) |
const char * | GetDatabaseEncodingName (void) |
void | SetMessageEncoding (int encoding) |
int | GetMessageEncoding (void) |
unsigned char * | pg_do_encoding_conversion (unsigned char *src, int len, int src_encoding, int dest_encoding) |
int | pg_do_encoding_conversion_buf (Oid proc, int src_encoding, int dest_encoding, unsigned char *src, int srclen, unsigned char *dest, int destlen, bool noError) |
char * | pg_client_to_server (const char *s, int len) |
char * | pg_server_to_client (const char *s, int len) |
char * | pg_any_to_server (const char *s, int len, int encoding) |
char * | pg_server_to_any (const char *s, int len, int encoding) |
void | pg_unicode_to_server (pg_wchar c, unsigned char *s) |
bool | pg_unicode_to_server_noerror (pg_wchar c, unsigned char *s) |
unsigned short | BIG5toCNS (unsigned short big5, unsigned char *lc) |
unsigned short | CNStoBIG5 (unsigned short cns, unsigned char lc) |
int | UtfToLocal (const unsigned char *utf, int len, unsigned char *iso, const pg_mb_radix_tree *map, const pg_utf_to_local_combined *cmap, int cmapsize, utf_local_conversion_func conv_func, int encoding, bool noError) |
int | LocalToUtf (const unsigned char *iso, int len, unsigned char *utf, const pg_mb_radix_tree *map, const pg_local_to_utf_combined *cmap, int cmapsize, utf_local_conversion_func conv_func, int encoding, bool noError) |
bool | pg_verifymbstr (const char *mbstr, int len, bool noError) |
bool | pg_verify_mbstr (int encoding, const char *mbstr, int len, bool noError) |
int | pg_verify_mbstr_len (int encoding, const char *mbstr, int len, bool noError) |
void | check_encoding_conversion_args (int src_encoding, int dest_encoding, int len, int expected_src_encoding, int expected_dest_encoding) |
void | report_invalid_encoding (int encoding, const char *mbstr, int len) pg_attribute_noreturn() |
void | report_untranslatable_char (int src_encoding, int dest_encoding, const char *mbstr, int len) pg_attribute_noreturn() |
int | local2local (const unsigned char *l, unsigned char *p, int len, int src_encoding, int dest_encoding, const unsigned char *tab, bool noError) |
int | latin2mic (const unsigned char *l, unsigned char *p, int len, int lc, int encoding, bool noError) |
int | mic2latin (const unsigned char *mic, unsigned char *p, int len, int lc, int encoding, bool noError) |
int | latin2mic_with_table (const unsigned char *l, unsigned char *p, int len, int lc, int encoding, const unsigned char *tab, bool noError) |
int | mic2latin_with_table (const unsigned char *mic, unsigned char *p, int len, int lc, int encoding, const unsigned char *tab, bool noError) |
Variables | |
PGDLLIMPORT const pg_enc2name | pg_enc2name_tbl [] |
PGDLLIMPORT const char * | pg_enc2gettext_tbl [] |
PGDLLIMPORT const pg_wchar_tbl | pg_wchar_table [] |
#define CHECK_ENCODING_CONVERSION_ARGS | ( | srcencoding, | |
destencoding | |||
) |
Definition at line 507 of file pg_wchar.h.
Definition at line 126 of file pg_wchar.h.
Definition at line 144 of file pg_wchar.h.
Definition at line 152 of file pg_wchar.h.
Definition at line 153 of file pg_wchar.h.
Definition at line 155 of file pg_wchar.h.
Definition at line 164 of file pg_wchar.h.
Definition at line 165 of file pg_wchar.h.
Definition at line 167 of file pg_wchar.h.
Definition at line 44 of file pg_wchar.h.
Definition at line 45 of file pg_wchar.h.
#define LC_ARABIC_1_COLUMN 0xa5 /* Arabic 1-column (not supported) */ |
Definition at line 178 of file pg_wchar.h.
#define LC_ARABIC_2_COLUMN 0xa8 /* Arabic 1-column (not supported) */ |
Definition at line 181 of file pg_wchar.h.
#define LC_ARABIC_DIGIT 0xa4 /* Arabic digit (not supported) */ |
Definition at line 177 of file pg_wchar.h.
#define LC_ASCII_RIGHT_TO_LEFT |
Definition at line 179 of file pg_wchar.h.
#define LC_BIG5_1 |
Definition at line 140 of file pg_wchar.h.
#define LC_BIG5_2 |
Definition at line 141 of file pg_wchar.h.
#define LC_CNS11643_1 0x95 /* CNS 11643-1992 Plane 1 */ |
Definition at line 137 of file pg_wchar.h.
#define LC_CNS11643_2 0x96 /* CNS 11643-1992 Plane 2 */ |
Definition at line 138 of file pg_wchar.h.
#define LC_CNS11643_3 0xf6 /* CNS 11643-1992 Plane 3 */ |
Definition at line 192 of file pg_wchar.h.
#define LC_CNS11643_4 0xf7 /* CNS 11643-1992 Plane 4 */ |
Definition at line 193 of file pg_wchar.h.
#define LC_CNS11643_5 0xf8 /* CNS 11643-1992 Plane 5 */ |
Definition at line 194 of file pg_wchar.h.
#define LC_CNS11643_6 0xf9 /* CNS 11643-1992 Plane 6 */ |
Definition at line 195 of file pg_wchar.h.
#define LC_CNS11643_7 0xfa /* CNS 11643-1992 Plane 7 */ |
Definition at line 196 of file pg_wchar.h.
#define LC_ETHIOPIC 0xf5 /* Ethiopic characters (not supported) */ |
Definition at line 191 of file pg_wchar.h.
#define LC_GB2312_80 0x91 /* Chinese */ |
Definition at line 133 of file pg_wchar.h.
#define LC_INDIAN_1_COLUMN |
Definition at line 186 of file pg_wchar.h.
#define LC_INDIAN_2_COLUMN |
Definition at line 197 of file pg_wchar.h.
#define LC_IPA |
Definition at line 174 of file pg_wchar.h.
#define LC_ISO8859_1 0x81 /* ISO8859 Latin 1 */ |
Definition at line 105 of file pg_wchar.h.
#define LC_ISO8859_15 0x8e /* ISO8859 Latin 15 (not supported yet) */ |
Definition at line 122 of file pg_wchar.h.
#define LC_ISO8859_2 0x82 /* ISO8859 Latin 2 */ |
Definition at line 106 of file pg_wchar.h.
#define LC_ISO8859_3 0x83 /* ISO8859 Latin 3 */ |
Definition at line 107 of file pg_wchar.h.
#define LC_ISO8859_4 0x84 /* ISO8859 Latin 4 */ |
Definition at line 108 of file pg_wchar.h.
#define LC_ISO8859_5 0x8c /* ISO8859 Cyrillic */ |
Definition at line 120 of file pg_wchar.h.
#define LC_ISO8859_6 0x87 /* Arabic (not supported yet) */ |
Definition at line 111 of file pg_wchar.h.
#define LC_ISO8859_7 0x86 /* Greek (not supported yet) */ |
Definition at line 110 of file pg_wchar.h.
#define LC_ISO8859_8 0x88 /* Hebrew (not supported yet) */ |
Definition at line 112 of file pg_wchar.h.
#define LC_ISO8859_9 0x8d /* ISO8859 Latin 5 (not supported yet) */ |
Definition at line 121 of file pg_wchar.h.
#define LC_JISX0201K 0x89 /* Japanese 1 byte kana */ |
Definition at line 113 of file pg_wchar.h.
#define LC_JISX0201R 0x8a /* Japanese 1 byte Roman */ |
Definition at line 114 of file pg_wchar.h.
#define LC_JISX0208 0x92 /* Japanese Kanji (JIS X 0208) */ |
Definition at line 134 of file pg_wchar.h.
#define LC_JISX0208_1978 0x90 /* Japanese Kanji, old JIS (not supported) */ |
Definition at line 132 of file pg_wchar.h.
#define LC_JISX0212 0x94 /* Japanese Kanji (JIS X 0212) */ |
Definition at line 136 of file pg_wchar.h.
#define LC_JISX0213_1 |
Definition at line 139 of file pg_wchar.h.
#define LC_KOI8_R 0x8b /* Cyrillic KOI8-R */ |
Definition at line 119 of file pg_wchar.h.
#define LC_KS5601 0x93 /* Korean */ |
Definition at line 135 of file pg_wchar.h.
#define LC_LAO |
Definition at line 180 of file pg_wchar.h.
#define LC_SISHENG |
Definition at line 173 of file pg_wchar.h.
#define LC_TIBETAN 0xfc /* Tibetan (not supported) */ |
Definition at line 198 of file pg_wchar.h.
#define LC_TIBETAN_1_COLUMN |
Definition at line 187 of file pg_wchar.h.
#define LC_TIS620 0x85 /* Thai (not supported yet) */ |
Definition at line 109 of file pg_wchar.h.
#define LC_UNICODE_SUBSET |
Definition at line 190 of file pg_wchar.h.
#define LC_UNICODE_SUBSET_2 |
Definition at line 188 of file pg_wchar.h.
#define LC_UNICODE_SUBSET_3 |
Definition at line 189 of file pg_wchar.h.
#define LC_VISCII_LOWER |
Definition at line 175 of file pg_wchar.h.
#define LC_VISCII_UPPER |
Definition at line 176 of file pg_wchar.h.
#define LCPRV1_A 0x9a |
Definition at line 150 of file pg_wchar.h.
#define LCPRV1_B 0x9b |
Definition at line 151 of file pg_wchar.h.
#define LCPRV2_A 0x9c |
Definition at line 162 of file pg_wchar.h.
#define LCPRV2_B 0x9d |
Definition at line 163 of file pg_wchar.h.
#define MAX_CONVERSION_GROWTH 4 |
Definition at line 302 of file pg_wchar.h.
#define MAX_CONVERSION_INPUT_LENGTH 16 |
Definition at line 320 of file pg_wchar.h.
#define MAX_MULTIBYTE_CHAR_LEN 4 |
Definition at line 33 of file pg_wchar.h.
#define MAX_UNICODE_EQUIVALENT_STRING 16 |
Definition at line 329 of file pg_wchar.h.
#define pg_char_to_encoding pg_char_to_encoding_private |
Definition at line 629 of file pg_wchar.h.
#define PG_ENCODING_BE_LAST PG_KOI8U |
Definition at line 275 of file pg_wchar.h.
#define PG_ENCODING_IS_CLIENT_ONLY | ( | _enc | ) | ((_enc) > PG_ENCODING_BE_LAST && (_enc) < _PG_LAST_ENCODING_) |
Definition at line 284 of file pg_wchar.h.
#define pg_encoding_to_char pg_encoding_to_char_private |
Definition at line 630 of file pg_wchar.h.
#define pg_utf_mblen pg_utf_mblen_private |
Definition at line 633 of file pg_wchar.h.
#define PG_VALID_BE_ENCODING | ( | _enc | ) | ((_enc) >= 0 && (_enc) <= PG_ENCODING_BE_LAST) |
Definition at line 281 of file pg_wchar.h.
#define PG_VALID_ENCODING | ( | _enc | ) | ((_enc) >= 0 && (_enc) < _PG_LAST_ENCODING_) |
Definition at line 287 of file pg_wchar.h.
#define PG_VALID_FE_ENCODING | ( | _enc | ) | PG_VALID_ENCODING(_enc) |
Definition at line 291 of file pg_wchar.h.
#define pg_valid_server_encoding pg_valid_server_encoding_private |
Definition at line 631 of file pg_wchar.h.
#define pg_valid_server_encoding_id pg_valid_server_encoding_id_private |
Definition at line 632 of file pg_wchar.h.
#define SS2 0x8e /* single shift 2 (JIS0201) */ |
Definition at line 38 of file pg_wchar.h.
#define SS3 0x8f /* single shift 3 (JIS0212) */ |
Definition at line 39 of file pg_wchar.h.
Definition at line 358 of file pg_wchar.h.
typedef int(* mbchar_verifier) (const unsigned char *mbstr, int len) |
Definition at line 372 of file pg_wchar.h.
Definition at line 370 of file pg_wchar.h.
typedef int(* mbdisplaylen_converter) (const unsigned char *mbstr) |
Definition at line 368 of file pg_wchar.h.
typedef int(* mblen_converter) (const unsigned char *mbstr) |
Definition at line 366 of file pg_wchar.h.
typedef int(* mbstr_verifier) (const unsigned char *mbstr, int len) |
Definition at line 374 of file pg_wchar.h.
typedef struct pg_enc2name pg_enc2name |
typedef unsigned int pg_wchar |
Definition at line 28 of file pg_wchar.h.
Definition at line 499 of file pg_wchar.h.
Definition at line 362 of file pg_wchar.h.
enum pg_enc |
Definition at line 224 of file pg_wchar.h.
unsigned short BIG5toCNS | ( | unsigned short | big5, |
unsigned char * | lc | ||
) |
Definition at line 292 of file big5.c.
References b1c4, b2c3, big5Level1ToCnsPlane1, big5Level2ToCnsPlane2, BinarySearchRange(), i, LC_CNS11643_1, LC_CNS11643_2, LC_CNS11643_3, and LC_CNS11643_4.
Referenced by big52euc_tw(), and big52mic().
void check_encoding_conversion_args | ( | int | src_encoding, |
int | dest_encoding, | ||
int | len, | ||
int | expected_src_encoding, | ||
int | expected_dest_encoding | ||
) |
Definition at line 1669 of file mbutils.c.
References elog, ERROR, len, name, pg_enc2name_tbl, and PG_VALID_ENCODING.
unsigned short CNStoBIG5 | ( | unsigned short | cns, |
unsigned char | lc | ||
) |
Definition at line 345 of file big5.c.
References b1c4, b2c3, BinarySearchRange(), cnsPlane1ToBig5Level1, cnsPlane2ToBig5Level2, i, LC_CNS11643_1, LC_CNS11643_2, LC_CNS11643_3, and LC_CNS11643_4.
Referenced by euc_tw2big5(), and mic2big5().
const char* get_encoding_name_for_icu | ( | int | encoding | ) |
Definition at line 472 of file encnames.c.
References encoding, pg_enc2icu_tbl, and PG_VALID_BE_ENCODING.
int GetDatabaseEncoding | ( | void | ) |
Definition at line 1261 of file mbutils.c.
References DatabaseEncoding, and pg_enc2name::encoding.
Referenced by ascii(), BeginCopyFrom(), BeginCopyTo(), char2wchar(), chr(), CollationCreate(), CollationGetCollid(), compareStrings(), convert_from_utf8(), convert_to_utf8(), CopyConversionError(), CopyConvertBuf(), create_pg_locale(), cstr2sv(), dblink_connect(), dblink_get_conn(), DefineCollation(), Generic_Text_IC_like(), GenericMatchText(), get_collation_oid(), get_json_object_as_hash(), InitializeClientEncoding(), IsThereCollationInNamespace(), json_recv(), jsonb_from_cstring(), locate_stem_module(), LogicalOutputWrite(), makeJsonLexContext(), p_isspecial(), ParallelWorkerMain(), pg_database_encoding_character_incrementer(), pg_database_encoding_max_length(), pg_generic_charinc(), pg_perm_setlocale(), pg_set_regex_collation(), pg_unicode_to_server(), pg_unicode_to_server_noerror(), pg_verifymbstr(), pgss_store(), PLyUnicode_Bytes(), populate_array_json(), PrepareClientEncoding(), read_extension_script_file(), SetClientEncoding(), str_initcap(), str_tolower(), str_toupper(), strncoll_libc(), sv2cstr(), text_position_setup(), to_ascii_default(), type_maximum_size(), unicode_assigned(), unicode_norm_form_from_string(), wchar2char(), xml_in(), xml_is_document(), xmlparse(), and xmltotext_with_options().
const char* GetDatabaseEncodingName | ( | void | ) |
Definition at line 1267 of file mbutils.c.
References DatabaseEncoding, and pg_enc2name::name.
Referenced by check_client_encoding(), CheckMyDatabase(), connect_pg_server(), dblink_connect(), dblink_get_conn(), get_collation_oid(), InitializeClientEncoding(), IsThereCollationInNamespace(), json_errdetail(), libpqrcv_connect(), locate_stem_module(), pg_unicode_to_server(), ProcessConfigFileInternal(), and regcollationin().
int GetMessageEncoding | ( | void | ) |
void InitializeClientEncoding | ( | void | ) |
Definition at line 281 of file mbutils.c.
References Assert, backend_startup_complete, ereport, errcode(), errmsg(), FATAL, FindDefaultConversionProc(), fmgr_info_cxt(), GetDatabaseEncoding(), GetDatabaseEncodingName(), IsTransactionState(), MemoryContextAlloc(), name, OidIsValid, pending_client_encoding, pg_enc2name_tbl, PG_SQL_ASCII, PG_UTF8, PrepareClientEncoding(), SetClientEncoding(), TopMemoryContext, and Utf8ToServerConvProc.
Referenced by InitPostgres().
bool is_encoding_supported_by_icu | ( | int | encoding | ) |
Definition at line 461 of file encnames.c.
References encoding, pg_enc2icu_tbl, and PG_VALID_BE_ENCODING.
Referenced by check_icu_locale_encoding(), createdb(), DefineCollation(), and lookup_collation().
Definition at line 525 of file pg_wchar.h.
Referenced by json_lex_string(), str_udeescape(), and unistr().
Definition at line 531 of file pg_wchar.h.
Referenced by json_lex_string(), str_udeescape(), and unistr().
Definition at line 519 of file pg_wchar.h.
Referenced by check_unicode_value(), pg_unicode_to_server(), pg_unicode_to_server_noerror(), and unistr().
int latin2mic | ( | const unsigned char * | l, |
unsigned char * | p, | ||
int | len, | ||
int | lc, | ||
int | encoding, | ||
bool | noError | ||
) |
Definition at line 89 of file conv.c.
References encoding, IS_HIGHBIT_SET, len, report_invalid_encoding(), and start.
Referenced by koi8r_to_mic(), latin1_to_mic(), latin2_to_mic(), latin3_to_mic(), and latin4_to_mic().
int latin2mic_with_table | ( | const unsigned char * | l, |
unsigned char * | p, | ||
int | len, | ||
int | lc, | ||
int | encoding, | ||
const unsigned char * | tab, | ||
bool | noError | ||
) |
Definition at line 194 of file conv.c.
References encoding, HIGHBIT, IS_HIGHBIT_SET, len, PG_MULE_INTERNAL, report_invalid_encoding(), report_untranslatable_char(), and start.
Referenced by iso_to_mic(), win1250_to_mic(), win1251_to_mic(), and win866_to_mic().
int local2local | ( | const unsigned char * | l, |
unsigned char * | p, | ||
int | len, | ||
int | src_encoding, | ||
int | dest_encoding, | ||
const unsigned char * | tab, | ||
bool | noError | ||
) |
Definition at line 33 of file conv.c.
References HIGHBIT, IS_HIGHBIT_SET, len, report_invalid_encoding(), report_untranslatable_char(), and start.
Referenced by iso_to_koi8r(), iso_to_win1251(), iso_to_win866(), koi8r_to_iso(), koi8r_to_win1251(), koi8r_to_win866(), latin2_to_win1250(), win1250_to_latin2(), win1251_to_iso(), win1251_to_koi8r(), win1251_to_win866(), win866_to_iso(), win866_to_koi8r(), and win866_to_win1251().
int LocalToUtf | ( | const unsigned char * | iso, |
int | len, | ||
unsigned char * | utf, | ||
const pg_mb_radix_tree * | map, | ||
const pg_local_to_utf_combined * | cmap, | ||
int | cmapsize, | ||
utf_local_conversion_func | conv_func, | ||
int | encoding, | ||
bool | noError | ||
) |
Definition at line 717 of file conv.c.
References compare4(), elog, encoding, ereport, errcode(), errmsg(), ERROR, IS_HIGHBIT_SET, len, pg_encoding_verifymbchar(), pg_mb_radix_conv(), PG_UTF8, PG_VALID_ENCODING, report_invalid_encoding(), report_untranslatable_char(), start, store_coded_char(), pg_local_to_utf_combined::utf1, and pg_local_to_utf_combined::utf2.
Referenced by big5_to_utf8(), euc_cn_to_utf8(), euc_jis_2004_to_utf8(), euc_jp_to_utf8(), euc_kr_to_utf8(), euc_tw_to_utf8(), gb18030_to_utf8(), gbk_to_utf8(), iso8859_to_utf8(), johab_to_utf8(), koi8r_to_utf8(), koi8u_to_utf8(), shift_jis_2004_to_utf8(), sjis_to_utf8(), uhc_to_utf8(), and win_to_utf8().
int mic2latin | ( | const unsigned char * | mic, |
unsigned char * | p, | ||
int | len, | ||
int | lc, | ||
int | encoding, | ||
bool | noError | ||
) |
Definition at line 127 of file conv.c.
References encoding, IS_HIGHBIT_SET, len, PG_MULE_INTERNAL, pg_mule_mblen(), report_invalid_encoding(), report_untranslatable_char(), and start.
Referenced by mic_to_koi8r(), mic_to_latin1(), mic_to_latin2(), mic_to_latin3(), and mic_to_latin4().
int mic2latin_with_table | ( | const unsigned char * | mic, |
unsigned char * | p, | ||
int | len, | ||
int | lc, | ||
int | encoding, | ||
const unsigned char * | tab, | ||
bool | noError | ||
) |
Definition at line 257 of file conv.c.
References encoding, HIGHBIT, IS_HIGHBIT_SET, len, PG_MULE_INTERNAL, pg_mule_mblen(), report_invalid_encoding(), report_untranslatable_char(), and start.
Referenced by mic_to_iso(), mic_to_win1250(), mic_to_win1251(), and mic_to_win866().
char* pg_any_to_server | ( | const char * | s, |
int | len, | ||
int | encoding | ||
) |
Definition at line 676 of file mbutils.c.
References ClientEncoding, DatabaseEncoding, encoding, pg_enc2name::encoding, ereport, errcode(), errmsg(), ERROR, i, IS_HIGHBIT_SET, len, name, perform_default_encoding_conversion(), pg_do_encoding_conversion(), pg_enc2name_tbl, PG_SQL_ASCII, PG_VALID_BE_ENCODING, pg_verify_mbstr(), and unconstify.
Referenced by ASN1_STRING_to_text(), cache_single_string(), db_encoding_convert(), dsnowball_lexize(), pg_client_to_server(), pg_stat_statements_internal(), pgp_armor_headers(), PLyUnicode_Bytes(), read_extension_script_file(), tsearch_readline(), utf_u2e(), X509_NAME_to_cstring(), and xml_recv().
int pg_char_and_wchar_strcmp | ( | const char * | s1, |
const pg_wchar * | s2 | ||
) |
int pg_char_and_wchar_strncmp | ( | const char * | s1, |
const pg_wchar * | s2, | ||
size_t | n | ||
) |
int pg_char_to_encoding | ( | const char * | name | ) |
Definition at line 549 of file encnames.c.
char* pg_client_to_server | ( | const char * | s, |
int | len | ||
) |
Definition at line 660 of file mbutils.c.
References ClientEncoding, pg_enc2name::encoding, len, and pg_any_to_server().
Referenced by exec_bind_message(), parse_fcall_arguments(), pq_getmsgstring(), and pq_getmsgtext().
mbcharacter_incrementer pg_database_encoding_character_incrementer | ( | void | ) |
Definition at line 1523 of file mbutils.c.
References GetDatabaseEncoding(), PG_EUC_JP, pg_eucjp_increment(), pg_generic_charinc(), PG_UTF8, and pg_utf8_increment().
Referenced by make_greater_string().
int pg_database_encoding_max_length | ( | void | ) |
Definition at line 1546 of file mbutils.c.
References GetDatabaseEncoding(), pg_wchar_tbl::maxmblen, and pg_wchar_table.
Referenced by bpcharlen(), charlen_to_bytelen(), dotrim(), downcase_identifier(), gbt_bpchar_consistent(), gbt_text_compress(), gbt_text_consistent(), generate_trgm_only(), Generic_Text_IC_like(), GenericMatchText(), infix(), init_tsvector_parser(), like_escape(), like_fixed_prefix(), lowerstr_with_len(), lpad(), pg_mbcharcliplen(), pg_mbstrlen(), pg_mbstrlen_with_len(), protect_out_of_mem(), regexp_fixed_prefix(), rpad(), setup_regexp_matches(), setup_test_matches(), show_trgm(), str_initcap(), str_tolower(), str_toupper(), text_length(), text_position_setup(), text_reverse(), text_substring(), TParserInit(), translate(), and tsvectorout().
unsigned char* pg_do_encoding_conversion | ( | unsigned char * | src, |
int | len, | ||
int | src_encoding, | ||
int | dest_encoding | ||
) |
Definition at line 356 of file mbutils.c.
References BoolGetDatum(), CStringGetDatum(), CurrentMemoryContext, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, FindDefaultConversionProc(), Int32GetDatum(), IsTransactionState(), len, MAX_CONVERSION_GROWTH, MaxAllocHugeSize, MaxAllocSize, MemoryContextAllocHuge(), OidFunctionCall6, OidIsValid, pg_encoding_to_char, PG_SQL_ASCII, pg_verify_mbstr(), and repalloc().
Referenced by convert_charset(), pg_any_to_server(), pg_convert(), and pg_server_to_any().
int pg_do_encoding_conversion_buf | ( | Oid | proc, |
int | src_encoding, | ||
int | dest_encoding, | ||
unsigned char * | src, | ||
int | srclen, | ||
unsigned char * | dest, | ||
int | destlen, | ||
bool | noError | ||
) |
Definition at line 469 of file mbutils.c.
References BoolGetDatum(), CStringGetDatum(), DatumGetInt32(), generate_unaccent_rules::dest, Int32GetDatum(), MAX_CONVERSION_GROWTH, and OidFunctionCall6.
Referenced by CopyConversionError(), CopyConvertBuf(), and test_enc_conversion().
int pg_dsplen | ( | const char * | mbstr | ) |
Definition at line 1030 of file mbutils.c.
References DatabaseEncoding, pg_wchar_tbl::dsplen, pg_enc2name::encoding, and pg_wchar_table.
Referenced by p_isspecial().
int pg_encoding_dsplen | ( | int | encoding, |
const char * | mbstr | ||
) |
Definition at line 2090 of file wchar.c.
References encoding, PG_SQL_ASCII, PG_VALID_ENCODING, and pg_wchar_table.
Referenced by PQdsplen(), and reportErrorPosition().
int pg_encoding_max_length | ( | int | encoding | ) |
Definition at line 2127 of file wchar.c.
References Assert, encoding, pg_wchar_tbl::maxmblen, PG_VALID_ENCODING, and pg_wchar_table.
Referenced by ascii(), chr(), CopyConvertBuf(), pg_encoding_mbcliplen(), pg_verify_mbstr_len(), reportErrorPosition(), and type_maximum_size().
int pg_encoding_mb2wchar_with_len | ( | int | encoding, |
const char * | from, | ||
pg_wchar * | to, | ||
int | len | ||
) |
Definition at line 993 of file mbutils.c.
References encoding, len, pg_wchar_tbl::mb2wchar_with_len, and pg_wchar_table.
int pg_encoding_mbcliplen | ( | int | encoding, |
const char * | mbstr, | ||
int | len, | ||
int | limit | ||
) |
Definition at line 1093 of file mbutils.c.
References cliplen(), encoding, len, pg_wchar_tbl::mblen, pg_encoding_max_length(), and pg_wchar_table.
Referenced by pg_mbcliplen().
int pg_encoding_mblen | ( | int | encoding, |
const char * | mbstr | ||
) |
Definition at line 2069 of file wchar.c.
References encoding, PG_SQL_ASCII, PG_VALID_ENCODING, and pg_wchar_table.
Referenced by CopyAttributeOutCSV(), CopyAttributeOutText(), pg_encoding_mblen_bounded(), PQescapeInternal(), PQescapeStringInternal(), PQmblen(), PQmblenBounded(), report_invalid_encoding(), and report_untranslatable_char().
int pg_encoding_mblen_bounded | ( | int | encoding, |
const char * | mbstr | ||
) |
const char* pg_encoding_to_char | ( | int | encoding | ) |
Definition at line 587 of file encnames.c.
int pg_encoding_verifymbchar | ( | int | encoding, |
const char * | mbstr, | ||
int | len | ||
) |
Definition at line 2103 of file wchar.c.
References encoding, len, PG_SQL_ASCII, PG_VALID_ENCODING, and pg_wchar_table.
Referenced by big52euc_tw(), big52mic(), euc_jis_20042shift_jis_2004(), euc_jp2mic(), euc_jp2sjis(), euc_kr2mic(), euc_tw2big5(), euc_tw2mic(), LocalToUtf(), mic2big5(), mic2euc_jp(), mic2euc_kr(), mic2euc_tw(), mic2sjis(), shift_jis_20042euc_jis_2004(), and sjis2euc_jp().
int pg_encoding_verifymbstr | ( | int | encoding, |
const char * | mbstr, | ||
int | len | ||
) |
Definition at line 2116 of file wchar.c.
References encoding, len, PG_SQL_ASCII, PG_VALID_ENCODING, and pg_wchar_table.
Referenced by add_file_to_manifest(), CopyConvertBuf(), and test_enc_conversion().
int pg_encoding_wchar2mb_with_len | ( | int | encoding, |
const pg_wchar * | from, | ||
char * | to, | ||
int | len | ||
) |
Definition at line 1015 of file mbutils.c.
References encoding, len, pg_wchar_table, and pg_wchar_tbl::wchar2mb_with_len.
int pg_get_client_encoding | ( | void | ) |
Definition at line 336 of file mbutils.c.
References ClientEncoding, and pg_enc2name::encoding.
Referenced by BeginCopyFrom(), BeginCopyTo(), and xml_send().
const char* pg_get_client_encoding_name | ( | void | ) |
Definition at line 345 of file mbutils.c.
References ClientEncoding, and pg_enc2name::name.
int pg_mb2wchar | ( | const char * | from, |
pg_wchar * | to | ||
) |
Definition at line 979 of file mbutils.c.
References DatabaseEncoding, pg_enc2name::encoding, pg_wchar_tbl::mb2wchar_with_len, and pg_wchar_table.
int pg_mb2wchar_with_len | ( | const char * | from, |
pg_wchar * | to, | ||
int | len | ||
) |
Definition at line 986 of file mbutils.c.
References DatabaseEncoding, pg_enc2name::encoding, len, pg_wchar_tbl::mb2wchar_with_len, and pg_wchar_table.
Referenced by CheckAffix(), NIAddAffix(), RE_compile(), RE_compile_and_cache(), RE_execute(), regcomp_auth_token(), regexec_auth_token(), replace_text_regexp(), setup_regexp_matches(), setup_test_matches(), test_re_compile(), and TParserInit().
int pg_mbcharcliplen | ( | const char * | mbstr, |
int | len, | ||
int | limit | ||
) |
Definition at line 1125 of file mbutils.c.
References cliplen(), len, pg_database_encoding_max_length(), and pg_mblen().
Referenced by bpchar(), bpchar_input(), text_left(), text_right(), varchar(), and varchar_input().
int pg_mbcliplen | ( | const char * | mbstr, |
int | len, | ||
int | limit | ||
) |
Definition at line 1083 of file mbutils.c.
References DatabaseEncoding, pg_enc2name::encoding, len, and pg_encoding_mbcliplen().
Referenced by appendStringInfoStringQuoted(), bpchar_name(), ChooseIndexColumnNames(), CopyLimitPrintoutLength(), ExecBuildSlotPartitionKeyDescription(), ExecBuildSlotValueDescription(), make_colname_unique(), make_greater_string(), makeMultirangeTypeName(), makeObjectName(), MemoryContextStatsPrint(), nameconcatoid(), namein(), pgstat_clip_activity(), pgstat_report_appname(), PutMemoryContextsStatsTupleStore(), set_rtable_names(), text_name(), text_to_cstring_buffer(), and truncate_identifier().
int pg_mblen | ( | const char * | mbstr | ) |
Definition at line 1023 of file mbutils.c.
References DatabaseEncoding, pg_enc2name::encoding, pg_wchar_tbl::mblen, and pg_wchar_table.
Referenced by addCompoundAffixFlagValue(), bit_in(), charlen_to_bytelen(), DCH_from_char(), dotrim(), find_word(), findchar(), findchar2(), findwrd(), gbt_var_node_cp_len(), get_modifiers(), get_nextfield(), get_wildcard_part(), getlexeme(), getNextFlagFromString(), gettoken_query(), gettoken_query_standard(), gettoken_query_websearch(), gettoken_tsvector(), hex_decode_safe(), infix(), initTrie(), lpad(), make_trigrams(), map_sql_identifier_to_xml_name(), map_xml_name_to_sql_identifier(), match_prosrc_to_literal(), mb_strchr(), NIImportAffixes(), NIImportDictionary(), NIImportOOAffixes(), NUM_eat_non_data_chars(), NUM_processor(), parse_affentry(), parse_format(), parse_lquery(), parse_ltree(), parse_or_operator(), parse_re_flags(), parse_test_flags(), pg_base64_decode(), pg_mbcharcliplen(), pg_mbstrlen(), pg_mbstrlen_with_len(), prssyntaxerror(), readstoplist(), report_json_context(), rpad(), RS_compile(), RS_execute(), RS_isRegis(), similar_escape_internal(), split_text(), t_isalnum(), t_isalpha(), t_isdigit(), t_isprint(), t_isspace(), text_format(), text_position_next(), text_reverse(), text_substring(), text_to_bits(), textregexreplace(), thesaurusRead(), TParserGet(), translate(), ts_stat_sql(), tsvectorout(), unaccent_lexize(), varbit_in(), varstr_levenshtein(), and wchareq().
int pg_mbstrlen | ( | const char * | mbstr | ) |
Definition at line 1037 of file mbutils.c.
References len, pg_database_encoding_max_length(), and pg_mblen().
Referenced by NUM_processor(), and text_format_append_string().
int pg_mbstrlen_with_len | ( | const char * | mbstr, |
int | limit | ||
) |
Definition at line 1057 of file mbutils.c.
References len, pg_database_encoding_max_length(), and pg_mblen().
Referenced by bpchar(), bpchar_input(), bpcharlen(), executor_errposition(), lpad(), match_prosrc_to_query(), parser_errposition(), plpgsql_scanner_errposition(), rpad(), similar_escape_internal(), text_left(), text_length(), text_position_get_match_pos(), text_right(), text_substring(), unicode_assigned(), unicode_is_normalized(), unicode_normalize_func(), and varstr_levenshtein().
int pg_mule_mblen | ( | const unsigned char * | s | ) |
Definition at line 772 of file wchar.c.
References IS_LC1, IS_LC2, IS_LCPRV1, IS_LCPRV2, and len.
Referenced by mic2latin(), mic2latin_with_table(), and pg_mule_verifychar().
char* pg_server_to_any | ( | const char * | s, |
int | len, | ||
int | encoding | ||
) |
Definition at line 749 of file mbutils.c.
References ClientEncoding, DatabaseEncoding, encoding, pg_enc2name::encoding, len, perform_default_encoding_conversion(), pg_do_encoding_conversion(), PG_SQL_ASCII, pg_verify_mbstr(), and unconstify.
Referenced by compareStrings(), CopyAttributeOutCSV(), CopyAttributeOutText(), daitch_mokotoff(), DoCopyTo(), dsnowball_lexize(), hv_fetch_string(), hv_store_string(), pg_server_to_client(), PLyUnicode_FromStringAndSize(), and utf_e2u().
char* pg_server_to_client | ( | const char * | s, |
int | len | ||
) |
Definition at line 738 of file mbutils.c.
References ClientEncoding, pg_enc2name::encoding, len, and pg_server_to_any().
Referenced by pq_puttextmessage(), pq_sendcountedtext(), pq_sendstring(), pq_sendtext(), and pq_writestring().
void pg_unicode_to_server | ( | pg_wchar | c, |
unsigned char * | s | ||
) |
Definition at line 864 of file mbutils.c.
References BoolGetDatum(), CStringGetDatum(), ereport, errcode(), errmsg(), ERROR, FunctionCall6, GetDatabaseEncoding(), GetDatabaseEncodingName(), Int32GetDatum(), is_valid_unicode_codepoint(), MAX_MULTIBYTE_CHAR_LEN, name, pg_enc2name_tbl, PG_UTF8, pg_utf_mblen, unicode_to_utf8(), and Utf8ToServerConvProc.
Referenced by map_xml_name_to_sql_identifier(), str_udeescape(), and unistr().
Definition at line 926 of file mbutils.c.
References BoolGetDatum(), CStringGetDatum(), DatumGetInt32(), FunctionCall6, GetDatabaseEncoding(), Int32GetDatum(), is_valid_unicode_codepoint(), MAX_MULTIBYTE_CHAR_LEN, PG_UTF8, pg_utf_mblen, unicode_to_utf8(), and Utf8ToServerConvProc.
Referenced by json_lex_string().
bool pg_utf8_islegal | ( | const unsigned char * | source, |
int | length | ||
) |
Definition at line 1953 of file wchar.c.
Referenced by chr(), pg_utf8_string_len(), pg_utf8_verifychar(), utf8_to_iso8859_1(), and UtfToLocal().
int pg_utf_mblen | ( | const unsigned char * | s | ) |
Definition at line 517 of file wchar.c.
References len.
Referenced by pg_utf8_verifystr(), and pg_wchar2utf_with_len().
int pg_valid_client_encoding | ( | const char * | name | ) |
Definition at line 485 of file encnames.c.
References enc, name, pg_char_to_encoding(), and PG_VALID_FE_ENCODING.
Referenced by check_client_encoding().
int pg_valid_server_encoding | ( | const char * | name | ) |
Definition at line 499 of file encnames.c.
References enc, name, pg_char_to_encoding(), and PG_VALID_BE_ENCODING.
int pg_valid_server_encoding_id | ( | int | encoding | ) |
Definition at line 513 of file encnames.c.
Definition at line 1566 of file mbutils.c.
References Assert, encoding, len, pg_wchar_tbl::mbverifystr, PG_VALID_ENCODING, pg_wchar_table, and report_invalid_encoding().
Referenced by AddFileToBackupManifest(), LogicalOutputWrite(), pg_any_to_server(), pg_convert(), pg_do_encoding_conversion(), pg_server_to_any(), pg_verifymbstr(), and read_extension_script_file().
int pg_verify_mbstr_len | ( | int | encoding, |
const char * | mbstr, | ||
int | len, | ||
bool | noError | ||
) |
Definition at line 1597 of file mbutils.c.
References Assert, encoding, IS_HIGHBIT_SET, len, pg_wchar_tbl::mbverifychar, pg_encoding_max_length(), PG_VALID_ENCODING, pg_wchar_table, and report_invalid_encoding().
Referenced by length_in_encoding().
Definition at line 1556 of file mbutils.c.
References GetDatabaseEncoding(), len, and pg_verify_mbstr().
Referenced by char2wchar(), CopyReadAttributesText(), plperl_spi_exec(), plperl_spi_prepare(), plperl_spi_query(), PLy_cursor_query(), PLy_output(), PLy_spi_execute_query(), PLy_spi_prepare(), PLyObject_AsString(), read_text_file(), and spg_text_leaf_consistent().
int pg_wchar2mb | ( | const pg_wchar * | from, |
char * | to | ||
) |
Definition at line 1001 of file mbutils.c.
References DatabaseEncoding, pg_enc2name::encoding, pg_wchar_strlen(), pg_wchar_table, and pg_wchar_tbl::wchar2mb_with_len.
int pg_wchar2mb_with_len | ( | const pg_wchar * | from, |
char * | to, | ||
int | len | ||
) |
Definition at line 1008 of file mbutils.c.
References DatabaseEncoding, pg_enc2name::encoding, len, pg_wchar_table, and pg_wchar_tbl::wchar2mb_with_len.
Referenced by build_regexp_match_result(), build_regexp_split_result(), build_test_match_result(), convertPgWchar(), and regexp_fixed_prefix().
size_t pg_wchar_strlen | ( | const pg_wchar * | str | ) |
int PrepareClientEncoding | ( | int | encoding | ) |
Definition at line 110 of file mbutils.c.
References backend_startup_complete, ConvProcInfo::c_encoding, ConvProcList, encoding, FindDefaultConversionProc(), fmgr_info_cxt(), GetDatabaseEncoding(), IsTransactionState(), lcons(), lfirst, MemoryContextAlloc(), MemoryContextSwitchTo(), OidIsValid, PG_SQL_ASCII, PG_VALID_FE_ENCODING, ConvProcInfo::s_encoding, ConvProcInfo::to_client_info, ConvProcInfo::to_server_info, and TopMemoryContext.
Referenced by check_client_encoding(), and InitializeClientEncoding().
void report_invalid_encoding | ( | int | encoding, |
const char * | mbstr, | ||
int | len | ||
) |
Definition at line 1698 of file mbutils.c.
References buf, encoding, ereport, errcode(), errmsg(), ERROR, j, len, Min, name, pg_enc2name_tbl, pg_encoding_mblen(), and sprintf.
Referenced by big52euc_tw(), big52mic(), CopyConversionError(), euc_cn2mic(), euc_jis_20042shift_jis_2004(), euc_jp2mic(), euc_jp2sjis(), euc_kr2mic(), euc_tw2big5(), euc_tw2mic(), iso8859_1_to_utf8(), latin2mic(), latin2mic_with_table(), local2local(), LocalToUtf(), mic2big5(), mic2euc_cn(), mic2euc_jp(), mic2euc_kr(), mic2euc_tw(), mic2latin(), mic2latin_with_table(), mic2sjis(), pg_verify_mbstr(), pg_verify_mbstr_len(), shift_jis_20042euc_jis_2004(), sjis2euc_jp(), sjis2mic(), test_enc_conversion(), utf8_to_iso8859_1(), and UtfToLocal().
void report_untranslatable_char | ( | int | src_encoding, |
int | dest_encoding, | ||
const char * | mbstr, | ||
int | len | ||
) |
Definition at line 1730 of file mbutils.c.
References buf, ereport, errcode(), errmsg(), ERROR, j, len, Min, name, pg_enc2name_tbl, pg_encoding_mblen(), and sprintf.
Referenced by big52euc_tw(), big52mic(), euc_tw2big5(), latin2mic_with_table(), local2local(), LocalToUtf(), mic2big5(), mic2euc_cn(), mic2euc_jp(), mic2euc_kr(), mic2euc_tw(), mic2latin(), mic2latin_with_table(), mic2sjis(), utf8_to_iso8859_1(), and UtfToLocal().
int SetClientEncoding | ( | int | encoding | ) |
Definition at line 208 of file mbutils.c.
References backend_startup_complete, ConvProcInfo::c_encoding, ClientEncoding, ConvProcList, encoding, foreach_delete_current, GetDatabaseEncoding(), lfirst, pending_client_encoding, pfree(), pg_enc2name_tbl, PG_SQL_ASCII, PG_VALID_FE_ENCODING, ConvProcInfo::s_encoding, ConvProcInfo::to_client_info, ConvProcInfo::to_server_info, ToClientConvProc, and ToServerConvProc.
Referenced by assign_client_encoding(), InitializeClientEncoding(), and ParallelWorkerMain().
void SetDatabaseEncoding | ( | int | encoding | ) |
Definition at line 1161 of file mbutils.c.
References Assert, DatabaseEncoding, elog, encoding, pg_enc2name::encoding, ERROR, pg_enc2name_tbl, and PG_VALID_BE_ENCODING.
Referenced by CheckMyDatabase().
void SetMessageEncoding | ( | int | encoding | ) |
Definition at line 1171 of file mbutils.c.
References Assert, encoding, pg_enc2name::encoding, MessageEncoding, pg_enc2name_tbl, and PG_VALID_ENCODING.
Referenced by pg_perm_setlocale().
Definition at line 537 of file pg_wchar.h.
Referenced by json_lex_string(), str_udeescape(), and unistr().
|
inlinestatic |
Definition at line 575 of file pg_wchar.h.
Referenced by convert_case(), json_lex_string(), pg_saslprep(), pg_unicode_to_server(), pg_unicode_to_server_noerror(), pg_wchar2utf_with_len(), and unicode_normalize_func().
|
inlinestatic |
|
inlinestatic |
Definition at line 549 of file pg_wchar.h.
int UtfToLocal | ( | const unsigned char * | utf, |
int | len, | ||
unsigned char * | iso, | ||
const pg_mb_radix_tree * | map, | ||
const pg_utf_to_local_combined * | cmap, | ||
int | cmapsize, | ||
utf_local_conversion_func | conv_func, | ||
int | encoding, | ||
bool | noError | ||
) |
Definition at line 507 of file conv.c.
References pg_utf_to_local_combined::code, compare3(), elog, encoding, ereport, errcode(), errmsg(), ERROR, len, pg_mb_radix_conv(), PG_UTF8, pg_utf8_islegal(), pg_utf_mblen, PG_VALID_ENCODING, report_invalid_encoding(), report_untranslatable_char(), start, and store_coded_char().
Referenced by utf8_to_big5(), utf8_to_euc_cn(), utf8_to_euc_jis_2004(), utf8_to_euc_jp(), utf8_to_euc_kr(), utf8_to_euc_tw(), utf8_to_gb18030(), utf8_to_gbk(), utf8_to_iso8859(), utf8_to_johab(), utf8_to_koi8r(), utf8_to_koi8u(), utf8_to_shift_jis_2004(), utf8_to_sjis(), utf8_to_uhc(), and utf8_to_win().
|
extern |
Definition at line 360 of file encnames.c.
|
extern |
Definition at line 308 of file encnames.c.
Referenced by check_encoding_conversion_args(), InitializeClientEncoding(), pg_any_to_server(), pg_encoding_to_char(), pg_unicode_to_server(), report_invalid_encoding(), report_untranslatable_char(), SetClientEncoding(), SetDatabaseEncoding(), and SetMessageEncoding().
|
extern |
Definition at line 2015 of file wchar.c.
Referenced by pg_database_encoding_max_length(), pg_dsplen(), pg_encoding_dsplen(), pg_encoding_max_length(), pg_encoding_max_length_sql(), pg_encoding_mb2wchar_with_len(), pg_encoding_mbcliplen(), pg_encoding_mblen(), pg_encoding_verifymbchar(), pg_encoding_verifymbstr(), pg_encoding_wchar2mb_with_len(), pg_generic_charinc(), pg_mb2wchar(), pg_mb2wchar_with_len(), pg_mblen(), pg_verify_mbstr(), pg_verify_mbstr_len(), pg_wchar2mb(), and pg_wchar2mb_with_len().