When Spanish teachers in our division are typing topic headings in Spanish, the characters are not displaying properly. Any advice as to what code to tweak so these display properly?
Courses and course formats
Collapsed Topic display issue
It depends on the version of Collapsed Topics you are using - for 1.9 or 2.0+ ?
The area of code I suspect could be causing the issue is a call to 'html_to_text' in format.php - a standard Moodle function I believe (please correct me if I'm wrong Tim and if it has optional parameters for character encoding). Try removing it... So 'html_to_text($thissection->name)' becomes '$thissection->name' if Moodle 2.0+ and 'html_to_text($thissection->summary)' to '$thissection->summary' if Moodle 1.9 and then kindly let me know if it works and for what version.
Thank you Tim
So, Kevin, do you have the issue when using standard topics format with the Topic Summary (Moodle 1.9) / Topic Name (Moodle 2.0+)? If so then the issue is not Collapesed Topic's related but something else I think.
I notice that the TinyMCE editor has a 'lang' drop down combo box, does this make a difference?
The issue is using topics format with the Topic Summary (Moodle 1.9). I'm not familiar with the TinyMCE editor and how that could help troubleshoot this.
It is the editor built into Moodle, please see attached on how to use the TinyMCE editor...
I'm sorry, but your last message is not clear. Is this a Collapsed Topic's only issue - i.e. does it appear fine in the standard topics format? I need to test somehow, so would it be possible to post an example course or how to enter the spanish words that are causing the problem?
Sorry for the confusion. The problem only appears using Collapsed Topics format. Spanish text appears normal in Standard Topics format. Even after adding the es language format you showed above, the text still does not display properly in Collapsed Topics format. To type the accent mark causing the problem on a Mac (the accented n) you type option n and then the letter n. The text shows up fine in the Topic Summary but incorrect in the collapsed topic bar.
I have a PC so tried to replicate by using Alt-0241 (on the numeric keypad) for the 'n' with a tilde and could not as you can see from the attached. I have a development version so just to be sure installed the current downloadable one from Moodle.org and noticed that yours has been customised as the shipped version has italic version of the summary.
What theme are you using? The pic below is Standard White. Do you get the issue with a standard Moodle theme such as that? Or could it be that the font that is specified for the toggle title in the css is an all capitals one that does not have a 'ñ' in its character set?
I'm running Moodle 1.9.13 (Build: 20110817).
The language files I include with the format only affect the word 'Toggle' etc. and nothing else.
Additionally, I find it strange that 'Final Exam' in your first example does not capitialise and yet 'Unidad 10: La Niñez' does get capitalised - I've just checked the full title too just in case.
Just had a brainwave and noticed that your title was in heading 3 format and bingo as attached but no transformation, but will keep looking...
In this example I've taken out the call to 'html_to_text' so the toggle looks odd but it appears that it is that function that is capitialising the text when called with a heading 3 (or indeed 1 or 2) html....
Please could I have some help with the 'html_to_text' function given the above. I realise that the character set I'm using when the function capitalises the html is ok, but in Kevin's example, what can I do about it?
Oh, I see. html_to_text tries to capitalise things, which if done in a stupid way, breaks UTF-8.
Aha, looking at the implementiation of that function, I see it has been fixed in recent versions. Looking through version control history, it seems it was fixed by someone called Tim Hunt: http://fisheye.moodle.org/changelog/Moodle?cs=36a40748e18b369e71c69960b329d531cd53663d - MDL-25018. So, fixed between Moodle 1.9.10 and 1.9.11.
We're running an older version as you can see. We want to hold off upgrading to version 2 of Moodle until next academic year. An upgrade to version 1.9.13 might very well solve this issue then?
Given what I have seen and tested, Tim has pointed out and fixed in core, then yes - as when I type the characters, put a heading and 'html_to_text' capitalises them, they are fine on Moodle 1.9.13 - latest stable I believe.
An upgrade from 1.9.5 to 1.9.13 should be straightforward.
1.9.5 is ancient, and there have been many bugs fixed since then, including security bugs (http://moodle.org/security/). You should plan to upgrade to the latest release on whatever stable branch you are following from time to time.