diff --git a/Release/src/http/client/http_client_winhttp.cpp b/Release/src/http/client/http_client_winhttp.cpp index 20bee17785..48470fda49 100644 --- a/Release/src/http/client/http_client_winhttp.cpp +++ b/Release/src/http/client/http_client_winhttp.cpp @@ -1226,7 +1226,7 @@ class winhttp_client : public _http_client_communicator const auto size = CertNameToStr(X509_ASN_ENCODING, pcert_name, CERT_X500_NAME_STR, nullptr, 0); auto nameString = std::unique_ptr(new utility::string_t::value_type [size]); - CertNameToStr(X509_ASN_ENCODING, pcert_name, CERT_X500_NAME_STR, nameString.get(), size); + CertNameToStrW(X509_ASN_ENCODING, pcert_name, CERT_X500_NAME_STR, nameString.get(), size); supported_ca.push_back(utility::conversions::to_string_t(nameString.get())); } diff --git a/Release/src/json/json_parsing.cpp b/Release/src/json/json_parsing.cpp index 78d56d1665..fd0583c382 100644 --- a/Release/src/json/json_parsing.cpp +++ b/Release/src/json/json_parsing.cpp @@ -142,7 +142,7 @@ class JSON_Parser virtual bool CompleteComment(Token &token); virtual bool CompleteStringLiteral(Token &token); - int convert_unicode_to_code_point(Token &token); + int convert_unicode_to_code_point(); bool handle_unescape_char(Token &token); private: @@ -693,6 +693,14 @@ bool JSON_StringParser::CompleteComment(typename JSON_Parser return true; } +void convert_append_unicode_code_unit(JSON_Parser::Token &token, utf16string value) +{ + token.string_val.append(value); +} +void convert_append_unicode_code_unit(JSON_Parser::Token &token, utf16string value) +{ + token.string_val.append(::utility::conversions::utf16_to_utf8(value)); +} void convert_append_unicode_code_unit(JSON_Parser::Token &token, utf16char value) { token.string_val.push_back(value); @@ -704,7 +712,7 @@ void convert_append_unicode_code_unit(JSON_Parser::Token &token, utf16char } template -int JSON_Parser::convert_unicode_to_code_point(Token &token) +int JSON_Parser::convert_unicode_to_code_point() { // A four-hexdigit Unicode character. // Transform into a 16 bit code point. @@ -769,7 +777,7 @@ inline bool JSON_Parser::handle_unescape_char(Token &token) return true; case 'u': { - int decoded = convert_unicode_to_code_point(token); + int decoded = convert_unicode_to_code_point(); if (decoded == -1) { return false; @@ -780,11 +788,11 @@ inline bool JSON_Parser::handle_unescape_char(Token &token) { // skip escape character NextCharacter(); NextCharacter(); - int decoded2 = convert_unicode_to_code_point(token); + int decoded2 = convert_unicode_to_code_point(); utf16string compoundUTF16 = { static_cast(decoded), static_cast(decoded2) }; - token.string_val.append(::utility::conversions::utf16_to_utf8(compoundUTF16)); + convert_append_unicode_code_unit(token, compoundUTF16); } else {