alinaliBQ commented on code in PR #47771:
URL: https://github.com/apache/arrow/pull/47771#discussion_r2422226019


##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/system_trust_store.cc:
##########
@@ -31,18 +34,20 @@ std::string SystemTrustStore::GetNext() const {
   CryptBinaryToString(p_context_->pbCertEncoded, p_context_->cbCertEncoded,
                       CRYPT_STRING_BASE64HEADER, nullptr, &size);
 
-  std::string cert;
-  cert.resize(size);
+  std::wstring wcert;
+  wcert.resize(size);
   CryptBinaryToString(p_context_->pbCertEncoded, p_context_->cbCertEncoded,
-                      CRYPT_STRING_BASE64HEADER, &cert[0], &size);
-  cert.resize(size);
+                      CRYPT_STRING_BASE64HEADER, &wcert[0], &size);
+  wcert.resize(size);
+
+  std::string cert = arrow::util::WideStringToUTF8(wcert).ValueOr("");

Review Comment:
   Yes good catch, fixed



##########
cpp/src/arrow/flight/sql/odbc/CMakeLists.txt:
##########
@@ -33,6 +33,8 @@ else()
   set(ODBCINST odbcinst)
 endif()
 
+add_definitions(-DUNICODE=1)

Review Comment:
   Are you referring to 
[target_compile_definitions](https://cmake.org/cmake/help/latest/command/target_compile_definitions.html#target-compile-definitions)?
 Yes I can use that. I see the same effect can be achieved by passing 
`DEFINITIONS` to `add_arrow_lib` so I used this approach



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to