* Returns the byte length of a multibyte character. * * Caution: when dealing with text that is not certainly valid in the * specified encoding, the result may exceed the actual remaining * string length. Callers that are not prepared to deal with that * should use pg_encoding_mblen_bounded() instead. */
| 1965 | * should use pg_encoding_mblen_bounded() instead. |
| 1966 | */ |
| 1967 | int |
| 1968 | pg_encoding_mblen(int encoding, const char *mbstr) |
| 1969 | { |
| 1970 | return (PG_VALID_ENCODING(encoding) ? |
| 1971 | pg_wchar_table[encoding].mblen((const unsigned char *) mbstr) : |
| 1972 | pg_wchar_table[PG_SQL_ASCII].mblen((const unsigned char *) mbstr)); |
| 1973 | } |
| 1974 | |
| 1975 | /* |
| 1976 | * Returns the byte length of a multibyte character; but not more than |
no outgoing calls