Commit f445b017 authored by Max Kellermann's avatar Max Kellermann

TagString: remove ISO-Latin-1 fallback

MPD handles all strings in UTF-8 internally. Those decoders which read Latin-1 tags are supposed to implement the conversion, instead of passing Latin-1 to TagBuilder::AddItem(). FixTagString() is simply the wrong place to do that, and hard-coding Latin-1 is kind of arbitrary.
parent f618065f
...@@ -69,6 +69,7 @@ ver 0.19 (not yet released) ...@@ -69,6 +69,7 @@ ver 0.19 (not yet released)
- allow playlist directory without music directory - allow playlist directory without music directory
- use XDG to auto-detect "music_directory" and "db_file" - use XDG to auto-detect "music_directory" and "db_file"
* add tags "AlbumSort", "MUSICBRAINZ_RELEASETRACKID" * add tags "AlbumSort", "MUSICBRAINZ_RELEASETRACKID"
* disable global Latin-1 fallback for tag values
* new resampler option using libsoxr * new resampler option using libsoxr
* ARM NEON optimizations * ARM NEON optimizations
* install systemd unit for socket activation * install systemd unit for socket activation
......
...@@ -52,8 +52,6 @@ static char * ...@@ -52,8 +52,6 @@ static char *
fix_utf8(const char *str, size_t length) fix_utf8(const char *str, size_t length)
{ {
const gchar *end; const gchar *end;
char *temp;
gsize written;
assert(str != nullptr); assert(str != nullptr);
...@@ -61,18 +59,7 @@ fix_utf8(const char *str, size_t length) ...@@ -61,18 +59,7 @@ fix_utf8(const char *str, size_t length)
if (g_utf8_validate(str, length, &end)) if (g_utf8_validate(str, length, &end))
return nullptr; return nullptr;
/* no, it's not - try to import it from ISO-Latin-1 */ /* no, broken - patch invalid sequences */
temp = g_convert(str, length, "utf-8", "iso-8859-1",
nullptr, &written, nullptr);
if (temp != nullptr) {
/* success! */
char *p = xstrdup(temp);
g_free(temp);
return p;
}
/* no, still broken - there's no medication, just patch
invalid sequences */
return patch_utf8(str, length, end); return patch_utf8(str, length, end);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment