Announcement

Announcement Module
Collapse
No announcement yet.

Arabic Language & UTF-8

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Arabic Language & UTF-8

    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?

  • #2
    <Moved to Languages forum>

    Not sure if I can help much with this, but if it worked great with windows-1256 why change it?
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      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

      Comment


      • #4
        Admin CP -> Languages & Phrases -> Language Manager -> Edit Settings
        Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
        Change CKEditor Colors to Match Style (for 4.1.4 and above)

        Steve Machol Photography


        Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


        Comment


        • #5
          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.
          Last edited by m0h; Thu 16th Sep '04, 4:25pm.

          Comment


          • #6
            Sorry I have no idea how to do that. Perhaps someone else will.
            Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
            Change CKEditor Colors to Match Style (for 4.1.4 and above)

            Steve Machol Photography


            Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


            Comment


            • #7
              converting text from one character set to another isn't that easy.

              Do you have the iconv extension installed in PHP?
              Scott MacVicar

              My Blog | Twitter

              Comment


              • #8
                Nope, but I'll install it now.

                Comment


                • #9
                  Its now installed, what is the next step?

                  Comment


                  • #10
                    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 Code:
                    <?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>

                    Comment


                    • #11
                      umm, looks like this was so simple!
                      All I need was
                      Code:
                      iconv -f windows-1256 -t utf-8 vbulletin-language.xml > vbulletin-language-new.xml
                      And at last its now working

                      Thanx everyone for your help

                      Comment


                      • #12
                        Originally posted by m0h
                        umm, looks like this was so simple!
                        All I need was
                        Code:
                        iconv -f windows-1256 -t utf-8 vbulletin-language.xml > vbulletin-language-new.xml
                        And at last its now working

                        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"

                        Comment


                        • #13
                          I want to know how could you execute this command:
                          Code:
                          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.
                          Sorry for my weak English.
                          My aim is to become PHP Developer.

                          Comment


                          • #14
                            Originally posted by PHP Dev
                            I want to know how could you execute this command:
                            Code:
                            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

                            Comment


                            • #15
                              Originally posted by m0h View Post
                              umm, looks like this was so simple!
                              All I need was
                              Code:
                              iconv -f windows-1256 -t utf-8 vbulletin-language.xml > vbulletin-language-new.xml
                              And at last its now working

                              Thanx everyone for your help
                              Hi,

                              I want to know where I should write this command line ? in which file ?

                              Thanks,

                              Comment

                              Working...
                              X