Change strings conversion function

This commit is contained in:
Mikhail Lobotskiy
2024-03-15 18:16:58 +04:00
parent be0c6b13e7
commit b2c8696d1d

View File

@ -1,7 +1,7 @@
#include "json_values.h"
#include <locale>
#include <codecvt>
// for string <=> wstring conversion
#include "../../common/File.h"
namespace NSJSON
{
@ -119,8 +119,7 @@ namespace NSJSON
if (m_type == ptStringW)
{
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
return std::string(converter.to_bytes(m_wstring));
return U_TO_UTF8(m_wstring);
}
#ifdef JSON_DEBUG
@ -136,8 +135,7 @@ namespace NSJSON
if (m_type == ptStringA)
{
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
return std::wstring(converter.from_bytes(m_string));
return UTF8_TO_U(m_string);
}
#ifdef JSON_DEBUG