@@ -67,7 +67,6 @@ void CreateError(const Token &tk, const utility::string_t &message)
6767 throw web::json::json_exception (os.str ().c_str ());
6868}
6969
70-
7170template <typename CharType>
7271class JSON_Parser
7372{
@@ -195,7 +194,7 @@ class JSON_StreamParser : public JSON_Parser<CharType>
195194 {
196195public:
197196 JSON_StreamParser (std::basic_istream<CharType> &stream)
198- : m_streambuf(stream.rdbuf())
197+ : m_streambuf(stream.rdbuf()), m_locale( " C " )
199198 {
200199 }
201200
@@ -206,14 +205,16 @@ class JSON_StreamParser : public JSON_Parser<CharType>
206205
207206private:
208207 typename std::basic_streambuf<CharType, std::char_traits<CharType>>* m_streambuf;
208+
209+ ::utility::details::thread_local_locale m_locale;
209210};
210211
211212template <typename CharType>
212213class JSON_StringParser : public JSON_Parser <CharType>
213214{
214215public:
215- JSON_StringParser (const std::basic_string<CharType>& string)
216- : m_position(&string[0 ])
216+ JSON_StringParser (const std::basic_string<CharType>& string)
217+ : m_position(&string[0 ]), m_locale( " C " )
217218 {
218219 m_startpos = m_position;
219220 m_endpos = m_position+string.size ();
@@ -232,6 +233,7 @@ class JSON_StringParser : public JSON_Parser<CharType>
232233 const CharType* m_position;
233234 const CharType* m_startpos;
234235 const CharType* m_endpos;
236+ ::utility::details::thread_local_locale m_locale;
235237};
236238
237239
0 commit comments