SCM

Forum: support

Monitor Forum | Start New Thread Start New Thread
RE: Encodings other than UTF-8 in exams2moodle [ Reply ]
By: Dominik Ernst on 2014-03-13 09:56
[forum:40913]
Hi,

thanks and sorry for the late response. :-)

Regards
Dominik

RE: Encodings other than UTF-8 in exams2moodle [ Reply ]
By: Nikolaus Umlauf on 2014-02-03 14:19
[forum:40818]
Dear Dominik,

yes, thanks for spotting this. The encoding argument in exams2moodle() did not affect the encoding of the XML file. We have fixed this now and it should work.

All the best,
Nikolaus

Encodings other than UTF-8 in exams2moodle [ Reply ]
By: Dominik Ernst on 2014-01-23 15:48
[forum:40802]
Hi,

it seems to me only file encodings of type UTF-8 are supported. For example exams2moodle, takes a parameter encoding but uses this only for the Sweave part. For the rest, the encoding is ignored. As far as I can see read_exercise uses readLines without specifying any encoding and uses this text to subsequently write the XML file for Moodle. This XML file hard-codes the encoding to be UTF-8 but then copies the questions verbatim from what was read via read_exercise. Which then results in a failure in the XML parser which tries to read UTF-8 but instead chokes on ISO-8859-1 (or whatever) characters.
Also trying to process such exercise files produces a copious amount of warnings, the likes of
"In grep(command, x, fixed = TRUE) : input string 4 is invalid in this locale"
which can be alleviated by running R in the correct locale. But still there is no valid XML file generated later on.

Am I missing something or what is the proper way to use for example ISO-8859-1 encoded files?

Regards
Dominik Ernst

Thanks to:
Vienna University of Economics and Business Powered By FusionForge