diff --git a/src/FileListPage.cxx b/src/FileListPage.cxx index 3cc6e7ed..dbb8cdfe 100644 --- a/src/FileListPage.cxx +++ b/src/FileListPage.cxx @@ -105,7 +105,7 @@ FileListPage::LoadPlaylist(struct mpdclient &c, if (mpd_run_load(connection, mpd_playlist_get_path(&playlist))) { const char *name = GetUriFilename(mpd_playlist_get_path(&playlist)); FmtAlert(_("Loading playlist '{}'"), - Utf8ToLocaleZ{name}.c_str()); + (std::string_view)Utf8ToLocale{name}); c.events |= MPD_IDLE_QUEUE; } else diff --git a/src/charset.hxx b/src/charset.hxx index f370d680..00044ba7 100644 --- a/src/charset.hxx +++ b/src/charset.hxx @@ -117,32 +117,10 @@ public: #ifdef HAVE_ICONV -using Utf8ToLocaleZ = Utf8ToLocale; using LocaleToUtf8Z = LocaleToUtf8; #else -/** - * Like #Utf8ToLocaleZ, but return a null-terminated string. - */ -class Utf8ToLocaleZ { - const char *const value; - -public: - [[nodiscard]] - explicit constexpr Utf8ToLocaleZ(const char *src) noexcept - :value(src) {} - - [[nodiscard]] - explicit Utf8ToLocaleZ(const std::string &src) noexcept - :Utf8ToLocaleZ(src.c_str()) {} - - [[nodiscard]] [[gnu::pure]] - constexpr const char *c_str() const noexcept { - return value; - } -}; - /** * Like #LocaleToUtf8Z, but return a null-terminated string. */