View Full Version : Arabic Language & UTF-8
m0h
Thu 16th Sep '04, 5:22pm
Hello,
I have been trying all day to add arabic language support to my forum, my problem is that I'm using UTF-8 and the Arabic language file I'm using is set to use windows-1256 so after I install the language file it works great if I use the encoding windows-1256 but when I change back to UTF-8 all the Arabic text get messed up!
Any ideas?
Steve Machol
Thu 16th Sep '04, 5:25pm
<Moved to Languages forum>
Not sure if I can help much with this, but if it worked great with windows-1256 why change it?
m0h
Thu 16th Sep '04, 5:32pm
Bec. most of my users are linux users, windows-1256 is not some thing they like :)
Also bec. changing the encoding will break my old posts.
I think I'll have to change the encoding of the language file to utf-8, but I'm not sure how to do that!
Thanx :)
Steve Machol
Thu 16th Sep '04, 9:03pm
Admin CP -> Languages & Phrases -> Language Manager -> Edit Settings
m0h
Thu 16th Sep '04, 9:21pm
Thanx for your reply :)
My problem is that the text of the Arabic language is stored in my database in the windows-1256 format so what I need to do it to convert it to uft-8, either convert the language data in my database or the language file then readd it.
Steve Machol
Thu 16th Sep '04, 10:34pm
Sorry I have no idea how to do that. Perhaps someone else will.
Scott MacVicar
Thu 16th Sep '04, 10:48pm
converting text from one character set to another isn't that easy.
Do you have the iconv extension installed in PHP?
m0h
Fri 17th Sep '04, 1:01pm
Nope, but I'll install it now.
m0h
Fri 17th Sep '04, 3:20pm
Its now installed, what is the next step?
m0h
Fri 17th Sep '04, 5:22pm
Ok, I make a test file to convert the phrase in the database to utf-8 using iconv, it worked and the phrases are no converted, but still the text is messed up! is there any thing else I should do?
Thanx :)
<?php
include("commen.php");
$dbcnx = dbConnect("linuxeg_vbulliten");
$do =50;
$TutList = mysql_query("SELECT text,phraseid FROM `phrase` WHERE languageid =9 LIMIT $start , $do");
$start=$start+$do;
while ( $row = mysql_fetch_array($TutList) ) {
$text = $row["text"];
$phraseid = $row["phraseid"];
$ntext = iconv("windows-1256", "UTF-8", $text);
mysql_query("UPDATE `phrase` SET text = '$ntext' where phraseid = $phraseid");
echo mysql_error();
echo "$ntext <br>";
}
?>
<script type="text/javascript">
window.location="test.php?do=<?=$do?>&start=<?=$start?>";
</script>
m0h
Fri 17th Sep '04, 5:43pm
umm, looks like this was so simple!
All I need was
iconv -f windows-1256 -t utf-8 vbulletin-language.xml > vbulletin-language-new.xml
And at last its now working :cool:
Thanx everyone for your help :)
Bashar
Mon 21st Nov '05, 12:15pm
umm, looks like this was so simple!
All I need was
iconv -f windows-1256 -t utf-8 vbulletin-language.xml > vbulletin-language-new.xml
And at last its now working :cool:
Thanx everyone for your help :)
Perfect solution just tested it and works as charm :)
guess what this thread is the first hit for google when looking fir "convert windows-1256 to utf-8" ;)
PHP Dev
Fri 6th Jan '06, 4:54pm
I want to know how could you execute this command:
iconv -f windows-1256 -t utf-8 vbulletin-language.xml > vbulletin-language-new.xml
Does Iconv contain command line features, not just a PHP add-one.
I hope that you teel me how to do that step-by-step to make my translation for all, that located here:
http://www.vbulletin.com/forum/showthread.php?t=168064
It contain ALL vBulletin 3.x Arabic files.
Bashar
Fri 6th Jan '06, 6:19pm
I want to know how could you execute this command:
iconv -f windows-1256 -t utf-8 vbulletin-language.xml > vbulletin-language-new.xml
Does Iconv contain command line features, not just a PHP add-one.
I hope that you teel me how to do that step-by-step to make my translation for all, that located here:
http://www.vbulletin.com/forum/showthread.php?t=168064
It contain ALL vBulletin 3.x Arabic files. iconv is command line not php addon (atleast on freebsd boxes)
just try man iconv
Cyborg86
Sat 22nd Sep '07, 11:45am
umm, looks like this was so simple!
All I need was
iconv -f windows-1256 -t utf-8 vbulletin-language.xml > vbulletin-language-new.xml
And at last its now working :cool:
Thanx everyone for your help :)
Hi,
I want to know where I should write this command line ? in which file ?
Thanks,
Andy Huang
Sat 22nd Sep '07, 7:14pm
That is a linux shell command that you'd need to execute over ssh on your server, in the folder where vbulletin-language.xml is located.
Cobra-J82
Sun 4th May '08, 5:51pm
That is a linux shell command that you'd need to execute over ssh on your server, in the folder where vbulletin-language.xml is located.
Please can you be more specific, i have no idea wer to execute it like you said over the ssh on my server, what do you mean by that, and where is the vbulletin-language.xml located, keeping in mind my installation is all default location.
Thanks in advance.
Chousho
Sun 4th May '08, 7:22pm
Please can you be more specific, i have no idea wer to execute it like you said over the ssh on my server, what do you mean by that, and where is the vbulletin-language.xml located, keeping in mind my installation is all default location.
Thanks in advance.
Download PuTTY (http://www2.tropic.org.uk/%7Esgtatham/putty/download.html), connect to your server, go to the appropriate directory, enter text. If you're on shared hosting, you might have to ask your host to allow you to SSH in.
Cobra-J82
Sun 4th May '08, 7:27pm
Oh ok, but thanks
I went to Admin CP -> Languages & Phrases -> Language Manager -> Edit Settings For English like Steve said and change the HTML Charecter set from ISO to windows-1256, now Im able to view both languages with no corrupted charecters.
THanks anyway for help :)
Ba$im
Mon 12th May '08, 12:04am
just to make it clear for you
it will hurt your database if it work with latin_sw... and you are using utf-8 on your board
you must first convert collection of database to utf-8 then you will just change it from admin cp to utf-8
I did that on my forum
joomlajon
Mon 12th May '08, 4:13am
Is it possilbe to copy paste and save, then copy paste back via dreamweaver?
Subah
Mon 19th May '08, 12:42am
Good work :)
AlShammari
Mon 22nd Sep '08, 8:44pm
just type it in unix command line
vBulletin® v3.8.0 Beta 4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.