Boost.Locale
conversion functions

Functions

template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf (const char *begin, const char *end, const std::string &charset, method_type how=default_method)
 
template<typename CharType >
std::string boost::locale::conv::from_utf (const CharType *begin, const CharType *end, const std::string &charset, method_type how=default_method)
 
template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf (const std::string &text, const std::string &charset, method_type how=default_method)
 
template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf (const char *text, const std::string &charset, method_type how=default_method)
 
template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf (const char *begin, const char *end, const std::locale &loc, method_type how=default_method)
 
template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf (const std::string &text, const std::locale &loc, method_type how=default_method)
 
template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf (const char *text, const std::locale &loc, method_type how=default_method)
 
template<typename CharType >
std::string boost::locale::conv::from_utf (const std::basic_string< CharType > &text, const std::string &charset, method_type how=default_method)
 
template<typename CharType >
std::string boost::locale::conv::from_utf (const CharType *text, const std::string &charset, method_type how=default_method)
 
template<typename CharType >
std::string boost::locale::conv::from_utf (const CharType *begin, const CharType *end, const std::locale &loc, method_type how=default_method)
 
template<typename CharType >
std::string boost::locale::conv::from_utf (const std::basic_string< CharType > &text, const std::locale &loc, method_type how=default_method)
 
template<typename CharType >
std::string boost::locale::conv::from_utf (const CharType *text, const std::locale &loc, method_type how=default_method)
 
std::string boost::locale::conv::between (const char *begin, const char *end, const std::string &to_encoding, const std::string &from_encoding, method_type how=default_method)
 
std::string boost::locale::conv::between (const char *text, const std::string &to_encoding, const std::string &from_encoding, method_type how=default_method)
 
std::string boost::locale::conv::between (const std::string &text, const std::string &to_encoding, const std::string &from_encoding, method_type how=default_method)
 

Detailed Description

Function Documentation

◆ between() [1/3]

std::string boost::locale::conv::between ( const char * begin,
const char * end,
const std::string & to_encoding,
const std::string & from_encoding,
method_type how = default_method )

Convert a text in range [begin,end) to to_encoding from from_encoding according to policy how

Exceptions
invalid_charset_errorEither character set is not supported
conversion_errorwhen the conversion fails (e.g. how is stop and any character cannot be encoded or decoded)

◆ between() [2/3]

std::string boost::locale::conv::between ( const char * text,
const std::string & to_encoding,
const std::string & from_encoding,
method_type how = default_method )
inline

Convert text to to_encoding from from_encoding according to policy how

Exceptions
invalid_charset_errorEither character set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)

◆ between() [3/3]

std::string boost::locale::conv::between ( const std::string & text,
const std::string & to_encoding,
const std::string & from_encoding,
method_type how = default_method )
inline

Convert text to to_encoding from from_encoding according to policy how

Exceptions
invalid_charset_errorEither character set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)

◆ from_utf() [1/6]

template<typename CharType >
std::string boost::locale::conv::from_utf ( const CharType * begin,
const CharType * end,
const std::locale & loc,
method_type how = default_method )

Convert UTF text in range [begin,end) to text in locale encoding given by loc according to policy how

Exceptions
std::bad_castloc does not have info facet installed
invalid_charset_errorCharacter set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)

◆ from_utf() [2/6]

template<typename CharType >
std::string boost::locale::conv::from_utf ( const CharType * begin,
const CharType * end,
const std::string & charset,
method_type how = default_method )

convert UTF text in range [begin,end) to text encoded with charset according to policy how

Exceptions
invalid_charset_errorCharacter set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)

◆ from_utf() [3/6]

template<typename CharType >
std::string boost::locale::conv::from_utf ( const CharType * text,
const std::locale & loc,
method_type how = default_method )

Convert text from UTF to locale encoding given by loc according to policy how

Exceptions
std::bad_castloc does not have info facet installed
invalid_charset_errorCharacter set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)

◆ from_utf() [4/6]

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

Convert text from UTF to charset according to policy how

Exceptions
invalid_charset_errorCharacter set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)

◆ from_utf() [5/6]

template<typename CharType >
std::string boost::locale::conv::from_utf ( const std::basic_string< CharType > & text,
const std::locale & loc,
method_type how = default_method )

Convert text from UTF to locale encoding given by loc according to policy how

Exceptions
std::bad_castloc does not have info facet installed
invalid_charset_errorCharacter set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)

◆ from_utf() [6/6]

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

convert text from UTF to text encoded with charset according to policy how

Exceptions
invalid_charset_errorCharacter set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)

◆ to_utf() [1/6]

template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf ( const char * begin,
const char * end,
const std::locale & loc,
method_type how = default_method )

convert text in range [begin,end) in locale encoding given by loc to UTF according to policy how

Exceptions
std::bad_castloc does not have info facet installed
invalid_charset_errorCharacter set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)

◆ to_utf() [2/6]

template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf ( const char * begin,
const char * end,
const std::string & charset,
method_type how = default_method )

convert text in range [begin,end) encoded with charset to UTF according to policy how

Exceptions
invalid_charset_errorCharacter set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)

◆ to_utf() [3/6]

template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf ( const char * text,
const std::locale & loc,
method_type how = default_method )

Convert text in locale encoding given by loc to UTF according to policy how

Exceptions
std::bad_castloc does not have info facet installed
invalid_charset_errorCharacter set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)

◆ to_utf() [4/6]

template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf ( const char * text,
const std::string & charset,
method_type how = default_method )

Convert text encoded with charset to UTF according to policy how

Exceptions
invalid_charset_errorCharacter set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)

◆ to_utf() [5/6]

template<typename CharType >
std::basic_string< CharType > boost::locale::conv::to_utf ( const std::string & text,
const std::locale & loc,
method_type how = default_method )

Convert text in locale encoding given by loc to UTF according to policy how

Exceptions
std::bad_castloc does not have info facet installed
invalid_charset_errorCharacter set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)

◆ to_utf() [6/6]

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

convert text encoded with charset to UTF according to policy how

Exceptions
invalid_charset_errorCharacter set is not supported
conversion_errorConversion failed (e.g. how is stop and any character cannot be encoded or decoded)