ADTF  3.18.2
a_util::strings::unicode Namespace Reference

Serves as component for unicode (UTF-8, UTF-16) string handling. More...

Functions

std::wstring utf8ToUtf16 (const std::string &utf8_str)
 Convert an utf8 string to utf16 wstring. More...
 
std::string utf16ToUtf8 (const std::wstring &utf16_str)
 Convert an utf16 wstring to utf8 string. More...
 

Detailed Description

Serves as component for unicode (UTF-8, UTF-16) string handling.

Function Documentation

◆ utf16ToUtf8()

std::string a_util::strings::unicode::utf16ToUtf8 ( const std::wstring &  utf16_str)

Convert an utf16 wstring to utf8 string.

Parameters
[in]utf16_strThe utf16 wstring
Returns
Converted utf8 string
Exceptions
std::invalid_argumenton invalid utf16 code points

◆ utf8ToUtf16()

std::wstring a_util::strings::unicode::utf8ToUtf16 ( const std::string &  utf8_str)

Convert an utf8 string to utf16 wstring.

Parameters
[in]utf8_strThe utf8 string
Returns
Converted utf16 string
Exceptions
std::invalid_argumenton invalid utf8 code points