Arabic (and other) characters on main Moodle page

Arabic (and other) characters on main Moodle page

by Mike Churchward -
Number of replies: 8
Picture of Core developers Picture of Plugin developers Picture of Testers

Hey Martin -

How are you getting the multi-lingual characters to display on the main Moodle page without changing the character encoding of the page? I had to create a special language set for my site, that forced the Arabic encoding for that to work. You seem to have it working using the default Western European (ISO) set.

mike

Average of ratings: -
In reply to Mike Churchward

Re: Arabic (and other) characters on main Moodle page

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The titles of courses (and also the name in the language packs) is made of NCR (numeric character references) ... you can see them in the source.

I create them using Mozilla like this:
- copy the text from a locally encoded page (eg arabic character set)
- switch to english mode
- paste the text into a form - Mozilla converts to NCR.
In reply to Martin Dougiamas

Re: Arabic (and other) characters on main Moodle page

by N Hansen -
Actually Martin, I use Arabic and I have my computer configured to type in Arabic and just doing some tests right now I can tell you there are several problems with the Arabic display.

1-Having Arabic on my own computer, I was able to create a course and write a description of it simply by changing to the Arabic keyboard rather than the English. No other special things required as you describe.

2-When I saved it, the title did change to numeric characters, but the description in the html editor stayed in Arabic.

3-When I viewed this course title and its description, it appeared perfectly in Arabic.

4-The course title for the Arabic course on your page appears correctly. However, the teacher and the description do not appear properly at all. They appear in the ASCII characters in the Western European character set that correspond to the Arabic characters in the Arabic ASCII set.

5-I have my computer set up so that the default ASCII character set is the Arabic one. This suggests to me that anything entered into the html editor is entered as ASCII based on the default ASCII set for the computer on which they are entered and that this is why the Arabic is corrupted on the Moodle course listing page.

6-Now, if I try to create a message post in a forum in Arabic, the subject somehow gets corrupted and a semicolon is inserted in between the letters. The message itself is fine (being made in the html editor with the proper ASCII set enabled). Looking at the Arabic forum, I notice no subjects in Arabic, which makes me wonder if it is even possible at all to create a proper subject line in Arabic.

7-Another point, I don't have the CJK languages enabled on this computer in the Windows settings. Therefore the name of the Chinese Moodle course simply appears as ????. On my work computer someone must have enabled these languages and it appears in Chinese. The same problem probably could happen with Arabic or other RTL languages if RTL languages were not enabled as well.
In reply to N Hansen

Re: Arabic (and other) characters on main Moodle page

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Text entered in Moodle is usually in the character set that the current language defines. There are exceptions for certain characters and the browser plays a part in this.  Arabic posts and subject lines work fine for me as long as the site or course is set to Arabic.

Arabic works on Windows without extra fonts, I think, but Chinese needs to be installed. One must assume that people interested in Chinese would have Chinese fonts installed. wink

Part of the problems here will be fixed when we move to Unicode, but part of it is simply because the world has not got its act together yet over all these complex international issues.
In reply to N Hansen

Re: Arabic (and other) characters on main Moodle page

by A. Mutawa -

I had a simillar problem but was solved when I used en_ar language pack (English -Arabic) this will use the "charset=windows-1256" as your character set for the mainpage. It solved all my problems because Arabic text will show in Arabic even when using the English view!! 

I'm including the language pack with this post, you can add it to your moodle directory under languages, I hope Martin will include it with the other language pack at moodle.org

In reply to Martin Dougiamas

Re: Arabic (and other) characters on main Moodle page

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Ah. Thanks.
In reply to Mike Churchward

Re: Arabic (and other) characters on main Moodle page

by Mohammad Azhar -

i have a working site bilingual Arabic & English, i always prefer using charset=windows1256 for displaying arabic

http://walu.lootah.com

In reply to Mohammad Azhar

Re: Arabic (and other) characters on main Moodle page

by Ahmed Metwally -

Dear Mutawa and Martin,

I have used this language pack (en-ar) in my moodle 1.5.4 and it was working perfect for me. But after moving to 1.7.2 and migrating the database to UTF-8, it asked me after the process ended to add this pack en_ar_utf8, which is not included within the available language packs in moodle site. As a result, all my Arabic courses become corrupted and unreadable. So, I urgently need the this language pack to retrieve my courses or if there is any other solution to resolve this situation. Please it is a production site!!!

 

In reply to Ahmed Metwally

Re: Arabic (and other) characters on main Moodle page

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
The ar-en language pack is not a sollution, since you converted to utf8. The ar language pack in Moodle 1.6 and onwards is utf8, so that is the one you need.

The language pack in the pre-utf8 Moodleversions had a charset=windows-1256, so the conversion should run fine.

I suggest to
  • Set the codebase back to your 1.5.4
  • Restore your database backup so your 1.5.4 is back up and running
  • Change site language, all forced course languages and user languages (use an SQL statement for this wink ) to the regular 1.5.4 arab language where applicable and check if everything works fine.
  • Replace your codebase with a 1.6 or a 1.7 and perform the upgrade/migration
One last thing: don't do tests for upgrade/migration on your production server - this process changes the content of your database dramatically and should be tested thoroughly prior to perform on production servers.