jsxgraph / moodle-filter_jsxgraph

moodle plug-in for JSXGraph
https://jsxgraph.org
2 stars 6 forks source link

UTF-8 character encoding #13

Closed anieminen closed 4 years ago

anieminen commented 5 years ago

Hello,

It seems that the JSXGraph filter is not handling UTF-8 characters correctly in quiz questions. Scandinavian å, ä or ö letters are all garbled in the example below. If I disable the filter, the characters are displayed correctly.

finnish_quiz

I can see that mb_convert_encoding function has been used in the code but those lines are commented out for some reason (https://github.com/jsxgraph/moodle-filter_jsxgraph/blob/master/filter.php#L90).

I am using Moodle 3.5.6 & the latest version of the filter.

nadavkav commented 4 years ago

I am experiencing the same issue for Hebrew content, on latest stable Moodle 3.7

nadavkav commented 4 years ago

Here is a fix: https://stackoverflow.com/a/8218649/374316

andreas-web commented 4 years ago

Hello, thank you for your interest! I will take care of the problem after my exams and hope to come up with a solution towards the end of August. Andreas

nadavkav commented 4 years ago

@walterandreas good luck with the exams! Here is the quick fix that worked for me: $dom->loadHTML('<?xml encoding="utf-8" ?>' .$html);

andreas-web commented 4 years ago

Hello.

At the moment I have a small bridge in the calendar so I was able to take care of the problem.

Some time ago I completely reprogrammed the plugin. Unfortunately, I can not remember exactly why I commented out the lines with converting. Actually, this error should have occurred earlier (we have in German ä ö and ü too).

Because I dont know if commenting out did not have a good reason (maybe a complication with another filter), let's continue with the following workaround: I've added a setting for administrators to set mb_convert_encoding to run or not.

I'm about to push a new version of the filter in GitHub and commit a new Moodle version. Please test the functionality and get in touch again if problems still occur.

Best regards, Andreas