Guitar
Functions
unicode_conversion.h File Reference
#include <string>
#include <string_view>
Include dependency graph for unicode_conversion.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::u16string convert_utf8_to_utf16 (std::string_view const &s)
 Converts a UTF-8 string into UTF-16. More...
 
std::string convert_utf16_to_utf8 (const std::u16string_view &s)
 Converts a UTF-16 string into UTF-8. More...
 

Function Documentation

◆ convert_utf16_to_utf8()

std::string convert_utf16_to_utf8 ( std::u16string_view const &  s)

Converts a UTF-16 string into UTF-8.

Parameters
sSource UTF-16 code units.
Returns
UTF-8 string with malformed input replaced by U+FFFD.

◆ convert_utf8_to_utf16()

std::u16string convert_utf8_to_utf16 ( std::string_view const &  s)

Converts a UTF-8 string into UTF-16.

Parameters
sSource UTF-8 byte sequence.
Returns
UTF-16 string with malformed input replaced by U+FFFD.