diff --git a/include/SFML/System/Utf.inl b/include/SFML/System/Utf.inl index f01ba7a2..02211135 100644 --- a/include/SFML/System/Utf.inl +++ b/include/SFML/System/Utf.inl @@ -657,28 +657,11 @@ Out Utf<32>::toUtf32(In begin, In end, Out output) template std::uint32_t Utf<32>::decodeAnsi(In input, [[maybe_unused]] const std::locale& locale) { - // On Windows, GCC's standard library (glibc++) has almost - // no support for Unicode stuff. As a consequence, in this - // context we can only use the default locale and ignore - // the one passed as parameter. - -#if defined(SFML_SYSTEM_WINDOWS) && /* if Windows ... */ \ - (defined(__GLIBCPP__) || defined(__GLIBCXX__)) && /* ... and standard library is glibc++ ... */ \ - !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) /* ... and STLPort is not used on top of it */ - - wchar_t character = 0; - mbtowc(&character, &input, 1); - return static_cast(character); - -#else - // Get the facet of the locale which deals with character conversion const auto& facet = std::use_facet>(locale); // Use the facet to convert each character of the input string return static_cast(facet.widen(input)); - -#endif } @@ -700,25 +683,6 @@ std::uint32_t Utf<32>::decodeWide(In input) template Out Utf<32>::encodeAnsi(std::uint32_t codepoint, Out output, char replacement, [[maybe_unused]] const std::locale& locale) { - // On Windows, gcc's standard library (glibc++) has almost - // no support for Unicode stuff. As a consequence, in this - // context we can only use the default locale and ignore - // the one passed as parameter. - -#if defined(SFML_SYSTEM_WINDOWS) && /* if Windows ... */ \ - (defined(__GLIBCPP__) || defined(__GLIBCXX__)) && /* ... and standard library is glibc++ ... */ \ - !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) /* ... and STLPort is not used on top of it */ - - char character = 0; - if (wctomb(&character, static_cast(codepoint)) >= 0) - *output++ = character; - else if (replacement) - *output++ = replacement; - - return output; - -#else - // Get the facet of the locale which deals with character conversion const auto& facet = std::use_facet>(locale); @@ -726,8 +690,6 @@ Out Utf<32>::encodeAnsi(std::uint32_t codepoint, Out output, char replacement, [ *output++ = facet.narrow(static_cast(codepoint), replacement); return output; - -#endif }