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>
241 static std::size_t GetUTF8Length(In Begin, In End);
252 template <
typename In>
253 static std::size_t GetUTF16Length(In Begin, In End);
264 template <
typename In>
265 static std::size_t GetUTF32Length(In Begin, In End);
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>
290 #endif // SFML_UNICODE_HPP