When I enter content I get only question marks

When I enter content I get only question marks

by michal shin -
Number of replies: 31
HI!
I try to enter content (not in english) and I get only question marks.
I think it's a problem in my db. I change it to utf-8, but still get the same reasolt.
anyone has an idea?
Average of ratings: -
In reply to michal shin

Re: When I enter content I get only question marks

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
What verson of Moodle?
In reply to Tim Hunt

Re: When I enter content I get only question marks

by Jake Kimball -

Tim,

I'm another user (rather new to Moodle but finding my way) but I just encountered the same problem mentioned above and I need to resolve it by the start of September.

Here's where I am. Hopefully you can help.

1) Whenever Korean characters are typed, I get "???" or sometimes more. I looked at other Korea-based Moodle sites and found none with this problem, but obviously the problem exists. I'm probably overlooking something.
 
a. I've upgraded to 1.6.1.
b. Both en and ko show up as language choices form the login menu
c. Interface settings are set at Korean yes, ko_utf8, en_utf8, yes, ko
d. Multi-language filter is active
e. "Filter all strings" is set to yes
 
Thanks,
 
Jake
In reply to Jake Kimball

Re: When I enter content I get only question marks

by R Guy -
Hmmm, just had the same problem in Japanese... any help to fix would be appreciated.
In reply to R Guy

Re: When I enter content I get only question marks

by Charalambos Vrasidas -

Hi guys,

I face a similar problem. I did an new installation of Moodle 1.6.1

When I write anythin in Greek and try to either same it, or create ana ssignment for students, or try to post to the forums, I only get  ??????????? question marks.

I used the language import utility and imported the Greek langauge.

Any ideas?

Also, if go to check missing strings, while i have English as the selcted language, it says it is ok. If I change the langauge to Greek from the pull down menu, and i check for missing strings, it gives me a complete list of strings missing.... Is there something i need to do here?

thank you all for your help

pambos

In reply to Charalambos Vrasidas

Re: All languages don't display right except English

by J. Chan -

Hello all,

I installed a new moodle of version 1.6+

Then, I installed the Chinese Language packs: zh_tw_utf8 and zh_tw.

The Chinese Traditional characters show in all menu and texts from all uploaded files into the language pack.

However, whenever I use the moodle editor to input any Chinese character, it only shows ?. When I enter text in English, it displays fine. The modules include editors in editing a topic in course, scheduler or appointment, quiz or test, assignment, forum, ...etc.

The operation settings were set to allow multilanguage as all the other users  in the previous message.

Does the moodle 1.6 built-in editor actually NOT support UTF input? or does it NOT recognise the input as UTF?

I have installed two moodles 1.5.3 before on another two servers, and they worked fine with Chinese Traditional Characters input. Here below is some test, please see 試驗.... does this show in Chinese Character? It means "test".

Any ideas?

It's quite urgent!

In reply to J. Chan

Re: All languages don't display right except English

by Charalambos Vrasidas -

Hi james,

I experience the same problem with Greek language. I am waiting to hear from a database expert. I was advised that it has to do something with the collations of MySQL database and they need to be set to support UTF8. Not sure ... waiting to resolve it. If I have any further news, will share

 

regards

 

pambos

In reply to Charalambos Vrasidas

Re: All languages don't display right except English

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
If you look at http://docs.moodle.org/en/Installing_Moodle, you can read that the default charset and the collation for the database must be set to utf8 for new installations. For existing installations, running the migration script should change that to the correct setting. If you are upgrading from an existing installation, make sure your server meets the specs and the migration script finnishes succesfully (otherwise restart the script after the processor activity of your server drops) See also http://docs.moodle.org/en/Upgrading_to_Moodle_1.6
In reply to koen roggemans

Re: All languages don't display right except English

by J. Chan -

Hi, Koen,

Thanks for the reply. I read the information on both :

http://docs.moodle.org/en/Installing_Moodle

and

http://docs.moodle.org/en/Upgrading_to_Moodle_1.6

My moodle 1.6  was installed from Fantastico on a web hosting server. So I don't actually have the physical server in front of me and therefore, I don't have any administration authority to do any configuration of the server. Only one small partition is assigned to my web site.

But during the installations, I have double checked if the server support the installations by entering into Admininstration >  Environment , the checkup of the environment is as follows:

