* encoding_check_str * * for a given string 'str' of length 'len', check if performing * an encoding conversion will modify the original string or not * and return the answer. The input string remains *unmodified*. * While at it, the encoding converter also verifies that the * input string is valid in the client (external table) encoding. */
| 201 | * input string is valid in the client (external table) encoding. |
| 202 | */ |
| 203 | static bool |
| 204 | encoding_check_str(FunctionCallInfo fcinfo, char *str, int len, bool is_import) |
| 205 | { |
| 206 | char *cvt = NULL; |
| 207 | |
| 208 | FORMATTER_ENCODE_STRING(fcinfo, str, len, cvt, is_import); |
| 209 | |
| 210 | if (cvt != NULL && cvt != str) |
| 211 | { |
| 212 | pfree(cvt); |
| 213 | return true; |
| 214 | } |
| 215 | |
| 216 | return false; |
| 217 | } |
| 218 | |
| 219 | /* |
| 220 | * encoding_encode_strinfo |
no test coverage detected