Commit a75fd2d8 authored by stimpy's avatar stimpy

fixed iconv compatibility checks

parent 0ebd9c98
......@@ -214,8 +214,10 @@
break;
}
if ( $chrs != 'UTF-8' ) {
if ( ( $msg['SUBJECT'][0] = @iconv( $chrs, 'UTF-8', $msg['SUBJECT'][0] ) ) === false ) {
$msg['SUBJECT'][0] = $msg['SUBJECT'][0];
if ( ( $iconv = @iconv( $chrs, 'UTF-8', $msg['SUBJECT'][0] ) ) !== false ) {
$msg['SUBJECT'][0] = $iconv;
} else {
$iconv = false;
}
}
//if ( $chrs != 'UTF-8' ) $msg['SUBJECT'][0] = iconv( $chrs, 'UTF-8', $msg['SUBJECT'][0] );
......@@ -279,8 +281,10 @@
fseek( $fp, $ret['header']['offset'] );
$ret['text'] = fread( $fp, $ret['header']['txtlen'] );
if ( $chrs != 'UTF-8' ) {
if ( ( $ret['text'] = @iconv( $chrs, 'UTF-8', $ret['text'] ) ) === false ) {
$ret['text'] = $ret['text'];
if ( ( $iconv = @iconv( $chrs, 'UTF-8', $ret['text'] ) ) !== false ) {
$ret['text'] = $iconv;
} else {
$iconv = false;
}
}
//$ret['text'] = iconv( $chrs, 'UTF-8', fread( $fp, $ret['header']['txtlen'] ) );
......
......@@ -214,8 +214,10 @@
break;
}
if ( $chrs != 'UTF-8' ) {
if ( ( $msg['SUBJECT'][0] = @iconv( $chrs, 'UTF-8', $msg['SUBJECT'][0] ) ) === false ) {
$msg['SUBJECT'][0] = $msg['SUBJECT'][0];
if ( ( $iconv = @iconv( $chrs, 'UTF-8', $msg['SUBJECT'][0] ) ) !== false ) {
$msg['SUBJECT'][0] = $iconv;
} else {
$iconv = false;
}
}
//if ( $chrs != 'UTF-8' ) $msg['SUBJECT'][0] = iconv( $chrs, 'UTF-8', $msg['SUBJECT'][0] );
......@@ -279,8 +281,10 @@
fseek( $fp, $ret['header']['offset'] );
$ret['text'] = fread( $fp, $ret['header']['txtlen'] );
if ( $chrs != 'UTF-8' ) {
if ( ( $ret['text'] = @iconv( $chrs, 'UTF-8', $ret['text'] ) ) === false ) {
$ret['text'] = $ret['text'];
if ( ( $iconv = @iconv( $chrs, 'UTF-8', $ret['text'] ) ) !== false ) {
$ret['text'] = $iconv;
} else {
$iconv = false;
}
}
//$ret['text'] = iconv( $chrs, 'UTF-8', fread( $fp, $ret['header']['txtlen'] ) );
......
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