Environment

Check how your server suits current and future installation requirements

Moodle Version 1.6+
Name Information Report Status
database mysql version 4.1.16 is required and you are running 4.1.21 OK
php version 4.3.0 is required and you are running 5.1.4 OK
php_extension iconv is recommended to be installed/enabled OK
php_extension mbstring is recommended to be installed/enabled OK

Does the above tell me that the server should support the installation of moodle? or, does the above only means that I could run moodle 1.6 ok on the server, but it does not mean that the server is configured correctly to both edit and display Characters in UTF8?

Is there anything that I can do to "migrate the dbase" by making "default charset and the collation for the database set to utf8" ?

The new moodle now works on nearly everything except for the problems I am facing now. I have to use 80% Chinese and 20% English in all instructions of moodle. I am testing this new server to make sure I could later upgrade or transfer my existing two moodles to 1.6. which is more suitable for us in the next two years. What can we try now?

Could we make use of the phpMyadmin and run any SQL script? Sorry for nothing I know about server. Cheers

Thanks in advance.

James

In reply to J. Chan

Re: All languages don't display right except English

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
Unfortunately I have no experience in installing Moodle with Fantastico and it can be a coincedense two people reporting the same (unusual!) problem while starting from a Fantastico installation.
Can you try to install Moodle yourself (creating a utf8 database with phpmyadmin, a folder, uploading, ...) ? The installation of Moodle is very easy. Experiencing it yourself might make upgrades later on easier.
In reply to koen roggemans

Re: All languages don't display right except English--- fixed

by J. Chan -

Hi, here below is the solution:

Run phpMyadmin from cpanel. Check to see if the charset and collation are set to UTF-8. Even though it is, it doesn't mean that the text fields of the moodle tables are set correctly.

mysql.gif

So, select dbase of moodle which is established already. Try to select one table at a time clicking the "edit button" (the one in the red circle) of one of the tables.

mysql2

After the table is selected to edit, the collation is seen that the default is set to "latin1_swedish_ci" (as in the red circle). Select the two fields on the left of the table, and then click the "edit button" (as in the blue circle) at the bottom of the table.

mysql3

At the edit panel, there are pull down menus and "utf8_unicode_ci" should be selected. Do the changes and press "save".

mysql4

The files are then changed according to :

