Free Music - Loans - Credit Counseling - Cheap Flights - Personal Finance

PDA

View Full Version : Arabic character encoding problem


rajeeshvr
Oct 31st 2007, 11:06 pm
Hi All,

I have a problem in arabic emails.The arabic emails are not encoding properly.I am a PHP developer, I am using MIME version 1.0 and passing the charset as UTF-8 but the arabic characters not encoding properly.For example,

عزيزي عضو كليبسر

الفيديو الذي قمت بتحميله قد حُذف بواسطة المدير
Title : wewewew
وجد المدير في هذا الفيديو بأنه غير لائق (ملاءم)

you can see the problem .CAN ANYONE CAN HELP ME TO SOLVE THIS PROBLEM !!!! ITS VERY VERY VERY URGENT.........

Fka200
Nov 1st 2007, 2:46 pm
Try Windows-1256

justforlebanon
Nov 1st 2007, 3:04 pm
TRY UNICODE
it will work

rajeeshvr
Nov 14th 2007, 9:28 pm
I used the function for diffrent character encoding

function getheader($user_id=""){
global $ADMIN_ID;
$headers = "MIME-Version: 1.0" . "\r\n";
if($user_id!=""){
$strqry="select langid from user,language where
users.maillang=language.langid and language.langstatus ='1' and users.user_id='".$user_id."'";
$rsquery=mysql_query($strqry,$this->link);
if($rwsquery=mysql_fetch_array($rsquery)){
$lang_id=strtolower($rwsquery["langid"]);
if($langid==17 || $langid==20 || $langid==22){
$headers .= "Content-type:text/html;charset=UTF-8;" . "\r\n";
$headers .= "content-Transfer-encoding: 8bit" ."\r\n";
}
else if($langid==19){
$headers .= "Content-type:text/html;charset=Shift_JIS;" . "\r\n";
$headers .= "content-Transfer-encoding: 8bit" ."\r\n";
}
else if($langid==21){
$headers .= "Content-type:text/html;charset=GB2312;" . "\r\n";
$headers .= "content-Transfer-encoding: 8bit" ."\r\n";
}
else{
$headers .= "Content-type:text/html;charset=UTF-8;" . "\r\n";
$headers .= "content-Transfer-encoding: 8bit" ."\r\n";
}
}
}
else{
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= "content-Transfer-encoding: 8bit" ."\r\n";
}
$headers .= 'From: <'.$ADMIN_ID.'>' . "\r\n";
return $headers;
}

instead of UTF-8 I also used windows-1256, but it doesn't worked. Please help me to solve the problem....

Fka200
Nov 14th 2007, 9:56 pm
From what I understand you are receiving e-mails in Arabic and can't view them.

Just go to View > Encoding > Change to UTF-8 or Windows 1256. It's one of those that'll work.

rajeeshvr
Nov 21st 2007, 8:03 pm
I have go the emails , but they are some special characters.They can't read properly.The arabic characters are listed from a php script file in which some variables are defined, I am using these variables for each language.For all other languages its working properly, but for arabic it doesn't encoding properly.Here is the email that I got,

عزيزي عضو كليبسر
بخصوص بطلبك عن التلويح بعلم للفيديو

وافقنا بطلبك عن التلويح بعلم للفيديو بأنه غير لائق
نترقب المزيد من دعمك في المستقبل

تحيات

the subject is also like this.I tried another mail function which will convert all characters to the UTF-8 encoding it works fine in gmail but not in yahoo and hotmail.

please help me.

ashrafweb
Jan 7th 2008, 1:52 am
i face the same problem with my pages
see this >> http://www.e-msjed.com/msjed/site/

houssem-hj
Feb 27th 2008, 2:42 pm
Try to receive your emails with outlook Express.. not by web mail.

And add the Arabic language from your setting->Control Panel (if it's not done).

ashrafweb
Mar 16th 2008, 1:46 am
thank u all!!!

farhajr
Apr 18th 2008, 12:39 pm
their is one more easier way and that is install windows with arabic enabled and that would certainly give you the option to check in arabic or the normal english

UltimA-
Apr 18th 2008, 12:47 pm
Insert your windows CD , Install the Arabic Language and everything will be Fine