Fix compilation with ICU >= 61
This commit is contained in:
1
NEWS
1
NEWS
@@ -5,6 +5,7 @@ ncmpcpp-0.8.2 (????-??-??)
|
|||||||
* Search engine now properly interacts with filtering
|
* Search engine now properly interacts with filtering
|
||||||
* Fixed redraw of separator after interface switch while MPD was stopped
|
* Fixed redraw of separator after interface switch while MPD was stopped
|
||||||
* Reset position of a window when fetching lyrics
|
* Reset position of a window when fetching lyrics
|
||||||
|
* Fixed compilation with ICU >= 61.
|
||||||
|
|
||||||
ncmpcpp-0.8.1 (2017-10-11)
|
ncmpcpp-0.8.1 (2017-10-11)
|
||||||
* Setting 'colors_enabled' to 'no' no longer results in a crash.
|
* Setting 'colors_enabled' to 'no' no longer results in a crash.
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ namespace {
|
|||||||
|
|
||||||
struct StripDiacritics
|
struct StripDiacritics
|
||||||
{
|
{
|
||||||
static void convert(UnicodeString &s)
|
static void convert(icu::UnicodeString &s)
|
||||||
{
|
{
|
||||||
if (m_converter == nullptr)
|
if (m_converter == nullptr)
|
||||||
{
|
{
|
||||||
ErrorCode result;
|
icu::ErrorCode result;
|
||||||
m_converter = Transliterator::createInstance(
|
m_converter = icu::Transliterator::createInstance(
|
||||||
"NFD; [:M:] Remove; NFC", UTRANS_FORWARD, result);
|
"NFD; [:M:] Remove; NFC", UTRANS_FORWARD, result);
|
||||||
if (result.isFailure())
|
if (result.isFailure())
|
||||||
throw std::runtime_error(
|
throw std::runtime_error(
|
||||||
@@ -58,10 +58,10 @@ struct StripDiacritics
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Transliterator *m_converter;
|
static icu::Transliterator *m_converter;
|
||||||
};
|
};
|
||||||
|
|
||||||
Transliterator *StripDiacritics::m_converter;
|
icu::Transliterator *StripDiacritics::m_converter;
|
||||||
|
|
||||||
#endif // BOOST_REGEX_ICU
|
#endif // BOOST_REGEX_ICU
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ inline bool search(const std::basic_string<CharT> &s,
|
|||||||
#ifdef BOOST_REGEX_ICU
|
#ifdef BOOST_REGEX_ICU
|
||||||
if (ignore_diacritics)
|
if (ignore_diacritics)
|
||||||
{
|
{
|
||||||
auto us = UnicodeString::fromUTF8(
|
auto us = icu::UnicodeString::fromUTF8(
|
||||||
StringPiece(convertString<char, CharT>::apply(s)));
|
StringPiece(convertString<char, CharT>::apply(s)));
|
||||||
StripDiacritics::convert(us);
|
StripDiacritics::convert(us);
|
||||||
return boost::u32regex_search(us, rx);
|
return boost::u32regex_search(us, rx);
|
||||||
|
|||||||
Reference in New Issue
Block a user