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>
17# pragma warning(disable : 4275 4251 4231 4660)
20namespace boost {
namespace locale {
namespace conv {
28 template<
typename CharOut,
typename CharIn>
31 std::basic_string<CharOut> result;
32 result.reserve(end - begin);
33 std::back_insert_iterator<std::basic_string<CharOut>> inserter(result);
48 template<
typename CharOut,
typename CharIn>
51 return utf_to_utf<CharOut, CharIn>(str,
util::str_end(str), how);
57 template<
typename CharOut,
typename CharIn>
60 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
std::basic_string< CharOut > utf_to_utf(const CharIn *begin, const CharIn *end, method_type how=default_method)
Definition: encoding_utf.hpp:29
method_type
enum that defines conversion policy
Definition: encoding_errors.hpp:41
@ stop
Stop conversion and throw conversion_error.
Definition: encoding_errors.hpp:43
@ default_method
Default method - skip.
Definition: encoding_errors.hpp:44
uint32_t code_point
The integral type that can hold a Unicode code point.
Definition: utf.hpp:19
constexpr code_point illegal
Special constant that defines illegal code point.
Definition: utf.hpp:22
constexpr code_point incomplete
Special constant that defines incomplete code point.
Definition: utf.hpp:24
Char * str_end(Char *str)
Return the end of a C-string, i.e. the pointer to the trailing NULL byte.
Definition: string.hpp:16
static code_point decode(Iterator &p, Iterator e)
static Iterator encode(code_point value, Iterator out)