* Verify that a string is valid for the given encoding. * Returns the number of input bytes (<= len) that form a valid string. * (See comments above for full details of the mbverifystr API.) */
| 2012 | * (See comments above for full details of the mbverifystr API.) |
| 2013 | */ |
| 2014 | int |
| 2015 | pg_encoding_verifymbstr(int encoding, const char *mbstr, int len) |
| 2016 | { |
| 2017 | return (PG_VALID_ENCODING(encoding) ? |
| 2018 | pg_wchar_table[encoding].mbverifystr((const unsigned char *) mbstr, len) : |
| 2019 | pg_wchar_table[PG_SQL_ASCII].mbverifystr((const unsigned char *) mbstr, len)); |
| 2020 | } |
| 2021 | |
| 2022 | /* |
| 2023 | * fetch maximum length of a given encoding |
no outgoing calls