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 |
Public Member Functions | |
| template<typename In, typename Out> | |
| Out | UTF32ToANSI (In Begin, In End, Out Output, char Replacement, const std::locale &Locale) |
| Generic function to convert an UTF-32 characters range to an ANSI characters range, using the given locale. | |
| template<typename In, typename Out> | |
| Out | ANSIToUTF32 (In Begin, In End, Out Output, const std::locale &Locale) |
| Generic function to convert an ANSI characters range to an UTF-32 characters range, using the given locale. | |
| template<typename In, typename Out> | |
| 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> | |
| 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> | |
| 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> | |
| 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> | |
| 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> | |
| 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> | |
| std::size_t | GetUTF8Length (In Begin, In End) |
| Get the number of characters composing an UTF-8 string. | |
| template<typename In> | |
| std::size_t | GetUTF16Length (In Begin, In End) |
| Get the number of characters composing an UTF-16 string. | |
| template<typename In> | |
| std::size_t | GetUTF32Length (In Begin, In End) |
| Get the number of characters composing an UTF-32 string. | |
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<Uint16> sf::Unicode::UTF16String |
Definition at line 55 of file Unicode.hpp.
| typedef std::basic_string<Uint32> sf::Unicode::UTF32String |
Definition at line 56 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.
|
inline |
Generic function to convert an ANSI characters range to an UTF-32 characters range, using the given locale.
Definition at line 67 of file Unicode.inl.
|
inlinestatic |
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) |
Definition at line 68 of file Unicode.hpp.
|
inlinestatic |
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 |
Definition at line 443 of file Unicode.hpp.
|
inline |
Get the number of characters composing an UTF-16 string.
Definition at line 442 of file Unicode.inl.
|
inlinestatic |
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 |
Definition at line 472 of file Unicode.hpp.
|
inline |
Get the number of characters composing an UTF-32 string.
Definition at line 471 of file Unicode.inl.
|
inlinestatic |
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 |
Definition at line 423 of file Unicode.hpp.
|
inline |
Get the number of characters composing an UTF-8 string.
Definition at line 422 of file Unicode.inl.
|
inline |
Generic function to convert an UTF-16 characters range to an UTF-32 characters range, using the given locale.
Definition at line 280 of file Unicode.inl.
|
inlinestatic |
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) |
Definition at line 281 of file Unicode.hpp.
|
inline |
Generic function to convert an UTF-16 characters range to an UTF-8 characters range, using the given locale.
Definition at line 207 of file Unicode.inl.
|
inlinestatic |
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) |
Definition at line 208 of file Unicode.hpp.
|
inline |
Generic function to convert an UTF-32 characters range to an ANSI characters range, using the given locale.
Definition at line 31 of file Unicode.inl.
|
inlinestatic |
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) |
Definition at line 32 of file Unicode.hpp.
|
inline |
Generic function to convert an UTF-32 characters range to an UTF-16 characters range, using the given locale.
Definition at line 379 of file Unicode.inl.
|
inlinestatic |
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) |
Definition at line 380 of file Unicode.hpp.
|
inline |
Generic function to convert an UTF-32 characters range to an UTF-8 characters range, using the given locale.
Definition at line 326 of file Unicode.inl.
|
inlinestatic |
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) |
Definition at line 327 of file Unicode.hpp.
|
inline |
Generic function to convert an UTF-8 characters range to an UTF-16 characters range, using the given locale.
Definition at line 102 of file Unicode.inl.
|
inlinestatic |
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) |
Definition at line 103 of file Unicode.hpp.
|
inline |
Generic function to convert an UTF-8 characters range to an UTF-32 characters range, using the given locale.
Definition at line 163 of file Unicode.inl.
|
inlinestatic |
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) |
Definition at line 164 of file Unicode.hpp.