Boost.Locale
boost::locale::conv::utf_encoder< CharType > Class Template Reference

Converter class to decode a narrow string using a local encoding and encode it with UTF. More...

#include <boost/locale/encoding.hpp>

Public Types

using char_type = CharType
 
using string_type = std::basic_string<CharType>
 

Public Member Functions

 utf_encoder (const std::string &charset, method_type how=default_method)
 
string_type convert (const char *begin, const char *end) const
 
string_type convert (const core::string_view text) const
 
string_type operator() (const core::string_view text) const
 

Detailed Description

template<typename CharType>
class boost::locale::conv::utf_encoder< CharType >

Converter class to decode a narrow string using a local encoding and encode it with UTF.

Constructor & Destructor Documentation

◆ utf_encoder()

template<typename CharType >
boost::locale::conv::utf_encoder< CharType >::utf_encoder ( const std::string & charset,
method_type how = default_method )
inline

Create an instance to convert text encoded with charset to UTF according to policy how

Note: When converting only a single text to_utf is likely faster.

Exceptions
invalid_charset_errorCharacter set is not supported

Member Function Documentation

◆ convert() [1/2]

template<typename CharType >
string_type boost::locale::conv::utf_encoder< CharType >::convert ( const char * begin,
const char * end ) const
inline

Convert text in range [begin,end) to UTF

Exceptions
conversion_errorConversion failed

◆ convert() [2/2]

template<typename CharType >
string_type boost::locale::conv::utf_encoder< CharType >::convert ( const core::string_view text) const
inline

Convert text to UTF

Exceptions
conversion_errorConversion failed

◆ operator()()

template<typename CharType >
string_type boost::locale::conv::utf_encoder< CharType >::operator() ( const core::string_view text) const
inline

Convert text to UTF

Exceptions
conversion_errorConversion failed

The documentation for this class was generated from the following file: