7 #ifndef BOOST_LOCALE_ENCODING_UTF_HPP_INCLUDED 8 #define BOOST_LOCALE_ENCODING_UTF_HPP_INCLUDED 10 #include <boost/locale/encoding_errors.hpp> 11 #include <boost/locale/utf.hpp> 12 #include <boost/locale/util/string.hpp> 16 # pragma warning(push) 17 # pragma warning(disable : 4275 4251 4231 4660) 20 namespace boost {
namespace locale {
namespace conv {
26 template<
typename CharOut,
typename CharIn>
29 std::basic_string<CharOut> result;
30 result.reserve(end - begin);
31 typedef std::back_insert_iterator<std::basic_string<CharOut>> inserter_type;
32 inserter_type inserter(result);
47 template<
typename CharOut,
typename CharIn>
50 return utf_to_utf<CharOut, CharIn>(str,
util::str_end(str), how);
54 template<
typename CharOut,
typename CharIn>
57 return utf_to_utf<CharOut, CharIn>(str.c_str(), str.c_str() + str.size(), how);
The exception that is thrown in case of conversion error.
Definition: encoding_errors.hpp:25
uint32_t code_point
The integral type that can hold a Unicode code point.
Definition: utf.hpp:19
UTF Traits class - functions to convert UTF sequences to and from Unicode code points.
Definition: utf.hpp:40
Default method - skip.
Definition: encoding_errors.hpp:44
Char * str_end(Char *str)
Return the end of a C-string, i.e. the pointer to the trailing NULL byte.
Definition: string.hpp:15
std::basic_string< CharOut > utf_to_utf(const CharIn *begin, const CharIn *end, method_type how=default_method)
Convert a Unicode text in range [begin,end) to other Unicode encoding.
Definition: encoding_utf.hpp:27
Stop conversion and throw conversion_error.
Definition: encoding_errors.hpp:43
constexpr code_point illegal
Special constant that defines illegal code point.
Definition: utf.hpp:22
method_type
enum that defines conversion policy
Definition: encoding_errors.hpp:41
constexpr code_point incomplete
Special constant that defines incomplete code point.
Definition: utf.hpp:24