25#ifndef SFML_UNICODE_HPP
26#define SFML_UNICODE_HPP
31#include <SFML/Config.hpp>
55 typedef std::basic_string<Uint16> UTF16String;
56 typedef std::basic_string<Uint32> UTF32String;
79 Text(
const char* Str);
80 Text(
const wchar_t* Str);
81 Text(
const Uint8* Str);
82 Text(
const Uint16* Str);
83 Text(
const Uint32* Str);
84 Text(
const std::string& Str);
85 Text(
const std::wstring& Str);
87 Text(
const Unicode::UTF16String& Str);
88 Text(
const Unicode::UTF32String& Str);
96 operator std::string ()
const;
97 operator std::wstring ()
const;
99 operator Unicode::UTF16String ()
const;
100 operator const Unicode::UTF32String&()
const;
107 sf::Unicode::UTF32String myUTF32String;
123 template <
typename In,
typename Out>
124 static Out UTF32ToANSI(In Begin, In End, Out Output,
char Replacement =
'?',
const std::locale& Locale = GetDefaultLocale());
138 template <
typename In,
typename Out>
139 static Out ANSIToUTF32(In Begin, In End, Out Output,
const std::locale& Locale = GetDefaultLocale());
153 template <
typename In,
typename Out>
154 static Out UTF8ToUTF16(In Begin, In End, Out Output, Uint16 Replacement =
'?');
168 template <
typename In,
typename Out>
169 static Out
UTF8ToUTF32(In Begin, In End, Out Output, Uint32 Replacement =
'?');
183 template <
typename In,
typename Out>
184 static Out
UTF16ToUTF8(In Begin, In End, Out Output, Uint8 Replacement =
'?');
198 template <
typename In,
typename Out>
199 static Out
UTF16ToUTF32(In Begin, In End, Out Output, Uint32 Replacement =
'?');
213 template <
typename In,
typename Out>
214 static Out
UTF32ToUTF8(In Begin, In End, Out Output, Uint8 Replacement =
'?');
228 template <
typename In,
typename Out>
229 static Out
UTF32ToUTF16(In Begin, In End, Out Output, Uint16 Replacement =
'?');
240 template <
typename In>
252 template <
typename In>
264 template <
typename In>
275 static const std::locale& GetDefaultLocale();
280 static const int UTF8TrailingBytes[256];
281 static const Uint32 UTF8Offsets[6];
282 static const Uint8 UTF8FirstBytes[7];
285#include <SFML/System/Unicode.inl>
This class is an abstract definition of a unicode text, it can be converted from and to any kind of s...
Text()
Default constructor (empty text).
Provides utility functions to convert from and to any unicode and ASCII encoding.
static std::size_t GetUTF16Length(In Begin, In End)
Get the number of characters composing an UTF-16 string.
std::basic_string< Uint8 > UTF8String
Define a string type for each encoding Warning : in UTF8 and UTF16 strings, one element doesn't neces...
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,...
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,...
static std::size_t GetUTF32Length(In Begin, In End)
Get the number of characters composing an UTF-32 string.
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,...
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,...
static std::size_t GetUTF8Length(In Begin, In End)
Get the number of characters composing an UTF-8 string.
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,...