diff --git a/NEWS b/NEWS index ac5656a6b..198302b20 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ ver 0.21.23 (not yet released) - alsa: implement channel mapping for 5.0 and 7.0 * player - drain outputs at end of song in "single" mode +* Windows + - fix case insensitive search ver 0.21.22 (2020/04/02) * database diff --git a/src/lib/icu/CaseFold.cxx b/src/lib/icu/CaseFold.cxx index 8ad8dadfa..e7cf5ba26 100644 --- a/src/lib/icu/CaseFold.cxx +++ b/src/lib/icu/CaseFold.cxx @@ -36,11 +36,6 @@ #include <ctype.h> #endif -#ifdef _WIN32 -#include "Win32.hxx" -#include <windows.h> -#endif - #include <memory> #include <assert.h> @@ -72,25 +67,6 @@ try { folded.SetSize(folded_length); return UCharToUTF8({folded.begin(), folded.size()}); -#elif defined(_WIN32) - const auto u = MultiByteToWideChar(CP_UTF8, src); - - const int size = LCMapStringEx(LOCALE_NAME_INVARIANT, - LCMAP_SORTKEY|LINGUISTIC_IGNORECASE, - u.c_str(), -1, nullptr, 0, - nullptr, nullptr, 0); - if (size <= 0) - return AllocatedString<>::Duplicate(src); - - std::unique_ptr<wchar_t[]> buffer(new wchar_t[size]); - if (LCMapStringEx(LOCALE_NAME_INVARIANT, - LCMAP_SORTKEY|LINGUISTIC_IGNORECASE, - u.c_str(), -1, buffer.get(), size, - nullptr, nullptr, 0) <= 0) - return AllocatedString<>::Duplicate(src); - - return WideCharToMultiByte(CP_UTF8, buffer.get()); - #else #error not implemented #endif diff --git a/src/lib/icu/CaseFold.hxx b/src/lib/icu/CaseFold.hxx index 828415b9b..13a517e0a 100644 --- a/src/lib/icu/CaseFold.hxx +++ b/src/lib/icu/CaseFold.hxx @@ -22,7 +22,7 @@ #include "config.h" -#if defined(HAVE_ICU) || defined(_WIN32) +#ifdef HAVE_ICU #define HAVE_ICU_CASE_FOLD #include "util/Compiler.h"