aboutsummaryrefslogtreecommitdiffstats
path: root/src/tag
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-10-10 20:53:08 +0200
committerMax Kellermann <max@duempel.org>2014-10-10 20:53:08 +0200
commitf445b0178ab84ec1484df9de4bd10663819efcc6 (patch)
tree96b949eccf116b57d0ef0d621114217327f172ff /src/tag
parentf618065f7c797aae190912295bbe5ff73760dbe1 (diff)
downloadmpd-f445b0178ab84ec1484df9de4bd10663819efcc6.tar.gz
mpd-f445b0178ab84ec1484df9de4bd10663819efcc6.tar.xz
mpd-f445b0178ab84ec1484df9de4bd10663819efcc6.zip
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.
Diffstat (limited to 'src/tag')
-rw-r--r--src/tag/TagString.cxx15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/tag/TagString.cxx b/src/tag/TagString.cxx
index 0c3868eb5..22fbfc0b8 100644
--- a/src/tag/TagString.cxx
+++ b/src/tag/TagString.cxx
@@ -52,8 +52,6 @@ static char *
fix_utf8(const char *str, size_t length)
{
const gchar *end;
- char *temp;
- gsize written;
assert(str != nullptr);
@@ -61,18 +59,7 @@ fix_utf8(const char *str, size_t length)
if (g_utf8_validate(str, length, &end))
return nullptr;
- /* no, it's not - try to import it from ISO-Latin-1 */
- 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 */
+ /* no, broken - patch invalid sequences */
return patch_utf8(str, length, end);
}