MCPcopy Create free account
hub / github.com/apache/arrow / ComputeSqlWCharSize

Function ComputeSqlWCharSize

cpp/src/arrow/flight/sql/odbc/odbc_impl/encoding.cc:44–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42} // namespace
43
44void ComputeSqlWCharSize() {
45 std::unique_lock<std::mutex> lock(SqlWCharSizeMutex);
46 if (SqlWCharSize != 0) return; // double-checked locking
47
48 const char* env_p = std::getenv("WCHAR_ENCODING");
49 if (env_p) {
50 if (boost::iequals(env_p, "UTF-16")) {
51 SqlWCharSize = sizeof(char16_t);
52 return;
53 } else if (boost::iequals(env_p, "UTF-32")) {
54 SqlWCharSize = sizeof(char32_t);
55 return;
56 }
57 }
58
59 SqlWCharSize = IsUsingIODBC() ? sizeof(char32_t) : sizeof(char16_t);
60}
61#endif
62
63} // namespace arrow::flight::sql::odbc

Callers 1

GetSqlWCharSizeFunction · 0.85

Calls 1

IsUsingIODBCFunction · 0.85

Tested by

no test coverage detected