PDA

View Full Version : Text parsing problem in arabic language..


saji09
09-05-2009, 03:56 AM
The problem im facing is mentioned in detail below and kindly check the attached screenshot to get clear idea what im talking about...


When arabic posted on an English forum ---> Shows first half of image
When arabic posted on an Arabic Forum --> Shows Second half of the image

My only concern is, where is the point from where i could figure out vbulletin is differentiating and inserting content in the threads, postparsed and post table.... There must a check or something which seprating the output...


What i have tested and found is that when text entered from charset=ISO-8859-1 format, which is basically english version of forum, no matter i paste arabic in the editor its wel encoded [DESIRED]

but when i change the language of the forum it set charset=windows-1256, Which ends up producing unicode and stuff when i paste an arabic text in the new thread or post [NOT DESIRED].

Any one who solve this problem is a When arabic posted on an English forum ---> Shows first half of image
When arabic posted on an Arabic Forum --> Shows Second half of the image

My only concern is, where is the point from where i could figure out vbulletin is differentiating and inserting content in the threads, postparsed and post table.... There must a check or something which seprating the output...


What i have tested and found is that when text entered from charset=ISO-8859-1 format, which is basically english version of forum, no matter i paste arabic in the editor its wel encoded [DESIRED]

but when i change the language of the forum it set charset=windows-1256, Which ends up producing unicode and stuff when i paste an arabic text in the new thread or post [NOT DESIRED].

Any one who solve this problem is a GENIUS :)

saji09
09-06-2009, 07:28 AM
use iconv("windows-1256", "UTF-8",$text);

by default iconv is available in php5.x

you can also download php_iconv.dll or iconv.dll and place it in php/extensions

your problem will be solved, but make sure your browser encoding in charset=utf-8 and if you are quering from database its not setting charset like mysql_set_charset('utf8');


Rest its working like charm :)

JesWhite
01-05-2016, 07:20 AM
use iconv("windows-1256", "UTF-8",$text);

by default iconv is available in php5.x

you can also download php_iconv.dll or iconv.dll and place it in php/extensions

your problem will be solved, but make sure your browser encoding in charset=utf-8 and if you are quering from database its not setting charset like mysql_set_charset('utf8');


Rest its working like charm :)

hii..
i have a problem like you...
if i add an ascii code, ascii code changing to recording to mysql...
how can i fix it?