22#pragma GCC diagnostic push
23#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
28 enum class charset_id : uint16_t {
54 constexpr charset_id wchar_t_charset = charset_id::utf16;
56 constexpr charset_id system_charset = charset_id::utf16;
58 constexpr charset_id system_charset = charset_id::system;
61 constexpr charset_id wchar_t_charset = charset_id::utf32;
62 constexpr charset_id system_charset = charset_id::system;
70 inline charset_id charset_from_name(_In_z_
const char* name)
73 bool operator()(_In_z_
const char* a, _In_z_
const char* b)
const
75 return stdex::stricmp(a, b) < 0;
78 static const std::map<const char*, charset_id, charset_less> charsets = {
79 {
"UNICODE-1-1-UTF-7", charset_id::utf7 },
80 {
"UTF-7", charset_id::utf7 },
81 {
"CSUNICODE11UTF7", charset_id::utf7 },
83 {
"UTF-8", charset_id::utf8 },
84 {
"UTF8", charset_id::utf8 },
86 {
"UTF-16", charset_id::utf16 },
87#if BYTE_ORDER == BIG_ENDIAN
88 {
"UTF-16BE", charset_id::utf16 },
90 {
"UTF-16LE", charset_id::utf16 },
93 {
"UTF-32", charset_id::utf32 },
94#if BYTE_ORDER == BIG_ENDIAN
95 {
"UTF-32BE", charset_id::utf32 },
97 {
"UTF-32LE", charset_id::utf32 },
100 {
"CP1250", charset_id::windows1250 },
101 {
"MS-EE", charset_id::windows1250 },
102 {
"WINDOWS-1250", charset_id::windows1250 },
104 {
"CP1251", charset_id::windows1251 },
105 {
"MS-CYRL", charset_id::windows1251 },
106 {
"WINDOWS-1251", charset_id::windows1251 },
108 {
"CP1252", charset_id::windows1252 },
109 {
"MS-ANSI", charset_id::windows1252 },
110 {
"WINDOWS-1252", charset_id::windows1252 },
112 if (
auto el = charsets.find(name); el != charsets.end())
114 return charset_id::system;
122 template <
class _Traits = std::
char_traits<
char>,
class _Alloc = std::allocator<
char>>
123 charset_id charset_from_name(_In_
const std::basic_string<char, _Traits, _Alloc>& name)
125 return charset_from_name(name.c_str());
131 template <
typename T_from,
typename T_to>
135 charset_id m_from, m_to;
143 m_from_wincp = to_encoding(from);
144 m_to_wincp = to_encoding(to);
146 m_handle = iconv_open(to_encoding(to), to_encoding(from));
147 if (m_handle == (iconv_t)-1)
148 throw std::system_error(errno, std::system_category(),
"iconv_open failed");
155 iconv_close(m_handle);
159 charset_id from_encoding()
const {
return m_from; }
160 charset_id to_encoding()
const {
return m_to; }
169 template <
class _Traits_to = std::
char_traits<T_to>,
class _Alloc_to = std::allocator<T_to>>
171 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
172 _In_reads_or_z_opt_(count_src)
const T_from* src, _In_
size_t count_src)
174 _Assume_(src || !count_src);
175 count_src = stdex::strnlen<T_from>(src, count_src);
176 if (!count_src) _Unlikely_
180 constexpr DWORD dwFlagsMBWC = MB_PRECOMPOSED;
181 constexpr DWORD dwFlagsWCMB = 0;
182 constexpr LPCCH lpDefaultChar = NULL;
185 if (m_from_wincp == m_to_wincp) _Unlikely_{
186 dst.append(
reinterpret_cast<const T_to*
>(src), count_src);
190#pragma warning(suppress: 4127)
191 if constexpr (
sizeof(T_from) ==
sizeof(
char) &&
sizeof(T_to) ==
sizeof(
wchar_t)) {
192 _Assume_(count_src < INT_MAX || count_src == SIZE_MAX);
195 WCHAR szStackBuffer[1024 /
sizeof(WCHAR)];
196#pragma warning(suppress: 6387)
197 int cch = MultiByteToWideChar(
static_cast<UINT
>(m_from_wincp), dwFlagsMBWC,
reinterpret_cast<LPCCH
>(src),
static_cast<int>(count_src), szStackBuffer, _countof(szStackBuffer));
200 dst.append(
reinterpret_cast<const T_to*
>(szStackBuffer), count_src != SIZE_MAX ? wcsnlen(szStackBuffer, cch) :
static_cast<size_t>(cch) - 1);
203 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
205 cch = MultiByteToWideChar(
static_cast<UINT
>(m_from_wincp), dwFlagsMBWC,
reinterpret_cast<LPCCH
>(src),
static_cast<int>(count_src), NULL, 0);
206 std::unique_ptr<WCHAR[]> szBuffer(
new WCHAR[cch]);
207 cch = MultiByteToWideChar(
static_cast<UINT
>(m_from_wincp), dwFlagsMBWC,
reinterpret_cast<LPCCH
>(src),
static_cast<int>(count_src), szBuffer.get(), cch);
208 dst.append(
reinterpret_cast<const T_to*
>(szBuffer.get()), count_src != SIZE_MAX ? wcsnlen(szBuffer.get(), cch) :
static_cast<size_t>(cch) - 1);
211 throw std::system_error(GetLastError(), std::system_category(),
"MultiByteToWideChar failed");
214#pragma warning(suppress: 4127)
215 if constexpr (
sizeof(T_from) ==
sizeof(
wchar_t) &&
sizeof(T_to) ==
sizeof(
char)) {
216 _Assume_(count_src < INT_MAX || count_src == SIZE_MAX);
219 CHAR szStackBuffer[1024 /
sizeof(CHAR)];
220#pragma warning(suppress: 6387)
221 int cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB,
reinterpret_cast<LPCWCH
>(src),
static_cast<int>(count_src), szStackBuffer, _countof(szStackBuffer), lpDefaultChar, NULL);
224 dst.append(
reinterpret_cast<const T_to*
>(szStackBuffer), count_src != SIZE_MAX ? strnlen(szStackBuffer, cch) :
static_cast<size_t>(cch) - 1);
227 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
229 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB,
reinterpret_cast<LPCWCH
>(src),
static_cast<int>(count_src), NULL, 0, lpDefaultChar, NULL);
230 std::unique_ptr<CHAR[]> szBuffer(
new CHAR[cch]);
231 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB,
reinterpret_cast<LPCWCH
>(src),
static_cast<int>(count_src), szBuffer.get(), cch, lpDefaultChar, NULL);
232 dst.append(
reinterpret_cast<const T_to*
>(szBuffer.get()), count_src != SIZE_MAX ? strnlen(szBuffer.get(), cch) :
static_cast<size_t>(cch) - 1);
235 throw std::system_error(GetLastError(), std::system_category(),
"WideCharToMultiByte failed");
238#pragma warning(suppress: 4127)
239 if constexpr (
sizeof(T_from) ==
sizeof(
char) &&
sizeof(T_to) ==
sizeof(
char)) {
240 _Assume_(count_src < INT_MAX || count_src == SIZE_MAX);
243 WCHAR szStackBufferMBWC[512 /
sizeof(WCHAR)];
244#pragma warning(suppress: 6387)
245 int cch = MultiByteToWideChar(
static_cast<UINT
>(m_from_wincp), dwFlagsMBWC,
reinterpret_cast<LPCCH
>(src),
static_cast<int>(count_src), szStackBufferMBWC, _countof(szStackBufferMBWC));
248 size_t count_inter = count_src != SIZE_MAX ? wcsnlen(szStackBufferMBWC, cch) :
static_cast<size_t>(cch) - 1;
249 _Assume_(count_inter < INT_MAX);
252 CHAR szStackBufferWCMB[512 /
sizeof(CHAR)];
253#pragma warning(suppress: 6387)
254 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB, szStackBufferMBWC,
static_cast<int>(count_inter), szStackBufferWCMB, _countof(szStackBufferWCMB), lpDefaultChar, NULL);
257 dst.append(
reinterpret_cast<const T_to*
>(szStackBufferWCMB), strnlen(szStackBufferWCMB, cch));
260 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
262 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB, szStackBufferMBWC,
static_cast<int>(count_inter), NULL, 0, lpDefaultChar, NULL);
263 std::unique_ptr<CHAR[]> szBufferWCMB(
new CHAR[cch]);
264 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB, szStackBufferMBWC,
static_cast<int>(count_inter), szBufferWCMB.get(), cch, lpDefaultChar, NULL);
265 dst.append(
reinterpret_cast<const T_to*
>(szBufferWCMB.get()), strnlen(szBufferWCMB.get(), cch));
268 throw std::system_error(GetLastError(), std::system_category(),
"WideCharToMultiByte failed");
270 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
272 cch = MultiByteToWideChar(
static_cast<UINT
>(m_from_wincp), dwFlagsMBWC,
reinterpret_cast<LPCCH
>(src),
static_cast<int>(count_src), NULL, 0);
273 std::unique_ptr<WCHAR[]> szBufferMBWC(
new WCHAR[cch]);
274 cch = MultiByteToWideChar(
static_cast<UINT
>(m_from_wincp), dwFlagsMBWC,
reinterpret_cast<LPCCH
>(src),
static_cast<int>(count_src), szBufferMBWC.get(), cch);
275 size_t count_inter = count_src != SIZE_MAX ? wcsnlen(szBufferMBWC.get(), cch) :
static_cast<size_t>(cch) - 1;
278 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB, szBufferMBWC.get(),
static_cast<int>(count_inter), NULL, 0, lpDefaultChar, NULL);
279 std::unique_ptr<CHAR[]> szBufferWCMB(
new CHAR[cch]);
280 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB, szBufferMBWC.get(),
static_cast<int>(count_inter), szBufferWCMB.get(), cch, lpDefaultChar, NULL);
281 dst.append(
reinterpret_cast<const T_to*
>(szBufferWCMB.get()), strnlen(szBufferWCMB.get(), cch));
284 throw std::system_error(GetLastError(), std::system_category(),
"MultiByteToWideChar failed");
287 dst.reserve(dst.size() + count_src);
288 T_to buf[1024 /
sizeof(T_to)];
289 size_t src_size = stdex::mul(
sizeof(T_from), count_src);
291 T_to* output = &buf[0];
292 size_t output_size =
sizeof(buf);
294 iconv(m_handle,
const_cast<char**
>(
reinterpret_cast<const char**
>(&src)), &src_size,
reinterpret_cast<char**
>(&output), &output_size);
295 dst.append(buf,
reinterpret_cast<T_to*
>(
reinterpret_cast<char*
>(buf) +
sizeof(buf) - output_size));
300 throw std::system_error(errno, std::system_category(),
"iconv failed");
311 template <
class _Traits_to = std::
char_traits<T_to>,
class _Alloc_to = std::allocator<T_to>>
313 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
314 _In_z_
const T_from* src)
316 strcat(dst, src, SIZE_MAX);
325 template <
class _Traits_to = std::
char_traits<T_to>,
class _Alloc_to = std::allocator<T_to>,
class _Traits_from = std::
char_traits<T_from>,
class _Alloc_from = std::allocator<T_from>>
327 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
328 _In_
const std::basic_string<T_from, _Traits_from, _Alloc_from>& src)
330 strcat(dst, src.data(), src.size());
340 template <
class _Traits_to = std::
char_traits<T_to>,
class _Alloc_to = std::allocator<T_to>>
342 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
343 _In_reads_or_z_opt_(count_src)
const T_from* src, _In_
size_t count_src)
346 strcat(dst, src, count_src);
355 template <
class _Traits_to = std::
char_traits<T_to>,
class _Alloc_to = std::allocator<T_to>>
357 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
358 _In_z_
const T_from* src)
360 strcpy(dst, src, SIZE_MAX);
369 template <
class _Traits_to = std::
char_traits<T_to>,
class _Alloc_to = std::allocator<T_to>,
class _Traits_from = std::
char_traits<T_from>,
class _Alloc_from = std::allocator<T_from>>
371 _Inout_ std::basic_string<T_to, _Traits_to, _Alloc_to>& dst,
372 _In_
const std::basic_string<T_from, _Traits_from, _Alloc_from>& src)
374 strcpy(dst, src.data(), src.size());
383 template <
class _Traits_to = std::
char_traits<T_to>,
class _Alloc_to = std::allocator<T_to>>
384 std::basic_string<T_to, _Traits_to, _Alloc_to>
convert(_In_reads_or_z_opt_(count_src)
const T_from* src, _In_
size_t count_src)
386 std::basic_string<T_to, _Traits_to, _Alloc_to> dst;
387 strcat(dst, src, count_src);
396 template <
class _Traits_to = std::
char_traits<T_to>,
class _Alloc_to = std::allocator<T_to>>
397 std::basic_string<T_to, _Traits_to, _Alloc_to>
convert(_In_z_
const T_from* src)
407 template <
class _Traits_to = std::
char_traits<T_to>,
class _Alloc_to = std::allocator<T_to>,
class _Traits_from = std::
char_traits<T_from>,
class _Alloc_from = std::allocator<T_from>>
408 std::basic_string<T_to, _Traits_to, _Alloc_to>
convert(_In_
const std::basic_string<T_from, _Traits_from, _Alloc_from>& src)
410 return convert(src.data(), src.size());
416 iconv(m_handle, NULL, NULL, NULL, NULL);
420 static charset_id system_charset()
423 return static_cast<charset_id
>(GetACP());
425 return charset_from_name(nl_langinfo(CODESET));
431 static UINT to_encoding(_In_ charset_id charset)
434 charset == charset_id::system ? GetACP() :
435 charset == charset_id::oem ? GetOEMCP() :
436 static_cast<UINT>(charset);
440 UINT m_from_wincp, m_to_wincp;
443 static const char* to_encoding(_In_ charset_id charset)
445 static const char*
const encodings[
static_cast<std::underlying_type_t<charset_id>
>(charset_id::_max)] = {
449#if BYTE_ORDER == BIG_ENDIAN
461 charset == charset_id::system ? nl_langinfo(CODESET) :
462 encodings[static_cast<std::underlying_type_t<charset_id>>(charset)];
481 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
484 _Inout_ std::wstring& dst,
485 _In_reads_or_z_opt_(count_src)
const char* src, _In_
size_t count_src,
486 _In_ charset_id charset = charset_id::system)
488 charset_encoder<char, wchar_t>(charset, wchar_t_charset).strcat(dst, src, count_src);
491 _Deprecated_(
"Use stdex::strcat")
492 inline
void str2wstr(
493 _Inout_ std::wstring& dst,
494 _In_reads_or_z_opt_(count_src) const
char* src, _In_
size_t count_src,
495 _In_ charset_id charset = charset_id::system)
497 strcat(dst, src, count_src, charset);
510 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
513 _Inout_ std::wstring& dst,
514 _In_
const std::string& src,
515 _In_ charset_id charset = charset_id::system)
517 strcat(dst, src.data(), src.size(), charset);
520 _Deprecated_(
"Use stdex::strcat")
521 inline
void str2wstr(
522 _Inout_ std::wstring& dst,
523 _In_ const std::
string& src,
524 _In_ charset_id charset = charset_id::system)
526 strcat(dst, src, charset);
540 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
543 _Inout_ std::wstring& dst,
544 _In_reads_or_z_opt_(count_src)
const char* src, _In_
size_t count_src,
545 _In_ charset_id charset = charset_id::system)
548 strcat(dst, src, count_src, charset);
561 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
564 _Inout_ std::wstring& dst,
565 _In_
const std::string& src,
566 _In_ charset_id charset = charset_id::system)
568 strcpy(dst, src.data(), src.size(), charset);
582 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
584 inline std::wstring str2wstr(
585 _In_z_
const char* src,
586 _In_ charset_id charset = charset_id::system)
589 strcat(dst, src, SIZE_MAX, charset);
605 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
607 inline std::wstring str2wstr(
608 _In_reads_or_z_opt_(count_src)
const char* src, _In_
size_t count_src,
609 _In_ charset_id charset = charset_id::system)
612 strcat(dst, src, count_src, charset);
627 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
629 inline std::wstring str2wstr(
630 _In_
const std::string& src,
631 _In_ charset_id charset = charset_id::system)
633 return str2wstr(src.c_str(), src.size(), charset);
647 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
650 _Inout_ std::string& dst,
651 _In_reads_or_z_opt_(count_src)
const wchar_t* src, _In_
size_t count_src,
652 _In_ charset_id charset = charset_id::system)
654 charset_encoder<wchar_t, char>(wchar_t_charset, charset).strcat(dst, src, count_src);
657 _Deprecated_(
"Use stdex::strcat")
658 inline
void wstr2str(
659 _Inout_ std::
string& dst,
660 _In_reads_or_z_opt_(count_src) const
wchar_t* src, _In_
size_t count_src,
661 _In_ charset_id charset = charset_id::system)
663 strcat(dst, src, count_src, charset);
676 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
679 _Inout_ std::string& dst,
680 _In_
const std::wstring& src,
681 _In_ charset_id charset = charset_id::system)
683 strcat(dst, src.c_str(), src.size(), charset);
686 _Deprecated_(
"Use stdex::strcat")
687 inline
void wstr2str(
688 _Inout_ std::
string& dst,
689 _In_ const std::wstring& src,
690 _In_ charset_id charset = charset_id::system)
692 strcat(dst, src, charset);
706 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
709 _Inout_ std::string& dst,
710 _In_reads_or_z_opt_(count_src)
const wchar_t* src, _In_
size_t count_src,
711 _In_ charset_id charset = charset_id::system)
714 strcat(dst, src, count_src, charset);
727 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
730 _Inout_ std::string& dst,
731 _In_
const std::wstring& src,
732 _In_ charset_id charset = charset_id::system)
734 strcpy(dst, src.data(), src.size(), charset);
748 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
750 inline std::string wstr2str(
751 _In_z_
const wchar_t* src,
752 _In_ charset_id charset = charset_id::system)
755 strcat(dst, src, SIZE_MAX, charset);
771 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
773 inline std::string wstr2str(
774 _In_reads_or_z_opt_(count_src)
const wchar_t* src, _In_
size_t count_src,
775 _In_ charset_id charset = charset_id::system)
778 strcat(dst, src, count_src, charset);
793 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
795 inline std::string wstr2str(
796 _In_
const std::wstring& src,
797 _In_ charset_id charset = charset_id::system)
799 return wstr2str(src.c_str(), src.size(), charset);
812 template <
class _Traits = std::
char_traits<
wchar_t>,
class _Alloc = std::allocator<
wchar_t>>
814 _Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst,
815 _In_reads_or_z_opt_(count_src)
const wchar_t* src, _In_
size_t count_src)
817 count_src = stdex::strnlen(src, count_src);
818 size_t count_dst = dst.size();
819 dst.resize(count_dst + count_src);
820 _Assume_(count_src + 1 < INT_MAX);
821#pragma warning(suppress: 6387)
822 int r = NormalizeString(NormalizationC, src,
static_cast<int>(count_src), dst.data() + count_dst,
static_cast<int>(count_src + 1));
824 dst.resize(count_dst + r);
826#pragma warning(suppress: 6387)
827 memcpy(dst.data() + count_dst, src, count_src *
sizeof(
wchar_t));
839 template <
size_t _Size,
class _Traits = std::
char_traits<
wchar_t>,
class _Alloc = std::allocator<
wchar_t>>
841 _Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst,
842 _In_
const wchar_t (&src)[_Size])
844 return normalizecat(dst, src, _Size);
855 template <
class _Traits_dst = std::
char_traits<
wchar_t>,
class _Alloc_dst = std::allocator<
wchar_t>,
class _Traits_src = std::
char_traits<
wchar_t>,
class _Alloc_src = std::allocator<
wchar_t>>
857 _Inout_ std::basic_string<wchar_t, _Traits_dst, _Alloc_dst>& dst,
858 _In_
const std::basic_string<wchar_t, _Traits_src, _Alloc_src>& src)
860 return normalizecat(dst, src.data(), src.size());
872 template <
class _Traits = std::
char_traits<
wchar_t>,
class _Alloc = std::allocator<
wchar_t>>
874 _Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst,
875 _In_reads_or_z_opt_(count_src)
const wchar_t* src, _In_
size_t count_src)
878 return normalizecat(dst, src, count_src);
889 template <
size_t _Size,
class _Traits = std::
char_traits<
wchar_t>,
class _Alloc = std::allocator<
wchar_t>>
891 _Inout_ std::basic_string<wchar_t, _Traits, _Alloc>& dst,
892 _In_
const wchar_t(&src)[_Size])
894 return normalize(dst, src, _Size);
905 template <
class _Traits_dst = std::
char_traits<
wchar_t>,
class _Alloc_dst = std::allocator<
wchar_t>,
class _Traits_src = std::
char_traits<
wchar_t>,
class _Alloc_src = std::allocator<
wchar_t>>
907 _Inout_ std::basic_string<wchar_t, _Traits_dst, _Alloc_dst>& dst,
908 _In_
const std::basic_string<wchar_t, _Traits_src, _Alloc_src>& src)
910 return normalize(dst, src.data(), src.size());
921 inline std::wstring normalize(_In_reads_or_z_opt_(count_src)
const wchar_t* src, _In_
size_t count_src)
924 normalizecat(dst, src, count_src);
935 template <
size_t _Size>
936 std::wstring normalize(_In_
const wchar_t(&src)[_Size])
939 normalizecat(dst, src, _Size);
950 template <
class _Traits = std::
char_traits<
wchar_t>,
class _Alloc = std::allocator<
wchar_t>>
951 std::wstring normalize(_In_
const std::basic_string<wchar_t, _Traits, _Alloc>& src)
954 normalizecat(dst, src.data(), src.size());
961#pragma GCC diagnostic pop
Encoding converter context.
Definition unicode.hpp:133
void strcpy(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, const std::basic_string< T_from, _Traits_from, _Alloc_from > &src)
Convert string.
Definition unicode.hpp:370
std::basic_string< T_to, _Traits_to, _Alloc_to > convert(const std::basic_string< T_from, _Traits_from, _Alloc_from > &src)
Return converted string.
Definition unicode.hpp:408
std::basic_string< T_to, _Traits_to, _Alloc_to > convert(const T_from *src)
Return converted string.
Definition unicode.hpp:397
void strcat(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, const std::basic_string< T_from, _Traits_from, _Alloc_from > &src)
Convert string and append to string.
Definition unicode.hpp:326
void strcpy(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, const T_from *src)
Convert string.
Definition unicode.hpp:356
void strcat(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, _In_reads_or_z_opt_(count_src) const T_from *src, size_t count_src)
Convert string and append to string.
Definition unicode.hpp:170
void strcat(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, const T_from *src)
Convert string and append to string.
Definition unicode.hpp:312
void strcpy(std::basic_string< T_to, _Traits_to, _Alloc_to > &dst, _In_reads_or_z_opt_(count_src) const T_from *src, size_t count_src)
Convert string.
Definition unicode.hpp:341
std::basic_string< T_to, _Traits_to, _Alloc_to > convert(_In_reads_or_z_opt_(count_src) const T_from *src, size_t count_src)
Return converted string.
Definition unicode.hpp:384