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

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

#include <boost/locale/encoding.hpp>

Public Types

using char_type = CharType
 
using stringview_type = core::basic_string_view<CharType>
 

Public Member Functions

 utf_decoder (const std::string &charset, method_type how=default_method)
 
std::string convert (const CharType *begin, const CharType *end) const
 
std::string convert (const stringview_type &text) const
 
std::string operator() (const stringview_type &text) const
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ utf_decoder()

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

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

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

Exceptions
invalid_charset_errorCharacter set is not supported

Member Function Documentation

◆ convert() [1/2]

template<typename CharType >
std::string boost::locale::conv::utf_decoder< CharType >::convert ( const CharType * begin,
const CharType * end ) const
inline

Convert UTF text in range [begin,end) to local encoding

Exceptions
conversion_errorConversion failed

◆ convert() [2/2]

template<typename CharType >
std::string boost::locale::conv::utf_decoder< CharType >::convert ( const stringview_type & text) const
inline

Convert text from UTF to local encoding

Exceptions
conversion_errorConversion failed

◆ operator()()

template<typename CharType >
std::string boost::locale::conv::utf_decoder< CharType >::operator() ( const stringview_type & text) const
inline

Convert text from UTF to local encoding

Exceptions
conversion_errorConversion failed

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