The Battle for Wesnoth  1.19.5+dev
Namespaces | Typedefs | Functions
unicode.hpp File Reference
#include "ucs4_iterator_base.hpp"
#include "ucs4_convert_impl.hpp"
#include "unicode_cast.hpp"
#include <string>
Include dependency graph for unicode.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 utf16
 For Win32 API.
 
 utf8
 Functions for converting Unicode wide-char strings to UTF-8 encoded strings, back and forth.
 

Typedefs

typedef ucs4::iterator_base< std::u16string, ucs4_convert_impl::convert_impl< char16_t >::type > utf16::iterator
 
typedef ucs4::iterator_base< std::string, ucs4_convert_impl::convert_impl< char >::type > utf8::iterator
 

Functions

std::string utf8::lowercase (const std::string &s)
 Returns a lowercased version of the string. More...
 
std::size_t utf8::index (const std::string &str, const std::size_t index)
 Codepoint index corresponding to the nth character in a UTF-8 string. More...
 
std::size_t utf8::size (const std::string &str)
 Length in characters of a UTF-8 string. More...
 
std::string & utf8::insert (std::string &str, const std::size_t pos, const std::string &insert)
 Insert a UTF-8 string at the specified position. More...
 
std::string & utf8::erase (std::string &str, const std::size_t start, const std::size_t len=std::string::npos)
 Erases a portion of a UTF-8 string. More...
 
std::string & utf8::truncate (std::string &str, const std::size_t size)
 Truncates a UTF-8 string to the specified number of characters. More...
 
void utf8::truncate_as_ucs4 (std::string &str, const std::size_t size)
 Truncates a UTF-8 string to the specified number of characters. More...