diff --git a/include/SFML/System/Unicode.hpp b/include/SFML/System/Unicode.hpp index 6463ed8d8..c79c8748f 100644 --- a/include/SFML/System/Unicode.hpp +++ b/include/SFML/System/Unicode.hpp @@ -277,7 +277,7 @@ private : //////////////////////////////////////////////////////////// // Static member data //////////////////////////////////////////////////////////// - static const char UTF8TrailingBytes[256]; ///< Lookup table to find the length of an UTF-8 sequence + static const int UTF8TrailingBytes[256]; ///< Lookup table to find the length of an UTF-8 sequence static const Uint32 UTF8Offsets[6]; ///< Magic values to subtract during UTF-8 conversions static const Uint8 UTF8FirstBytes[7]; ///< First bytes for UTF-8 sequences }; diff --git a/include/SFML/System/Unicode.inl b/include/SFML/System/Unicode.inl index 2dbb3a253..08f055e91 100644 --- a/include/SFML/System/Unicode.inl +++ b/include/SFML/System/Unicode.inl @@ -104,7 +104,7 @@ inline Out Unicode::UTF8ToUTF16(In Begin, In End, Out Output, Uint16 Replacement while (Begin < End) { Uint32 c = 0; - int TrailingBytes = UTF8TrailingBytes[*Begin]; + int TrailingBytes = UTF8TrailingBytes[static_cast(*Begin)]; if (Begin + TrailingBytes < End) { // First decode the UTF-8 character @@ -165,7 +165,7 @@ inline Out Unicode::UTF8ToUTF32(In Begin, In End, Out Output, Uint32 Replacement while (Begin < End) { Uint32 c = 0; - int TrailingBytes = UTF8TrailingBytes[*Begin]; + int TrailingBytes = UTF8TrailingBytes[static_cast(*Begin)]; if (Begin + TrailingBytes < End) { // First decode the UTF-8 character @@ -424,7 +424,7 @@ inline std::size_t Unicode::GetUTF8Length(In Begin, In End) std::size_t Length = 0; while (Begin < End) { - int NbBytes = UTF8TrailingBytes[*Begin]; + int NbBytes = UTF8TrailingBytes[static_cast(*Begin)]; if (Begin + NbBytes < End) ++Length; diff --git a/src/SFML/System/Unicode.cpp b/src/SFML/System/Unicode.cpp index 0b5345278..f921b5001 100644 --- a/src/SFML/System/Unicode.cpp +++ b/src/SFML/System/Unicode.cpp @@ -78,7 +78,7 @@ namespace sf //////////////////////////////////////////////////////////// // Static member data //////////////////////////////////////////////////////////// -const char Unicode::UTF8TrailingBytes[256] = +const int Unicode::UTF8TrailingBytes[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,