File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 1919
2020#include " iceberg/util/url_encoder.h"
2121
22+ #include < locale>
23+
2224namespace iceberg {
2325
2426namespace {
@@ -36,9 +38,10 @@ std::string UrlEncoder::Encode(std::string_view str_to_encode) {
3638 std::string result;
3739 result.reserve (str_to_encode.size () * 3 /* Worst case: every char becomes %XX */ );
3840
39- for (unsigned char c : str_to_encode) {
40- if (std::isalnum (c) || c == ' -' || c == ' _' || c == ' .' || c == ' ~' ) {
41- result += static_cast <char >(c);
41+ for (char c : str_to_encode) {
42+ if (std::isalnum (c, std::locale::classic ()) || c == ' -' || c == ' _' || c == ' .' ||
43+ c == ' ~' ) {
44+ result += c;
4245 } else {
4346 result += ' %' ;
4447 result += hex_chars[c >> 4 ];
Original file line number Diff line number Diff line change 2323#include < string_view>
2424
2525#include " iceberg/iceberg_export.h"
26- #include " iceberg/result.h"
2726
2827// / \file iceberg/util/url_encoder.h
2928// / \brief URL encoding and decoding.
You can’t perform that action at this time.
0 commit comments