Provides utility functions to convert from and to any unicode and ASCII encoding. More...
#include <Unicode.hpp>
Classes | |
class | Text |
This class is an abstract definition of a unicode text, it can be converted from and to any kind of string and encoding. More... | |
Public Types | |
typedef std::basic_string< Uint8 > | UTF8String |
Define a string type for each encoding Warning : in UTF8 and UTF16 strings, one element doesn't necessarily maps to one character ; only an UTF32 element is wide enough to hold all possible unicode values. | |
typedef std::basic_string< Uint16 > | UTF16String |
typedef std::basic_string< Uint32 > | UTF32String |
Static Public Member Functions | |
template<typename In , typename Out > | |
static Out | UTF32ToANSI (In Begin, In End, Out Output, char Replacement= '?', const std::locale &Locale=GetDefaultLocale()) |
Generic function to convert an UTF-32 characters range to an ANSI characters range, using the given locale. | |
template<typename In , typename Out > | |
static Out | ANSIToUTF32 (In Begin, In End, Out Output, const std::locale &Locale=GetDefaultLocale()) |
Generic function to convert an ANSI characters range to an UTF-32 characters range, using the given locale. | |
template<typename In , typename Out > | |
static Out | UTF8ToUTF16 (In Begin, In End, Out Output, Uint16 Replacement= '?') |
Generic function to convert an UTF-8 characters range to an UTF-16 characters range, using the given locale. | |
template<typename In , typename Out > | |
static Out | UTF8ToUTF32 (In Begin, In End, Out Output, Uint32 Replacement= '?') |
Generic function to convert an UTF-8 characters range to an UTF-32 characters range, using the given locale. | |
template<typename In , typename Out > | |
static Out | UTF16ToUTF8 (In Begin, In End, Out Output, Uint8 Replacement= '?') |
Generic function to convert an UTF-16 characters range to an UTF-8 characters range, using the given locale. | |
template<typename In , typename Out > | |
static Out | UTF16ToUTF32 (In Begin, In End, Out Output, Uint32 Replacement= '?') |
Generic function to convert an UTF-16 characters range to an UTF-32 characters range, using the given locale. | |
template<typename In , typename Out > | |
static Out | UTF32ToUTF8 (In Begin, In End, Out Output, Uint8 Replacement= '?') |
Generic function to convert an UTF-32 characters range to an UTF-8 characters range, using the given locale. | |
template<typename In , typename Out > | |
static Out | UTF32ToUTF16 (In Begin, In End, Out Output, Uint16 Replacement= '?') |
Generic function to convert an UTF-32 characters range to an UTF-16 characters range, using the given locale. | |
template<typename In > | |
static std::size_t | GetUTF8Length (In Begin, In End) |
Get the number of characters composing an UTF-8 string. | |
template<typename In > | |
static std::size_t | GetUTF16Length (In Begin, In End) |
Get the number of characters composing an UTF-16 string. | |
template<typename In > | |
static std::size_t | GetUTF32Length (In Begin, In End) |
Get the number of characters composing an UTF-32 string. | |
Provides utility functions to convert from and to any unicode and ASCII encoding.
Definition at line 44 of file Unicode.hpp.
typedef std::basic_string<Uint8> sf::Unicode::UTF8String |
Define a string type for each encoding Warning : in UTF8 and UTF16 strings, one element doesn't necessarily maps to one character ; only an UTF32 element is wide enough to hold all possible unicode values.
Definition at line 54 of file Unicode.hpp.
|
static |
Generic function to convert an ANSI characters range to an UTF-32 characters range, using the given locale.
Begin | : Iterator pointing to the beginning of the input sequence |
End | : Iterator pointing to the end of the input sequence |
Output | : Iterator pointing to the beginning of the output sequence |
Locale | : Locale to use for conversion (uses the current one by default) |
|
static |
Get the number of characters composing an UTF-16 string.
Begin | : Iterator pointing to the beginning of the input sequence |
End | : Iterator pointing to the end of the input sequence |
|
static |
Get the number of characters composing an UTF-32 string.
Begin | : Iterator pointing to the beginning of the input sequence |
End | : Iterator pointing to the end of the input sequence |
|
static |
Get the number of characters composing an UTF-8 string.
Begin | : Iterator pointing to the beginning of the input sequence |
End | : Iterator pointing to the end of the input sequence |
|
static |
Generic function to convert an UTF-16 characters range to an UTF-32 characters range, using the given locale.
Begin | : Iterator pointing to the beginning of the input sequence |
End | : Iterator pointing to the end of the input sequence |
Output | : Iterator pointing to the beginning of the output sequence |
Replacement | : Replacement character for characters not convertible to output encoding ('?' by default – use 0 to use no replacement character) |
|
static |
Generic function to convert an UTF-16 characters range to an UTF-8 characters range, using the given locale.
Begin | : Iterator pointing to the beginning of the input sequence |
End | : Iterator pointing to the end of the input sequence |
Output | : Iterator pointing to the beginning of the output sequence |
Replacement | : Replacement character for characters not convertible to output encoding ('?' by default – use 0 to use no replacement character) |
|
static |
Generic function to convert an UTF-32 characters range to an ANSI characters range, using the given locale.
Begin | : Iterator pointing to the beginning of the input sequence |
End | : Iterator pointing to the end of the input sequence |
Output | : Iterator pointing to the beginning of the output sequence |
Replacement | : Replacement character for characters not convertible to output encoding ('?' by default – use 0 to use no replacement character) |
Locale | : Locale to use for conversion (uses the current one by default) |
|
static |
Generic function to convert an UTF-32 characters range to an UTF-16 characters range, using the given locale.
Begin | : Iterator pointing to the beginning of the input sequence |
End | : Iterator pointing to the end of the input sequence |
Output | : Iterator pointing to the beginning of the output sequence |
Replacement | : Replacement character for characters not convertible to output encoding ('?' by default – use 0 to use no replacement character) |
|
static |
Generic function to convert an UTF-32 characters range to an UTF-8 characters range, using the given locale.
Begin | : Iterator pointing to the beginning of the input sequence |
End | : Iterator pointing to the end of the input sequence |
Output | : Iterator pointing to the beginning of the output sequence |
Replacement | : Replacement character for characters not convertible to output encoding ('?' by default – use 0 to use no replacement character) |
|
static |
Generic function to convert an UTF-8 characters range to an UTF-16 characters range, using the given locale.
Begin | : Iterator pointing to the beginning of the input sequence |
End | : Iterator pointing to the end of the input sequence |
Output | : Iterator pointing to the beginning of the output sequence |
Replacement | : Replacement character for characters not convertible to output encoding ('?' by default – use 0 to use no replacement character) |
|
static |
Generic function to convert an UTF-8 characters range to an UTF-32 characters range, using the given locale.
Begin | : Iterator pointing to the beginning of the input sequence |
End | : Iterator pointing to the end of the input sequence |
Output | : Iterator pointing to the beginning of the output sequence |
Replacement | : Replacement character for characters not convertible to output encoding ('?' by default – use 0 to use no replacement character) |