mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Change strings conversion function
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
#include "json_values.h"
|
#include "json_values.h"
|
||||||
|
|
||||||
#include <locale>
|
// for string <=> wstring conversion
|
||||||
#include <codecvt>
|
#include "../../common/File.h"
|
||||||
|
|
||||||
namespace NSJSON
|
namespace NSJSON
|
||||||
{
|
{
|
||||||
@ -119,8 +119,7 @@ namespace NSJSON
|
|||||||
|
|
||||||
if (m_type == ptStringW)
|
if (m_type == ptStringW)
|
||||||
{
|
{
|
||||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
|
return U_TO_UTF8(m_wstring);
|
||||||
return std::string(converter.to_bytes(m_wstring));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JSON_DEBUG
|
#ifdef JSON_DEBUG
|
||||||
@ -136,8 +135,7 @@ namespace NSJSON
|
|||||||
|
|
||||||
if (m_type == ptStringA)
|
if (m_type == ptStringA)
|
||||||
{
|
{
|
||||||
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
|
return UTF8_TO_U(m_string);
|
||||||
return std::wstring(converter.from_bytes(m_string));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef JSON_DEBUG
|
#ifdef JSON_DEBUG
|
||||||
|
|||||||
Reference in New Issue
Block a user