summaryrefslogtreecommitdiff
path: root/junklib.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-01-05 17:49:52 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-01-05 17:51:45 +0100
commit0cfcbe2bf6531b70c7213dbb4893d6333b61e7ed (patch)
tree90f2d36a60ee1d9486264b682b25396a50a155d6 /junklib.c
parenta66c46305373f8e66655777298051a506b2e8cf0 (diff)
invalid cuesheet lines are replaced with placeholders; added shift-jis recoding to cuesheet parser
Diffstat (limited to 'junklib.c')
-rw-r--r--junklib.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/junklib.c b/junklib.c
index b4962c2d..1c57ba6e 100644
--- a/junklib.c
+++ b/junklib.c
@@ -483,7 +483,7 @@ junk_iconv (const char *in, int inlen, char *out, int outlen, const char *cs_in,
int err = errno;
iconv_close (cd);
- //trace ("iconv -f %s -t %s '%s': returned %d, inbytes %d/%d, outbytes %d/%d, errno=%d\n", cs_in, cs_out, in, res, inlen, inbytesleft, outlen, outbytesleft, err);
+ //trace ("iconv -f %s -t %s '%s': returned %d, inbytes %d/%d, outbytes %d/%d, errno=%d\n", cs_in, cs_out, in, (int)res, inlen, (int)inbytesleft, outlen, (int)outbytesleft, err);
if (res == -1) {
return -1;
}
@@ -3522,18 +3522,21 @@ junk_id3v2_read (playItem_t *it, DB_FILE *fp) {
const char *
junk_detect_charset (const char *s) {
+ size_t len = strlen (s);
+
// check if that's already utf8
- if (u8_valid (s, strlen (s), NULL)) {
+ if (u8_valid (s, len, NULL)) {
return NULL; // means no recoding required
}
// hack to add cp936 support
- if (can_be_chinese (s, strlen (s))) {
+ if (can_be_chinese (s, len)) {
return "cp936";
}
// check if that could be non-latin1 (too many nonascii chars)
- if (can_be_russian (s, strlen (s))) {
+ if (can_be_russian (s, len)) {
return "cp1251";
}
+
return "cp1252";
}