File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -76,16 +76,20 @@ template<>
76
76
struct Value2StringFormatter <uint8_t >
77
77
{
78
78
template <typename T>
79
- static std::basic_string <uint8_t > format (const T& val)
79
+ static std::vector <uint8_t > format (const T& val)
80
80
{
81
- std::basic_ostringstream< char > ss;
81
+ std::ostringstream ss;
82
82
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 ());
84
87
}
85
88
86
- static std::basic_string <uint8_t > format (const utf16string& val)
89
+ static std::vector <uint8_t > format (const utf16string& val)
87
90
{
88
- return format (utility::conversions::utf16_to_utf8 (val));
91
+ std::string utf8 = utility::conversions::utf16_to_utf8 (val);
92
+ return format (utf8);
89
93
}
90
94
};
91
95
You can’t perform that action at this time.
0 commit comments