summaryrefslogtreecommitdiff
path: root/plugins/dumb
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-05-04 21:58:26 +0200
committerGravatar waker <wakeroid@gmail.com>2011-05-04 21:58:26 +0200
commit0532ff9092e227f63e3253cd3ca1a52b962c22e1 (patch)
treeec0e653376d7fb972f6561ab4af321651e96de3a /plugins/dumb
parent77c11540be556d42244d3a43cd03c99ad880891a (diff)
fixed charset detection in dumb plugin
Diffstat (limited to 'plugins/dumb')
-rw-r--r--plugins/dumb/cdumb.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/dumb/cdumb.c b/plugins/dumb/cdumb.c
index dae92e77..e85ce37a 100644
--- a/plugins/dumb/cdumb.c
+++ b/plugins/dumb/cdumb.c
@@ -706,13 +706,14 @@ convstr (const char* str, int sz, char *out, int out_sz) {
return out;
}
- // check for utf8 (hack)
- if (deadbeef->junk_iconv (str, sz, out, out_sz, "utf-8", "utf-8") >= 0) {
- return out;
+ const char *cs = deadbeef->junk_detect_charset (str);
+ if (!cs) {
+ return str;
}
-
- if (deadbeef->junk_iconv (str, sz, out, out_sz, "cp1252", "utf-8") >= 0) {
- return out;
+ else {
+ if (deadbeef->junk_iconv (str, sz, out, out_sz, cs, "utf-8") >= 0) {
+ return out;
+ }
}
trace ("cdumb: failed to detect charset\n");