UTF-8

UTF-8

by Hari Brikas -
Number of replies: 12

Hi. How can I turn questionnair charset to UTF-8? Languages like Greek dispaly as ??????????? .

Average of ratings: -
In reply to Hari Brikas

Re: UTF-8

by Eric Fichtl -

I am having the same issue with Cyrillic characters for Russian -- everything displays as ????, no matter whether I have text as UTF-8 encoded or plain text when adding it. I don't see any instructions in the documentation for switching character sets. Can someone help?

 

Edit: To clarify, I'm on Moodle 1.9. I am trying to add a Russian-language questionnaire, and any Cyrillic text I add ends up as ???. I am using the same process I used to build a 500-page course all in Russian -- even in the course's main page the title of the survey appears as ????.

Can anyone say what's going wrong? Does Questionnaire module work in non-Latin script languages (I ask despite seeing it's been translated to Russian)?

In reply to Eric Fichtl

Re: UTF-8

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

It should work fine. Can you check that you are using the most up to date version of questionnaire for 1.9?

mike

In reply to Eric Fichtl

Re: UTF-8

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Eric "I am using the same process I used to build a 500-page course all in Russian -- even in the course's main page the title of the survey appears as ????."

From what you say it appears that your character problem is not specific to the Questionnaire module. If you could display Cyrillic text in the other parts of your moodle site / courses, then it would display OK in the Questionnaire module too.

Maybe re-post your question in the General problems or the Languages forums.

Joseph

In reply to Joseph Rézeau

Re: UTF-8

by Eric Fichtl -

Hello Mike and Joseph,

I downloaded and installed Questionnaire 1.9 on January 14, 2011. I am not sure how to tell whether this is the latest version, but it is quite recent.

To avoid any confusion my earlier post caused, Russian text is working correctly  throughout my course (resources, quizzes, online texts, etc) -- only the Questionnaire module displays Cyrillic text as question marks. For that reason I posted specifically to this forum.

Can you tell me how to check the version, if that seems to be the problem? And if it sounds like I'm on the right version, do you have any other ideas why it won't work? I was able to set up a questionnaire in English without problem.

Many thanks,

Eric

Please note: I have tried starting the Questionnaire both in English and Russian editing modes, pasting Russian text, typing Russian text in... Every approach renders question marks in the Russian survey.

In reply to Eric Fichtl

Re: UTF-8

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hello Eric,

When you say "the Questionnaire module displays Cyrillic as question marks", what do you mean exactly?

Are you seeing the Questionnaire interface in Cyrillic (see attached screenshot) or not? Can you enter question text in Cyrillic?

Normally, there is no problem using Cyrillic in the Questionnaire module, so we need more information. Please attach screenshots, and also a sample of questionnaire written in cyrillic which you can export.

Are you using for language (ru) as shown on attached screenshot? or some other brand of cyrillic?

Joseph

Joseph

Attachment 15-02-2011 19-49-13.jpg
In reply to Joseph Rézeau

Re: UTF-8

by Eric Fichtl -

Hello Joseph,

I've taken several screen grabs, attached as one image below. Here are explanations related to each number in the image:

1. While editing is RU (the official version, as in your screen shot), I create a new survey. I paste in Russian text.

2. I fill out other configuration and save -- notice that some ???? are already appearing on this screen.

3. After saving, I return to my Topics outline, and the new questionnaire is at the very bottom. The other two with ??? for titles are previous attempts. Notice that other resources/activities above and the editing buttons are all in Russian.

4. I click to edit the questionnaire I've just created, and all my text has become ????.

5. I add a question -- again in Russian editing mode -- and save.

6. Viewing the question I've just added on the Questions tab (in Russian), my question text is all ?????.

I did upload all the language files for the Questionnaire module when I installed it, but it occurred to me that perhaps something is missing there which would cause this.

Will post a sample Word doc in a moment...

Thanks for your help,

Eric

Attachment questionnairegrab3.jpg
In reply to Eric Fichtl

Re: UTF-8

by Eric Fichtl -

Attached below is a sample of the Word doc I've been using. I'm very familiar with the horrible Word jargon residue with creating HTML, so usually I convert to plain text, or paste directly into the HTML mode in the editor to ensure clean outcomes.

But over the last few days I've tried every combination I can think of -- direct pasting from Word, converting to plain text then pasting, typing directly in Russian into the field, pasting from other Russian documents that worked correctly earlier in the course, etc. I always get those ????.

Thanks again for your help figuring this out.

Eric

In reply to Eric Fichtl

Re: UTF-8

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Eric,

Thanks for the screenshots. I have used your attached word doc to author one yes/no question and the Cyrillic characters display fine. Everything displays fine in my moodle 1.9.10 local install (Windows XP, any browser).

Compared to your screenshots, I do not see any ?????????? anywhere, but the epxected Cyrillic characteers everywhere. It is strange that you should be having this problem with the Questionnaire module only - on your Moodle site.

Maybe a problem with your moodle database not being utf8 ?

If you want you can try out on my moodle online test site, where I have put your sample questionnaire (with just one yes/no question) and everything looks fine. Log in as teacher01, password Teacher01!

Joseph

 

Attachment 15-02-2011 22-54-29.jpg
In reply to Joseph Rézeau

Re: UTF-8

by Eric Fichtl -

Thanks Joseph. I tried the demo on your site and see that it works. I must admit I did not expect anything other than UTF-8 to be the default for the database, and I am unsure how to check this (or change if necessary).

What confuses me is that all other activities and resources have worked in Russian/Cyrillic without issue in my installation until this issue with Questionnaire. It seems to have struck the original poster in this thread, too. I may have to try a different solution as time is pressing, but hopefully this is useful reading for others!

Thanks again to you and Mike for looking into this,

Eric

In reply to Eric Fichtl

Re: UTF-8

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

If you are using MySQL and have something like PHPMyAdmin available, look at the table structures and see if the questionnaire tables are showing as a UTF-8 encoding.

mike

Average of ratings: Useful (1)
In reply to Mike Churchward

Re: UTF-8

by Eric Fichtl -

Hi Mike,

I used PHPMyAdmin to have a look. There's an overview on the Structure tab there, showing that Collation on everything except the Questionnaire parts are set to utf8_general_ci. Utf8_general_ci is also shown as the default MySQL connection collation in our set-up.

The ones beginning mo_questionnaire are set to latin1_swedish_ci -- I have no idea how or why that happened. I am not in Sweden, and our data center is in the UK.

This prompts two questions:

1. How can I change the mo_questionnaire setting to utf8_general_ci?

2. Given that we also have a Questionnaire in English that is open and collecting responses, are there any precautions to take before making this switch of character sets? I can't risk losing the responses we've gathered, or any other course materials for that matter.

Thanks very much -- I feel like this is close to being resolved!

Eric

In reply to Eric Fichtl

Re: UTF-8

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

Sorry for the delay.

You will have to convert the data in the tables as well as changing the collation of the tables. There is information here to do that: http://en.gentoo-wiki.com/wiki/Convert_latin1_to_UTF-8_in_MySQL. You will only need to do the conversion if you were storing old non-UTF8 data in the tables. If you have been only storing UTF8 data in non UTF8 tables, then chaning the collation of them will be all you need to do. Note - make backups of your data before attempting any of this!

You may want to check the settings for the default collations for your database. Most add-ons don't specify a collation, so it depends on this setting when the tables are created.

mike