File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -71,14 +71,14 @@ String StringViewToUtf8(v8_inspector::StringView view) {
7171
7272String fromDouble (double d) {
7373 std::ostringstream stream;
74- stream.imbue (std::locale ( " C " )); // Ignore locale
74+ stream.imbue (std::locale::classic ( )); // Ignore current locale
7575 stream << d;
7676 return stream.str ();
7777}
7878
7979double toDouble (const char * buffer, size_t length, bool * ok) {
8080 std::istringstream stream (std::string (buffer, length));
81- stream.imbue (std::locale ( " C " )); // Ignore locale
81+ stream.imbue (std::locale::classic ( )); // Ignore current locale
8282 double d;
8383 stream >> d;
8484 *ok = !stream.fail ();
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ std::string DoubleToCString(double v) {
9494 default :
9595 // This is a far less sophisticated version than the one used inside v8.
9696 std::ostringstream stream;
97- stream.imbue (std::locale ( " C " )); // Ignore locale
97+ stream.imbue (std::locale::classic ( )); // Ignore current locale
9898 stream << v;
9999 return stream.str ();
100100 }
Original file line number Diff line number Diff line change 2626
2727#include < cmath>
2828#include < cstring>
29+ #include < locale>
2930#include " util.h"
3031
3132// These are defined by <sys/byteorder.h> or <netinet/in.h> on some systems.
@@ -274,7 +275,7 @@ void SwapBytes64(char* data, size_t nbytes) {
274275}
275276
276277char ToLower (char c) {
277- return c >= ' A ' && c <= ' Z ' ? c + ( ' a ' - ' A ' ) : c ;
278+ return std::tolower (c, std::locale::classic ()) ;
278279}
279280
280281std::string ToLower (const std::string& in) {
@@ -285,7 +286,7 @@ std::string ToLower(const std::string& in) {
285286}
286287
287288char ToUpper (char c) {
288- return c >= ' a ' && c <= ' z ' ? (c - ' a ' ) + ' A ' : c ;
289+ return std::toupper (c, std::locale::classic ()) ;
289290}
290291
291292std::string ToUpper (const std::string& in) {
You can’t perform that action at this time.
0 commit comments