...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Boost.Nowide
|
Namespace that holds basic operations on UTF encoded sequences. More...
Classes | |
struct  | utf_traits |
 | UTF Traits class - functions to convert UTF sequences to and from Unicode code points. More... |
 |
Typedefs | |
using | code_point = uint32_t |
 | The integral type that can hold a Unicode code point. |
 |
Functions | |
template<typename Char > | |
size_t | strlen (const Char *s) |
 | |
template<typename CharOut , typename CharIn > | |
CharOut *Â | convert_buffer (CharOut *buffer, size_t buffer_size, const CharIn *source_begin, const CharIn *source_end) |
 | |
template<typename CharOut , typename CharIn > | |
std::basic_string< CharOut >Â | convert_string (const CharIn *begin, const CharIn *end) |
 | |
template<typename CharOut , typename CharIn > | |
std::basic_string< CharOut >Â | convert_string (const std::basic_string< CharIn > &s) |
 | |
bool | is_valid_codepoint (code_point v) |
 | the function checks if v is a valid code point |
 |
Variables | |
static const code_point | illegal = 0xFFFFFFFFu |
 | Special constant that defines illegal code point. |
 | |
static const code_point | incomplete = 0xFFFFFFFEu |
 | Special constant that defines incomplete code point. |
 |
Namespace that holds basic operations on UTF encoded sequences.
All functions defined in this namespace do not require linking with Boost.Nowide library. Extracted from Boost.Locale
CharOut * boost::nowide::utf::convert_buffer | ( | CharOut *Â | buffer, |
size_t | buffer_size, | ||
const CharIn *Â | source_begin, | ||
const CharIn * | source_end | ||
) |
Convert a buffer of UTF sequences in the range [source_begin, source_end) from CharIn to CharOut to the output buffer of size buffer_size.
If there is not enough room in the buffer NULL is returned, and the content of the buffer is undefined. Any illegal sequences are replaced with the replacement character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER
std::basic_string< CharOut > boost::nowide::utf::convert_string | ( | const CharIn *Â | begin, |
const CharIn * | end | ||
) |
Convert the UTF sequences in range [begin, end) from CharIn to CharOut and return it as a string
Any illegal sequences are replaced with the replacement character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER
CharOut | Output character type |
std::basic_string< CharOut > boost::nowide::utf::convert_string | ( | const std::basic_string< CharIn > &Â | s | ) |
Convert the UTF sequence in the input string from CharIn to CharOut and return it as a string
Any illegal sequences are replaced with the replacement character, see BOOST_NOWIDE_REPLACEMENT_CHARACTER
CharOut | Output character type |
size_t boost::nowide::utf::strlen | ( | const Char *Â | s | ) |
Return the length of the given string in code units. That is the number of elements of type Char until the first NULL character. Equivalent to std::strlen(s)
but can handle wide-strings