MCPcopy Create free account
hub / github.com/apache/cloudberry / pg_encoding_verifymbstr

Function pg_encoding_verifymbstr

src/common/wchar.c:2014–2020  ·  view source on GitHub ↗

* 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.) */

Source from the content-addressed store, hash-verified

2012 * (See comments above for full details of the mbverifystr API.)
2013 */
2014int
2015pg_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

Callers 5

CopyConvertBufFunction · 0.85
test_one_vector_escapeFunction · 0.85
test_enc_setupFunction · 0.85
test_enc_conversionFunction · 0.85
PQescapeInternalFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_one_vector_escapeFunction · 0.68
test_enc_setupFunction · 0.68
test_enc_conversionFunction · 0.68