FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » FUDforum 3.0+ » Problems charset
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Problems charset [message #164488 is a reply to message #164444] Thu, 10 February 2011 02:45 Go to previous messageGo to previous message
rover_scan is currently offline  rover_scan   
Messages: 31
Registered: January 2010
Karma:
Member

I partially solved the problem.
The file scripts_common.inc

if (function_exists('iconv_mime_decode')) {
		return iconv_mime_decode(trim($val), 2);

to
	if (function_exists('iconv_mime_decode')) {
		return iconv_mime_decode(trim($val), 2, $GLOBALS['CHARSET']);


In file mime_decode.inc
	function fetch_useful_headers() {
include_once "detect_cyr_charset.php";	// include detect charset script (in attachment)		

// if script return charset ISO - nothing encoding
if ((detect_cyr_charset($this->headers['subject'])=="i")) {
$this->subject = htmlspecialchars(trim($this->headers['subject']));
}	
elseif((detect_cyr_charset($this->headers['subject'])=="m"))  // if charset MAC - i dont know 
{ $this->subject = "Decode subject faild :(";
}
else   
{ $this->subject = decode_string((htmlspecialchars(trim($this->headers['subject']))), $this->headers['content-transfer-encoding'], $this->headers['__other_hdr__']['content-type']['charset']);
}



I do not quite understand how this "Hindu Code" works. But it works! Smile
About 80% "$ this-> headers ['subject']" is decoded normally.

There is a way to make it better?

[Updated on: Thu, 10 February 2011 03:15]

Report message to a moderator

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Removing Multiple "re: " in subject lines
Next Topic: Time/Date Formatting
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu May 09 02:51:07 GMT 2024

Total time taken to generate the page: 0.05161 seconds