Fallback for failed recoding added.
This commit is contained in:
parent
473c968cb3
commit
5d5d96f002
1 changed files with 4 additions and 1 deletions
|
@ -128,7 +128,10 @@ function addMdata($key, $val, $iEnc='iso-8859-1'){
|
||||||
$oEnc = 'UTF-8';
|
$oEnc = 'UTF-8';
|
||||||
if(function_exists('iconv') && $iEnc != $oEnc){
|
if(function_exists('iconv') && $iEnc != $oEnc){
|
||||||
$data = $r = @iconv($iEnc, $oEnc, $data);
|
$data = $r = @iconv($iEnc, $oEnc, $data);
|
||||||
if($r === FALSE) die("Recoding metadata to unicode failed.");
|
if($r === FALSE){
|
||||||
|
echo "Warning: convert $key data to unicode failed\n";
|
||||||
|
$data = $val; // fallback
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if($key == $titleKey) $titleHaveSet = TRUE;
|
if($key == $titleKey) $titleHaveSet = TRUE;
|
||||||
$mdata[$key] = trim($data);
|
$mdata[$key] = trim($data);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue