7#ifndef BOOST_LOCALE_UTF8_CODECVT_HPP
8#define BOOST_LOCALE_UTF8_CODECVT_HPP
10#include <boost/locale/generic_codecvt.hpp>
11#include <boost/locale/utf.hpp>
12#include <boost/assert.hpp>
16namespace boost {
namespace locale {
20 template<
typename CharType>
27 static int max_encoding_length() {
return 4; }
33 static utf::code_point to_unicode(state_type&,
const char*& begin,
const char* end)
35 const char* p = begin;
47 if(width > end - begin)
initial_convertion_state
Initial state for converting to or from Unicode code points, used by initial_state in derived classes...
Definition: generic_codecvt.hpp:43
Generic codecvt facet for various stateless encodings to UTF-16 and UTF-32 using wchar_t,...
Definition: generic_codecvt.hpp:151
Generic utf8 codecvt facet, it allows to convert UTF-8 strings to UTF-16 and UTF-32 using wchar_t,...
Definition: utf8_codecvt.hpp:21
uint32_t code_point
The integral type that can hold a Unicode code point.
Definition: utf.hpp:19
bool is_valid_codepoint(code_point v)
the function checks if v is a valid code point
Definition: utf.hpp:30
code_point len_or_error
Either a length/size or an error (illegal/incomplete)
Definition: utf.hpp:27
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
Definition: utf8_codecvt.hpp:23
static int width(code_point value)
static code_point decode(Iterator &p, Iterator e)
static Iterator encode(code_point value, Iterator out)