449 |
return(mb_convert_encoding($newvalue, "EUC-JP", "auto")); // parts |
return(mb_convert_encoding($newvalue, "EUC-JP", "auto")); // parts |
450 |
} else { |
} else { |
451 |
if (eregi('".*"',$value)) { // quoted-pair |
if (eregi('".*"',$value)) { // quoted-pair |
452 |
$newvalue=ereg_replace('(.*)"(.*)"(.*)','\1'.decode_quoted_pair('\2').'\3',$value); |
ereg('(.*)"(.*)"(.*)',$value,$vals); |
453 |
|
$newvalue = $vals[1].decode_quoted_pair($vals[2]).$vals[3]; |
454 |
return(mb_convert_encoding($newvalue, "EUC-JP", "auto")); |
return(mb_convert_encoding($newvalue, "EUC-JP", "auto")); |
455 |
} else { // there wasn't anything encoded, return the original string |
} else { // there wasn't anything encoded, return the original string |
456 |
return(mb_convert_encoding($value, "EUC-JP", "auto")); |
return(mb_convert_encoding($value, "EUC-JP", "auto")); |
459 |
} |
} |
460 |
|
|
461 |
function decode_quoted_pair($value) { |
function decode_quoted_pair($value) { |
462 |
return(ereg_replace('\\\\(.)','\1',$value)); |
return(ereg_replace('\\\\(.)',"\\1",$value)); |
463 |
} |
} |
464 |
|
|
465 |
function getTimestamp($value) { |
function getTimestamp($value) { |