YYCCommonplace/src/EncodingHelper.hpp

28 lines
858 B
C++
Raw Normal View History

2024-04-25 10:38:13 +08:00
#pragma once
#include "YYCCInternal.hpp"
#if YYCC_OS == YYCC_OS_WINDOWS
2024-04-26 15:37:28 +08:00
#include <string>
2024-04-25 10:38:13 +08:00
#include "WinImportPrefix.hpp"
#include <Windows.h>
#include "WinImportSuffix.hpp"
namespace YYCC::EncodingHelper {
2024-04-29 15:48:10 +08:00
bool WcharToChar(const wchar_t* src, u8string& dest, UINT codepage);
bool WcharToUTF8(const wchar_t* src, u8string& dest);
u8string WcharToChar(const wchar_t* src, UINT codepage);
u8string WcharToUTF8(const wchar_t* src);
bool CharToWchar(const u8char* src, std::wstring& dest, UINT codepage);
bool UTF8ToWchar(const u8char* src, std::wstring& dest);
std::wstring CharToWchar(const u8char* src, UINT codepage);
std::wstring UTF8ToWchar(const u8char* src);
bool CharToChar(const u8char* src, u8string& dest, UINT src_codepage, UINT dest_codepage);
u8string CharToChar(const u8char* src, UINT src_codepage, UINT dest_codepage);
2024-04-25 10:38:13 +08:00
}
2024-04-26 15:37:28 +08:00
#endif