From: Tomas K. <to...@us...> - 2007-01-22 17:35:40
|
> patch can extracts charset in subject, when charset Does not exist. > > languages.php <- patch //charset extracts in the subject > > function charsetSub($sub){ > $a =3D explode('=3D?', $sub, 2); > $b =3D explode('?B?', $a[1]); > $charset =3D strtolower($b[0]); > return $charset; > } Use preg_match. Headers can use B or Q encodings or some other encoding unspecified in rfc2047. Please note that header can contain multiple atoms with different charset= s. > global $message; > $charset =3D strtolower($charset); > if (!$charset) > $charset =3D charsetSub($message->rfc822_header->subject); > > > compose.php <- patch //input charset in compose > > // charset encoding in compose form stuff > if (isset($body_part_entity->header->parameters['charset'])) { > $actual =3D $body_part_entity->header->parameters['charset']; > } else { > $actual =3D charsetSub($message->rfc822_header->subject); > } RFC 822 and RFC2045 If charset is not set, it is US-ASCII. Any other value violates rfcs 2045-2048. --=20 Tomas |