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;
72 inline charset_id charset_from_name(_In_z_
const char* name)
75 bool operator()(_In_z_
const char* a, _In_z_
const char* b)
const
77 return stricmp(a, b) < 0;
80 static const std::map<const char*, charset_id, charset_less> charsets = {
81 {
"UNICODE-1-1-UTF-7", charset_id::utf7 },
82 {
"UTF-7", charset_id::utf7 },
83 {
"CSUNICODE11UTF7", charset_id::utf7 },
85 {
"UTF-8", charset_id::utf8 },
86 {
"UTF8", charset_id::utf8 },
88 {
"UTF-16", charset_id::utf16 },
89#if BYTE_ORDER == BIG_ENDIAN
90 {
"UTF-16BE", charset_id::utf16 },
92 {
"UTF-16LE", charset_id::utf16 },
95 {
"UTF-32", charset_id::utf32 },
96#if BYTE_ORDER == BIG_ENDIAN
97 {
"UTF-32BE", charset_id::utf32 },
99 {
"UTF-32LE", charset_id::utf32 },
102 {
"CP1250", charset_id::windows1250 },
103 {
"MS-EE", charset_id::windows1250 },
104 {
"WINDOWS-1250", charset_id::windows1250 },
106 {
"CP1251", charset_id::windows1251 },
107 {
"MS-CYRL", charset_id::windows1251 },
108 {
"WINDOWS-1251", charset_id::windows1251 },
110 {
"CP1252", charset_id::windows1252 },
111 {
"MS-ANSI", charset_id::windows1252 },
112 {
"WINDOWS-1252", charset_id::windows1252 },
114 if (
auto el = charsets.find(name); el != charsets.end())
116 return charset_id::system;
126 template <
class TR = std::
char_traits<
char>,
class AX = std::allocator<
char>>
127 charset_id charset_from_name(_In_
const std::basic_string<char, TR, AX>& name)
129 return charset_from_name(name.c_str());
135 template <
typename T_from,
typename T_to>
139 charset_id m_from, m_to;
147 m_from_wincp = to_encoding(from);
148 m_to_wincp = to_encoding(to);
150 m_handle = iconv_open(to_encoding(to), to_encoding(from));
151 if (m_handle == (iconv_t)-1)
152 throw std::system_error(errno, std::system_category(),
"iconv_open failed");
159 iconv_close(m_handle);
163 charset_id from_encoding()
const {
return m_from; }
164 charset_id to_encoding()
const {
return m_to; }
173 template <
class TR_to = std::
char_traits<T_to>,
class AX_to = std::allocator<T_to>>
175 _Inout_ std::basic_string<T_to, TR_to, AX_to>& dst,
176 _In_reads_or_z_opt_(count_src)
const T_from* src, _In_
size_t count_src)
178 _Assume_(src || !count_src);
179 count_src = strnlen<T_from>(src, count_src);
180 if (!count_src) _Unlikely_
184 constexpr DWORD dwFlagsMBWC = MB_PRECOMPOSED;
185 constexpr DWORD dwFlagsWCMB = 0;
186 constexpr LPCCH lpDefaultChar = NULL;
189 if (m_from_wincp == m_to_wincp) _Unlikely_{
190 dst.append(
reinterpret_cast<const T_to*
>(src), count_src);
194#pragma warning(suppress: 4127)
195 if constexpr (
sizeof(T_from) ==
sizeof(
char) &&
sizeof(T_to) ==
sizeof(
wchar_t)) {
196 _Assume_(count_src < INT_MAX || count_src == SIZE_MAX);
199 WCHAR szStackBuffer[1024 /
sizeof(WCHAR)];
200#pragma warning(suppress: 6387)
201 int cch = MultiByteToWideChar(
static_cast<UINT
>(m_from_wincp), dwFlagsMBWC,
reinterpret_cast<LPCCH
>(src),
static_cast<int>(count_src), szStackBuffer, _countof(szStackBuffer));
204 dst.append(
reinterpret_cast<const T_to*
>(szStackBuffer), count_src != SIZE_MAX ? wcsnlen(szStackBuffer, cch) :
static_cast<size_t>(cch) - 1);
207 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
209 cch = MultiByteToWideChar(
static_cast<UINT
>(m_from_wincp), dwFlagsMBWC,
reinterpret_cast<LPCCH
>(src),
static_cast<int>(count_src), NULL, 0);
210 size_t offset = dst.size();
211 dst.resize(offset +
static_cast<size_t>(cch));
212 cch = MultiByteToWideChar(
static_cast<UINT
>(m_from_wincp), dwFlagsMBWC,
reinterpret_cast<LPCCH
>(src),
static_cast<int>(count_src), &dst[offset], cch);
213 dst.resize(offset + (count_src != SIZE_MAX ? wcsnlen(&dst[offset], cch) :
static_cast<size_t>(cch) - 1));
216 throw std::system_error(GetLastError(), std::system_category(),
"MultiByteToWideChar failed");
219#pragma warning(suppress: 4127)
220 if constexpr (
sizeof(T_from) ==
sizeof(
wchar_t) &&
sizeof(T_to) ==
sizeof(
char)) {
221 _Assume_(count_src < INT_MAX || count_src == SIZE_MAX);
224 CHAR szStackBuffer[1024 /
sizeof(CHAR)];
225#pragma warning(suppress: 6387)
226 int cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB,
reinterpret_cast<LPCWCH
>(src),
static_cast<int>(count_src), szStackBuffer, _countof(szStackBuffer), lpDefaultChar, NULL);
229 dst.append(
reinterpret_cast<const T_to*
>(szStackBuffer), count_src != SIZE_MAX ? strnlen(szStackBuffer, cch) :
static_cast<size_t>(cch) - 1);
232 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
234 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB,
reinterpret_cast<LPCWCH
>(src),
static_cast<int>(count_src), NULL, 0, lpDefaultChar, NULL);
235 size_t offset = dst.size();
236 dst.resize(offset +
static_cast<size_t>(cch));
237 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB,
reinterpret_cast<LPCWCH
>(src),
static_cast<int>(count_src), &dst[offset], cch, lpDefaultChar, NULL);
238 dst.resize(offset + (count_src != SIZE_MAX ? strnlen(&dst[offset], cch) :
static_cast<size_t>(cch) - 1));
241 throw std::system_error(GetLastError(), std::system_category(),
"WideCharToMultiByte failed");
244#pragma warning(suppress: 4127)
245 if constexpr (
sizeof(T_from) ==
sizeof(
char) &&
sizeof(T_to) ==
sizeof(
char)) {
246 _Assume_(count_src < INT_MAX || count_src == SIZE_MAX);
249 WCHAR szStackBufferMBWC[512 /
sizeof(WCHAR)];
250#pragma warning(suppress: 6387)
251 int cch = MultiByteToWideChar(
static_cast<UINT
>(m_from_wincp), dwFlagsMBWC,
reinterpret_cast<LPCCH
>(src),
static_cast<int>(count_src), szStackBufferMBWC, _countof(szStackBufferMBWC));
254 size_t count_inter = count_src != SIZE_MAX ? wcsnlen(szStackBufferMBWC, cch) :
static_cast<size_t>(cch) - 1;
255 _Assume_(count_inter < INT_MAX);
258 CHAR szStackBufferWCMB[512 /
sizeof(CHAR)];
259#pragma warning(suppress: 6387)
260 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB, szStackBufferMBWC,
static_cast<int>(count_inter), szStackBufferWCMB, _countof(szStackBufferWCMB), lpDefaultChar, NULL);
263 dst.append(
reinterpret_cast<const T_to*
>(szStackBufferWCMB), strnlen(szStackBufferWCMB, cch));
266 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
268 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB, szStackBufferMBWC,
static_cast<int>(count_inter), NULL, 0, lpDefaultChar, NULL);
269 size_t offset = dst.size();
270 dst.resize(offset + cch);
271 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB, szStackBufferMBWC,
static_cast<int>(count_inter), &dst[offset], cch, lpDefaultChar, NULL);
272 dst.resize(offset + strnlen(&dst[offset], cch));
275 throw std::system_error(GetLastError(), std::system_category(),
"WideCharToMultiByte failed");
277 if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
279 cch = MultiByteToWideChar(
static_cast<UINT
>(m_from_wincp), dwFlagsMBWC,
reinterpret_cast<LPCCH
>(src),
static_cast<int>(count_src), NULL, 0);
280 std::unique_ptr<WCHAR[]> szBufferMBWC(
new WCHAR[cch]);
281 cch = MultiByteToWideChar(
static_cast<UINT
>(m_from_wincp), dwFlagsMBWC,
reinterpret_cast<LPCCH
>(src),
static_cast<int>(count_src), szBufferMBWC.get(), cch);
282 size_t count_inter = count_src != SIZE_MAX ? wcsnlen(szBufferMBWC.get(), cch) :
static_cast<size_t>(cch) - 1;
285 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB, szBufferMBWC.get(),
static_cast<int>(count_inter), NULL, 0, lpDefaultChar, NULL);
286 size_t offset = dst.size();
287 dst.resize(offset + cch);
288 cch = WideCharToMultiByte(
static_cast<UINT
>(m_to_wincp), dwFlagsWCMB, szBufferMBWC.get(),
static_cast<int>(count_inter), &dst[offset], cch, lpDefaultChar, NULL);
289 dst.resize(offset + strnlen(&dst[offset], cch));
292 throw std::system_error(GetLastError(), std::system_category(),
"MultiByteToWideChar failed");
295 dst.reserve(dst.size() + count_src);
296 T_to buf[1024 /
sizeof(T_to)];
297 size_t src_size = stdex::mul(
sizeof(T_from), count_src);
299 T_to* output = &buf[0];
300 size_t output_size =
sizeof(buf);
302 iconv(m_handle,
const_cast<char**
>(
reinterpret_cast<const char**
>(&src)), &src_size,
reinterpret_cast<char**
>(&output), &output_size);
303 dst.append(buf,
reinterpret_cast<T_to*
>(
reinterpret_cast<char*
>(buf) +
sizeof(buf) - output_size));
308 throw std::system_error(errno, std::system_category(),
"iconv failed");
319 template <
class TR_to = std::
char_traits<T_to>,
class AX_to = std::allocator<T_to>>
321 _Inout_ std::basic_string<T_to, TR_to, AX_to>& dst,
322 _In_z_
const T_from* src)
324 strcat(dst, src, SIZE_MAX);
333 template <
class TR_to = std::
char_traits<T_to>,
class AX_to = std::allocator<T_to>>
335 _Inout_ std::basic_string<T_to, TR_to, AX_to>& dst,
336 _In_
const std::basic_string_view<T_from, std::char_traits<T_from>> src)
338 strcat(dst, src.data(), src.size());
348 template <
class TR_to = std::
char_traits<T_to>,
class AX_to = std::allocator<T_to>>
350 _Inout_ std::basic_string<T_to, TR_to, AX_to>& dst,
351 _In_reads_or_z_opt_(count_src)
const T_from* src, _In_
size_t count_src)
354 strcat(dst, src, count_src);
363 template <
class TR_to = std::
char_traits<T_to>,
class AX_to = std::allocator<T_to>>
365 _Inout_ std::basic_string<T_to, TR_to, AX_to>& dst,
366 _In_z_
const T_from* src)
368 strcpy(dst, src, SIZE_MAX);
377 template <
class TR_to = std::
char_traits<T_to>,
class AX_to = std::allocator<T_to>>
379 _Inout_ std::basic_string<T_to, TR_to, AX_to>& dst,
380 _In_
const std::basic_string_view<T_from, std::char_traits<T_from>> src)
382 strcpy(dst, src.data(), src.size());
391 template <
class TR_to = std::
char_traits<T_to>,
class AX_to = std::allocator<T_to>>
392 std::basic_string<T_to, TR_to, AX_to>
convert(_In_reads_or_z_opt_(count_src)
const T_from* src, _In_
size_t count_src)
394 std::basic_string<T_to, TR_to, AX_to> dst;
395 strcat(dst, src, count_src);
404 template <
class TR_to = std::
char_traits<T_to>,
class AX_to = std::allocator<T_to>>
405 std::basic_string<T_to, TR_to, AX_to>
convert(_In_z_
const T_from* src)
415 template <
class TR_to = std::
char_traits<T_to>,
class AX_to = std::allocator<T_to>>
416 std::basic_string<T_to, TR_to, AX_to>
convert(_In_
const std::basic_string_view<T_from, std::char_traits<T_from>> src)
418 return convert(src.data(), src.size());
424 iconv(m_handle, NULL, NULL, NULL, NULL);
428 static charset_id system_charset()
431 return static_cast<charset_id
>(GetACP());
433 return charset_from_name(nl_langinfo(CODESET));
439 static UINT to_encoding(_In_ charset_id charset)
442 charset == charset_id::system ? GetACP() :
443 charset == charset_id::oem ? GetOEMCP() :
444 static_cast<UINT>(charset);
448 UINT m_from_wincp, m_to_wincp;
451 static const char* to_encoding(_In_ charset_id charset)
453 static const char*
const encodings[
static_cast<std::underlying_type_t<charset_id>
>(charset_id::_max)] = {
457#if BYTE_ORDER == BIG_ENDIAN
469 charset == charset_id::system ? nl_langinfo(CODESET) :
470 encodings[static_cast<std::underlying_type_t<charset_id>>(charset)];
488 template <
class TR_to = std::
char_traits<
wchar_t>,
class AX_to = std::allocator<
wchar_t>>
490 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
493 _Inout_ std::basic_string<wchar_t, TR_to, AX_to>& 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 charset_encoder<char, wchar_t>(charset, wchar_t_charset).strcat(dst, src, count_src);
500 template <
class TR_to = std::
char_traits<
wchar_t>,
class AX_to = std::allocator<
wchar_t>>
501 _Deprecated_(
"Use stdex::strcat")
502 inline
void str2wstr(
503 _Inout_ std::basic_string<
wchar_t, TR_to, AX_to>& dst,
504 _In_reads_or_z_opt_(count_src) const
char* src, _In_
size_t count_src,
505 _In_ charset_id charset = charset_id::system)
507 strcat(dst, src, count_src, charset);
519 template <
class TR_to = std::
char_traits<
wchar_t>,
class AX_to = std::allocator<
wchar_t>>
521 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
524 _Inout_ std::basic_string<wchar_t, TR_to, AX_to>& dst,
525 _In_
const std::basic_string_view<
char, std::char_traits<char>> src,
526 _In_ charset_id charset = charset_id::system)
528 strcat(dst, src.data(), src.size(), charset);
531 template <
class TR_to = std::
char_traits<
wchar_t>,
class AX_to = std::allocator<
wchar_t>>
532 _Deprecated_(
"Use stdex::strcat")
533 inline
void str2wstr(
534 _Inout_ std::basic_string<
wchar_t, TR_to, AX_to>& dst,
535 _In_ const std::basic_string_view<
char, std::char_traits<
char>> src,
536 _In_ charset_id charset = charset_id::system)
538 strcat(dst, src, charset);
551 template <
class TR_to = std::
char_traits<
wchar_t>,
class AX_to = std::allocator<
wchar_t>>
553 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
556 _Inout_ std::basic_string<wchar_t, TR_to, AX_to>& dst,
557 _In_reads_or_z_opt_(count_src)
const char* src, _In_
size_t count_src,
558 _In_ charset_id charset = charset_id::system)
561 strcat(dst, src, count_src, charset);
573 template <
class TR_to = std::
char_traits<
wchar_t>,
class AX_to = std::allocator<
wchar_t>>
575 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
578 _Inout_ std::basic_string<wchar_t, TR_to, AX_to>& dst,
579 _In_
const std::basic_string_view<
char, std::char_traits<char>> src,
580 _In_ charset_id charset = charset_id::system)
582 strcpy(dst, src.data(), src.size(), charset);
596 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
598 inline std::wstring str2wstr(
599 _In_z_
const char* src,
600 _In_ charset_id charset = charset_id::system)
603 strcat(dst, src, SIZE_MAX, charset);
619 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
621 inline std::wstring str2wstr(
622 _In_reads_or_z_opt_(count_src)
const char* src, _In_
size_t count_src,
623 _In_ charset_id charset = charset_id::system)
626 strcat(dst, src, count_src, charset);
641 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
643 inline std::wstring str2wstr(
644 _In_
const std::basic_string_view<
char, std::char_traits<char>> src,
645 _In_ charset_id charset = charset_id::system)
647 return str2wstr(src.data(), src.size(), charset);
660 template <
class TR_to = std::
char_traits<
char>,
class AX_to = std::allocator<
char>>
662 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
665 _Inout_ std::basic_string<char, TR_to, AX_to>& dst,
666 _In_reads_or_z_opt_(count_src)
const wchar_t* src, _In_
size_t count_src,
667 _In_ charset_id charset = charset_id::system)
669 charset_encoder<wchar_t, char>(wchar_t_charset, charset).strcat(dst, src, count_src);
672 template <
class TR_to = std::
char_traits<
char>,
class AX_to = std::allocator<
char>>
673 _Deprecated_(
"Use stdex::strcat")
674 inline
void wstr2str(
675 _Inout_ std::basic_string<
char, TR_to, AX_to>& dst,
676 _In_reads_or_z_opt_(count_src) const
wchar_t* src, _In_
size_t count_src,
677 _In_ charset_id charset = charset_id::system)
679 strcat(dst, src, count_src, charset);
691 template <
class TR_to = std::
char_traits<
char>,
class AX_to = std::allocator<
char>>
693 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
696 _Inout_ std::basic_string<char, TR_to, AX_to>& dst,
697 _In_
const std::basic_string_view<
wchar_t, std::char_traits<wchar_t>> src,
698 _In_ charset_id charset = charset_id::system)
700 strcat(dst, src.data(), src.size(), charset);
703 template <
class TR_to = std::
char_traits<
char>,
class AX_to = std::allocator<
char>>
704 _Deprecated_(
"Use stdex::strcat")
705 inline
void wstr2str(
706 _Inout_ std::basic_string<
char, TR_to, AX_to>& dst,
707 _In_ const std::basic_string_view<
wchar_t, std::char_traits<
wchar_t>> src,
708 _In_ charset_id charset = charset_id::system)
710 strcat(dst, src, charset);
723 template <
class TR_to = std::
char_traits<
char>,
class AX_to = std::allocator<
char>>
725 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
728 _Inout_ std::basic_string<char, TR_to, AX_to>& dst,
729 _In_reads_or_z_opt_(count_src)
const wchar_t* src, _In_
size_t count_src,
730 _In_ charset_id charset = charset_id::system)
733 strcat(dst, src, count_src, charset);
745 template <
class TR_to = std::
char_traits<
char>,
class AX_to = std::allocator<
char>>
747 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
750 _Inout_ std::basic_string<char, TR_to, AX_to>& dst,
751 _In_
const std::basic_string_view<
wchar_t, std::char_traits<wchar_t>> src,
752 _In_ charset_id charset = charset_id::system)
754 strcpy(dst, src.data(), src.size(), charset);
768 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
770 inline std::string wstr2str(
771 _In_z_
const wchar_t* src,
772 _In_ charset_id charset = charset_id::system)
775 strcat(dst, src, SIZE_MAX, charset);
791 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
793 inline std::string wstr2str(
794 _In_reads_or_z_opt_(count_src)
const wchar_t* src, _In_
size_t count_src,
795 _In_ charset_id charset = charset_id::system)
798 strcat(dst, src, count_src, charset);
813 _Deprecated_(
"For better performance, consider a reusable charset_encoder")
815 inline std::string wstr2str(
816 _In_
const std::basic_string_view<
wchar_t, std::char_traits<wchar_t>> src,
817 _In_ charset_id charset = charset_id::system)
819 return wstr2str(src.data(), src.size(), charset);
832 template <
class TR = std::
char_traits<
wchar_t>,
class AX = std::allocator<
wchar_t>>
834 _Inout_ std::basic_string<wchar_t, TR, AX>& dst,
835 _In_reads_or_z_opt_(count_src)
const wchar_t* src, _In_
size_t count_src)
837 count_src = strnlen(src, count_src);
838 size_t count_dst = dst.size();
839 dst.resize(count_dst + count_src);
840 _Assume_(count_src + 1 < INT_MAX);
841#pragma warning(suppress: 6387)
842 int r = NormalizeString(NormalizationC, src,
static_cast<int>(count_src), dst.data() + count_dst,
static_cast<int>(count_src + 1));
844 dst.resize(count_dst + r);
846#pragma warning(suppress: 6387)
847 memcpy(dst.data() + count_dst, src, count_src *
sizeof(
wchar_t));
859 template <
size_t N,
class TR = std::
char_traits<
wchar_t>,
class AX = std::allocator<
wchar_t>>
861 _Inout_ std::basic_string<wchar_t, TR, AX>& dst,
862 _In_
const wchar_t (&src)[N])
864 return normalizecat(dst, src, N);
875 template <
class TR_dst = std::
char_traits<
wchar_t>,
class AX_dst = std::allocator<
wchar_t>>
877 _Inout_ std::basic_string<wchar_t, TR_dst, AX_dst>& dst,
878 _In_
const std::basic_string_view<
wchar_t, std::char_traits<wchar_t>> src)
880 return normalizecat(dst, src.data(), src.size());
892 template <
class TR = std::
char_traits<
wchar_t>,
class AX = std::allocator<
wchar_t>>
894 _Inout_ std::basic_string<wchar_t, TR, AX>& dst,
895 _In_reads_or_z_opt_(count_src)
const wchar_t* src, _In_
size_t count_src)
898 return normalizecat(dst, src, count_src);
909 template <
size_t N,
class TR = std::
char_traits<
wchar_t>,
class AX = std::allocator<
wchar_t>>
911 _Inout_ std::basic_string<wchar_t, TR, AX>& dst,
912 _In_
const wchar_t(&src)[N])
914 return normalize(dst, src, N);
925 template <
class TR_dst = std::
char_traits<
wchar_t>,
class AX_dst = std::allocator<
wchar_t>>
927 _Inout_ std::basic_string<wchar_t, TR_dst, AX_dst>& dst,
928 _In_
const std::basic_string_view<
wchar_t, std::char_traits<wchar_t>> src)
930 return normalize(dst, src.data(), src.size());
941 inline std::wstring normalize(_In_reads_or_z_opt_(count_src)
const wchar_t* src, _In_
size_t count_src)
944 normalizecat(dst, src, count_src);
956 std::wstring normalize(_In_
const wchar_t(&src)[N])
959 normalizecat(dst, src, N);
970 inline std::wstring normalize(_In_
const std::basic_string_view<
wchar_t, std::char_traits<wchar_t>> src)
973 normalizecat(dst, src.data(), src.size());
980#pragma GCC diagnostic pop
Encoding converter context.
Definition unicode.hpp:137
void strcat(std::basic_string< T_to, TR_to, AX_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:174
void strcat(std::basic_string< T_to, TR_to, AX_to > &dst, const std::basic_string_view< T_from, std::char_traits< T_from > > src)
Convert string and append to string.
Definition unicode.hpp:334
void strcpy(std::basic_string< T_to, TR_to, AX_to > &dst, const T_from *src)
Convert string.
Definition unicode.hpp:364
void strcat(std::basic_string< T_to, TR_to, AX_to > &dst, const T_from *src)
Convert string and append to string.
Definition unicode.hpp:320
void strcpy(std::basic_string< T_to, TR_to, AX_to > &dst, _In_reads_or_z_opt_(count_src) const T_from *src, size_t count_src)
Convert string.
Definition unicode.hpp:349
std::basic_string< T_to, TR_to, AX_to > convert(const T_from *src)
Return converted string.
Definition unicode.hpp:405
void strcpy(std::basic_string< T_to, TR_to, AX_to > &dst, const std::basic_string_view< T_from, std::char_traits< T_from > > src)
Convert string.
Definition unicode.hpp:378
std::basic_string< T_to, TR_to, AX_to > convert(const std::basic_string_view< T_from, std::char_traits< T_from > > src)
Return converted string.
Definition unicode.hpp:416
std::basic_string< T_to, TR_to, AX_to > convert(_In_reads_or_z_opt_(count_src) const T_from *src, size_t count_src)
Return converted string.
Definition unicode.hpp:392