#include <codecvt> // 해당 헤더 추가
#include <string>
#include <wstring>
void main()
{
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> convert;
// wstring -> string
string layerName = convert.to_bytes(layerTag->c_str());
// string -> wstring
wstring layerName = convert.from_bytes(layerTag->c_str());
}
ㅊ
'프로그래밍 > CPP' 카테고리의 다른 글
엔진에 ENGINE_DLL까지 붙혔는데도 불안정한 형식이라면서 클래스 참조가 안되는 이유 (0) | 2023.04.08 |
---|---|
json 파일에서 string을 읽어와서 동적 char 배열에 추가시 주의점 (0) | 2023.04.02 |
구조체 안에 string을 선언 시 주의점 (0) | 2023.03.24 |
memcpy시 주의할 점 (0) | 2023.03.23 |
rapidjson 사용법 정리 (0) | 2023.03.22 |