File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -76,16 +76,20 @@ template<>
7676struct Value2StringFormatter <uint8_t >
7777{
7878 template <typename T>
79- static std::basic_string <uint8_t > format (const T& val)
79+ static std::vector <uint8_t > format (const T& val)
8080 {
81- std::basic_ostringstream< char > ss;
81+ std::ostringstream ss;
8282 ss << val;
83- return reinterpret_cast <const uint8_t *>(ss.str ().c_str ());
83+ std::string s = ss.str ();
84+
85+ return std::vector<uint8_t >(reinterpret_cast <const uint8_t *>(s.data ()),
86+ reinterpret_cast <const uint8_t *>(s.data ()) + s.size ());
8487 }
8588
86- static std::basic_string <uint8_t > format (const utf16string& val)
89+ static std::vector <uint8_t > format (const utf16string& val)
8790 {
88- return format (utility::conversions::utf16_to_utf8 (val));
91+ std::string utf8 = utility::conversions::utf16_to_utf8 (val);
92+ return format (utf8);
8993 }
9094};
9195
You can’t perform that action at this time.
0 commit comments