* encoding_encode_strinfo * * convert a given stringinfo 'strinfo' to the appropriate (pre-defined) * encoding (encoding will only be done if really needed). */
| 223 | * encoding (encoding will only be done if really needed). |
| 224 | */ |
| 225 | static void |
| 226 | encoding_encode_strinfo(FunctionCallInfo fcinfo, StringInfo strinfo, bool is_import) |
| 227 | { |
| 228 | char *cvt = NULL; |
| 229 | |
| 230 | FORMATTER_ENCODE_STRING(fcinfo, strinfo->data, strinfo->len, cvt, is_import); |
| 231 | |
| 232 | if (cvt != NULL && cvt != strinfo->data) |
| 233 | { |
| 234 | /* transfer converted data back to strinfo */ |
| 235 | resetStringInfo(strinfo); |
| 236 | appendStringInfoString(strinfo, cvt); |
| 237 | pfree(cvt); |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | |
| 242 | static char* |
no test coverage detected