ALTER TABLE `mdl_attendance_log` CHANGE `status` `status` CHAR( 1 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
CHANGE `remarks` `remarks` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL

The steps should be repeated until all the table fields are altered.

However, if there are files consisting SQL queries / php code that would do all the alternation at one time for standard tables of a basic Moodle 1.6 downloaded from the Moodle official site, it would be more user-friendly.

I hope this note is self-explanatory and clear enough for those who need moodle to display languages other than English.

Cheers

James

 

In reply to J. Chan

Re: All languages don't display right except English--- fixed

by Jake Kimball -

James,

I want to thank you for the solution to the ??? problem and let you know that you're a hero. I fixed all the fields and presto--success!

Jake   

In reply to Jake Kimball

Re: All languages don't display right except English--- fixed

by Marc Sheffner -
Hi, I've been having the same problem. I am also using cPanel. I see that the new (1.6.1) version of Moodle puts the language files in a different place. BUT I still have the old "lang" folder full of all the languages folders.
Included in these lang folders is
lang/ja/moodle
.php...
which says
"<?PHP // $Id$
     // moodle.php - created with Moodle 1.6 development (2005060201)"
(I seem to have 3 different versions of Moodle in here!)
and in the "charset" says
"$string['thischarset'] = 'EUC-JP';
$string['thisdirection'] = 'ltr';
$string['thislanguage'] = 'Japanese';"

This seems to be interfering, as the Moodle only appears in proper Japanese characters if you select "Encode - EUC-JP" from the browser "View" menu EACH TIME YOU OPEN A NEW PAGE.

A veteran Moodle user I turned to for help suggests I trash all these old "lang" folders: I no longer need them as I have the new 1.6.1 version
but I can't figure out how to trash folders using cPanel.

My "uploaddata" folder:
It contains a "lang" folder which contains 3 folders:
"en"
"ja_utf8"
"ja_utf8_local"

The "ja_utf8" folder
says
"$string['thischarset'] = 'UTF-8';
$string['thisdirection'] = 'ltr';
$string['thislanguage'] = '日本語';"
(that last bit says "nihongo" in Japanese kanji, in case you have
trouble reading it)

It also says "<?PHP // $Id$
     // moodle.php - created with Moodle 1.7 dev (2006092801)"
which seems to be the newest version, so I guess this is ok.

The "en" folder contains just one file, "moodle.php"
and this file is completely empty, just blank, nothing written in it whatsoever.

Should I trash the old "lang" folders, or go with James' solution? Or both?
In reply to Marc Sheffner

Re: All languages don't display right except English--- fixed

by ali rabi -
Dear Chan,
Where and how do you run php/Myadmin from cpanel?
my host cpanel or fantastico doe not show php/Myadmin.

In reply to ali rabi

Re: All languages don't display right except English--- fixed

by ali rabi -
Reply to myself.
Version 1.5.4 works fine with all languages. You will not be able to imbed video files in this version but you can on 1.6.3
Another problem - when you choose files in the site files to put in a folder, there is no option for the folder. How does one organise sitefiles?
In reply to ali rabi

Re: Where is phpMyAdmin is? ----as indicated

by J. Chan -

Dear Ali Rabi

Please find attached the diagram showing where the phpMyadmin is at my cpanel. It is located in the "control panel" section.

php.gif

However, it depends on how your hosting service provider's settings. If you could not find the icon, ask them to activate this service for you. It is a normal function of cpanel, and most service providers would provide this function.

Cheers

James

In reply to J. Chan

Re: All languages don't display right except English--- fixed

by Syamsul Anwar -
Thank you for posting this! It's really helped with enabling proper Chinese and Tamil language support on my school's Moodle site!
In reply to Charalambos Vrasidas

Re: All languages don't display right except English

by J. Chan -

Hi, Charalambos

Thanks for your reply. I wonder if your moodle is installed on an independent server or one from Fantastico. Mine is from the latter.

Anyway, I hope your dbase expert could solve the problem.

Good luck

James

In reply to J. Chan

Re: All languages don't display right except English

by Charalambos Vrasidas -

Hi james,

 

just like you ... I am using c-panel, throguh which I used Fantastico to install Moodle. If I find out anything will let you know

please do the same :  )

cheers

 

pambos

In reply to Charalambos Vrasidas

Re: All languages should display right in UTF8 even installed from Fantastico

by J. Chan -

Dear Charalambos Vrasidas

Please refer to my previous message for step by step setting of phpMyAdmin.

However, for a faster way, you may run the attached script in phpMyAdmin > select Database > Run SQL queries:

scripts.sql

The script is for the purpose of migration of dbase to "set the the default charset and the collation for the database to utf8". It could be used for most other languages, i.e. to make moodle display what you input --- all in "utf8_unicode_ci".

Please make a note that in the script, you could remove any table that your SQL doesn't have, or you may manually add in more for more tables.

The script has not been tested. I just copy and paste them from what I did as described in my previous message.

I hope the script could facilitate the process. Hope it is also useful for upgrade purpose.

Cheers

James

 

In reply to J. Chan

Re: All languages should display right in UTF8 even installed from Fantastico

by J. Chan -

Replying to myself,

Sorry that I forgot to put in ";" at the end of each paragraph for the scripts as described in my previous message at http://moodle.org/mod/forum/discuss.php?d=51827&parent=243937

The scripts has been modified and updated now. Perhaps I should rename it as migrationUTF8.sql

The script is for the purpose of migration of dbase to "set the default charset and the collation for the database to utf8". It could be used for most other languages, i.e. to make moodle display what you input --- all in "utf8_unicode_ci".

The script has, again, not been tested. I just copy and paste them.

However, for every new installations or upgrades of new modules or blocks, you have to enter phpMYAdmin, each time, to set the default charset and the collation for the database to utf8, as according to my previous message hereunder:

http://moodle.org/mod/forum/discuss.php?d=51827&parent=243870 

The above method is mainly for those who installed Moodle 1.6 or 1.6+ on a web host through the use of Fantastico in the C-panel.

Cheers

James

In reply to J. Chan

Re: All languages should display right in UTF8 even installed from Fantastico

