MCPcopy Create free account
hub / github.com/documentdb/documentdb / uchar_convert

Function uchar_convert

pg_documentdb_core/src/collation/collation.c:1048–1063  ·  view source on GitHub ↗

* Ported from pg_locale.c in Postgres 17: * See https://github.com/postgres/postgres/blob/REL_17_STABLE/src/backend/utils/adt/pg_locale.c#L2758 * Convert the given source string into a UChar string, stored in dest, and * return the length (in UChars). */

Source from the content-addressed store, hash-verified

1046 * return the length (in UChars).
1047 */
1048static int32_t
1049uchar_convert(UConverter *converter, UChar *dest, int32_t destlen,
1050 const char *src, int32_t srclen)
1051{
1052 UErrorCode status = U_ZERO_ERROR;
1053 int32_t ulen;
1054
1055 status = U_ZERO_ERROR;
1056 ulen = ucnv_toUChars(converter, dest, destlen, src, srclen, &status);
1057 if (U_FAILURE(status))
1058 {
1059 ereport(ERROR,
1060 (errmsg("%s failed: %s", "ucnv_toUChars", u_errorName(status))));
1061 }
1062 return ulen;
1063}
1064
1065
1066/*

Callers 1

icu_to_uchar_coreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected