lib/icu/CaseFold: remove Windows implementation

Reverts commit fb3564fbe7

LCMapStringEx() doesn't do what I imagined it would do 5 years ago.
D'oh!

Closes https://github.com/MusicPlayerDaemon/MPD/issues/820
This commit is contained in:
Max Kellermann 2020-04-22 19:30:16 +02:00
parent a5273d6992
commit 3b0f8d5516
3 changed files with 3 additions and 25 deletions

2
NEWS
View File

@ -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

View File

@ -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

View File

@ -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"