mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Change strings conversion function
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user