7 #ifndef BOOST_LOCALE_ENCODING_UTF_HPP_INCLUDED 8 #define BOOST_LOCALE_ENCODING_UTF_HPP_INCLUDED 10 #include <boost/locale/utf.hpp> 11 #include <boost/locale/encoding_errors.hpp> 15 # pragma warning(push) 16 # pragma warning(disable : 4275 4251 4231 4660) 30 template<
typename CharOut,
typename CharIn>
31 std::basic_string<CharOut>
34 std::basic_string<CharOut> result;
35 result.reserve(end-begin);
36 typedef std::back_insert_iterator<std::basic_string<CharOut> > inserter_type;
37 inserter_type inserter(result);
55 template<
typename CharOut,
typename CharIn>
56 std::basic_string<CharOut>
59 CharIn
const *end = str;
62 return utf_to_utf<CharOut,CharIn>(str,end,how);
69 template<
typename CharOut,
typename CharIn>
70 std::basic_string<CharOut>
73 return utf_to_utf<CharOut,CharIn>(str.c_str(),str.c_str()+str.size(),how);
static const code_point incomplete
Special constant that defines incomplete code point.
Definition: utf.hpp:44
The excepton that is thrown in case of conversion error.
Definition: encoding_errors.hpp:29
uint32_t code_point
The integral type that can hold a Unicode code point.
Definition: utf.hpp:34
static const code_point illegal
Special constant that defines illegal code point.
Definition: utf.hpp:39
UTF Traits class - functions to convert UTF sequences to and from Unicode code points.
Definition: utf.hpp:63
std::basic_string< CharOut > utf_to_utf(CharIn const *begin, CharIn const *end, method_type how=default_method)
Definition: encoding_utf.hpp:32
Default method - skip.
Definition: encoding_errors.hpp:55
Stop conversion and throw conversion_error.
Definition: encoding_errors.hpp:54
method_type
Definition: encoding_errors.hpp:52