by Dr. Amitkumar Mali -
Dear James
I seen lot of people got their language solution from u in the language forum that create a hope for me.

I have installed moodle on my site http://moodle.dietbvn.org hosted by siteground.com. by using Fantastico. the version is 1.9

I have also installed the gujarati language pack.
I have created this language pack by using "Baraha" a Free Indian Language Software (http://www.baraha.com/).

I have no idea what PHP and MySql is,sad i am a teacher who wants to use moodle for my instrucations.

now, when i visit mysite, and change my language preference to Gujarati, the moodle appear perfectly in gujarati but when i creat a cource or write anything in gujarati(using the same software baraha which was used for creating gujarati language pack) it appears as only ??????.

When I read the help topics provided by siteground.com, I found it like ::

How to change the collation for all tables in a mysql database (to utf8)?


Changing the collation for all tables in a mysql database can be time consuming depending on how many tables you have.

That's why we recommend using the following PHP script for changing the collation for all tables at a time:

<?php
$db = mysql_connect('localhost','myuser_mydbuser','mypassword');
if(!$db) echo "Cannot connect to the database - incorrect details";
mysql_select_db('myuser_mydbname'); $result=mysql_query('show tables');
while($tables = mysql_fetch_array($result)) {
foreach ($tables as $key => $value) {
mysql_query("ALTER TABLE $value COLLATE utf8-general_ci");
}}
echo "The collation of your database has been successfully changed!";
?>

Make sure to substitute in the above script:

- myuser_mydbname with your database name;

- myuser_mydbuser with your mysql username;

- mypassword with your password for the mysql user;

- utf8-general_ci with your new collation if different;


can u help me to modify the script and how to run it.

following is the "envirronment" report
moodle%20error.jpg


Please help me
Amit
In reply to Dr. Amitkumar Mali

Re: All languages should display right in UTF8 even installed from Fantastico

by James Carvin -

I have gone to the streetsmartingit.blogspot.com web site you referred to and copied and tried your code. I notice that in addition to their instructions that since the server is going to be on their site, not your own computer, that you need to also replace "localhost' with the IP of your server. This can be found by logging into your CPanel and finding your PHPMyAdmin. When you log in you will see the IP in your address bar. (Took me several hours to figure that out).

However, it still doesn't work, on my web host anyway, My Web Host is HostICan and I was unable to get this. When I finally seem to access the site with the php script I get the following warning … So we are back to resetting collation in each of the 198 tables, an idea I still haven't figured out how to accomplish. For all the time it's taken to do this automatically, I could have done it by now if only I knew the how to change even one table's charset and collation. I've gone to the trouble of backing it up. It's time to just do this one table at a time. Anyone know how?

alarm_red.gif

Oppss... It seems you have made some changes, which have caused a few problems. Please view below...

    • Incorrect file and/or folder permissions (greater than 755)
    • .htaccess issue (php_flag, php_value statements,etc.)
    • Other possible reasons

If you are the website administrator, please review Internal Server Error 500. This will provide you with insight into how to resolve this issue.

 
In reply to James Carvin

Re: All languages should display right in UTF8 even installed from Fantastico

by Peter Poznyakov -
I have the same problem: ???? instead of Russian letters in my both Moodles, hosted by SiteGround. Version 1.9 updated 20080522. Everything was OK when I started a new Russian Moodle a few days ago, but yesterday something happens when I tried to edit Front page of my second Moodle, and now I have ??? where should be Russian letters in both. Russian letters are shown normally as it should be in Moodle Translation, but do not work at all when I try to type myself.
Any ideas?
In reply to Peter Poznyakov

Re: All languages should display right in UTF8 even installed from Fantastico

by Peter Poznyakov -
I have created one more Moodle with Fantastico De Luxe (SiteGround Host). Everything OK. Russian letters shown properly. But how long for? One day you can loose everything...
In reply to Peter Poznyakov

Re: All languages should display right in UTF8 even installed from Fantastico

by Peter Poznyakov -
As soon as you are trying to type non-English text (let say, in front page) after saving it converted to ???? (question marks) in SiteGround Moodle (v.1.9). I did 5 instances of Moodle with the same result does not matter if this is their (SiteGround's) Moodle, installed with Fantastico De Luxe, or updated version, installed manually.
It's interesting, that on another hosting (freehostia, v.1.8) it never happen.
Unfortunately, I can't check it either Moodle version or Host fault, as I can't install v.1.9 on Freehostia, and failed to install v.1.8 on SiteGround.
Any opinions, please?
In reply to michal shin

Re: When I enter content I get only question marks

by Mario Reissmann -

Hi,

unfortunately i got the same problem with moodle 1.8. whenever i enter japanese, korean, chinese or russian content, my database fields contain just question marks afterwards.

the proposed solution is not usable for me, as i run an mssql server 2005 and the sql scripts aren't available anymore. i have full access to the web server as well as the database server.

can anybody help me, please?

many thanks in advance!

Mario Reissmann

In reply to Mario Reissmann

Re: When I enter content I get only question marks

by James Carvin -

I installed Moodle with Fantastico and the version is 1.9

I have noticed that the default language collation is swedish.

I was unable to read James Chan's solution because his images were apparently removed by the time I found his post over a year later.

I'm surprised that Fantastico is still using a language other than UTF8 for default after all this time when doing Moodle installs for CPanel.

Now I have to continue searching for the solution because I can't see what James was talking about in the PHPMyAdmin. I can see the language for each table. Does he mean I have to go into all 169 tables one at a time?

He then gave a script link that was also dead by the time I found this which might provide a much needed short cut. If anyone knows the solution, I'm here really seriously in need of getting Greek and Hebrew fonts working on my site and not showing me ?????????

In reply to James Carvin

Re: When I enter content I get only question marks

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
Personally I think the best you can do is delete your moodle installation and create it from scratch rather then using an installer script like Fantastico.
That way, you go through the installation and through the documentation as you go to prevent problems. A lot easier then fixing them.

The problem can also be caused by not having the right unicode fonts installed on your pc, but I assume you have them wink
Average of ratings: Useful (1)
In reply to koen roggemans

જઃ Re: When I enter content I get only question marks

by Dr. Amitkumar Mali -
Hi
all my problems are solved now ,સ્મીત
I remove the moodle installed by fantastico and upload the moodle to my site and then just run the install.php, follow the instructions from installing moodle (http://docs.moodle.org/en/Installing_Moodle) [ frankly speaking, I did not understand any script but just read the Creating the data directory and Run the installer script to create config.php and run the page on my server ] and BINGObiggrin.gifbiggrin.gif It was done perfectly. Now both moodle interface and my cource content is visible perfectly in Gujarati.

Your suggestion is great
Thanx
Amit
In reply to Dr. Amitkumar Mali

Re: જઃ Re: When I enter content I get only question marks

by Drasko Scekic -
I just solved same problem with my Fantastico Moodle installation (1.92)

Quite easy way of handling this problem:

1. From Control panel login to PHPMyadmin
2. Choose your database and export it to sql file.
3. Now you need some text editor capable to convert file content to UTF-8. I'm recommending Notepad++ (free, open source text editor). Open database backup file with it and choose 'Format' -> 'Convert to Utf-8'
4. Do not close file, but choose 'Search' -> 'Replace', and than choose to replace all 'CHARSET=latin1' instances (or whatever encoding you have in tables)instances with 'CHARSET=utf8'. Close that window.
5. Copy content of the file (ctr+A -> ctrl+C)
6. Return to PHPMyAdmin and delete all tables in your database. Than go to 'SQl' tab, paste content of the db to 'Run SQL query/queries on database' field, click on GO, and - that's all

After some time ( depends on size of your DB, you should get answer that everything went fine, adn you tables are here again - now in utf-8 format.
This maybe looks complicated to novices , but you need not more then 5 minutes to complete all actions.

Remember: always make backup copy of the database before playing with it!
In reply to Drasko Scekic

Re: જઃ Re: When I enter content I get only question marks

by Martyn Mayfield -

Your instructions were great and so easy. As a novice the only thing I found confusing from trying to look on a variety of posts was about deleting tables. So this is an explanation of the above step #6 (the first part) The easy answer was this:

1) Choose the data base on the left you want to delete tables from

2) Make sure the "Structure" Tab at the top is chosen.

3) Go to the bottom of the page and click "Check All"

4) Click on the pull down menu "With Selected"

5) Choose "Drop"