Fix for glossary import/export files (non 8859-1 encoding)

Fix for glossary import/export files (non 8859-1 encoding)

by Petr Skoda -
Number of replies: 1
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers

Glossary export does not create correctly encoded XML files for other than 8859-1 content encoding.

I needed to export my glossary in czech language (iso-8859-2) and edit it in external application. I created a small application in Java to correct the UTF encoding - it is suitable for any onebyte encoding. It can be used for import preparation too.

Installation:
1/ install Sun's Java JRE (version 1.4.2 or later)
2/ unzip attached file

To fix exported file:
FixUTF.bat -e=iso-8859-2 glossary.xml my.xml

To prepare file for import:
FixUTF.bat -r -e=iso-8859-2 my.xml glossary.xml


Instead of iso-8859-2 use your own encoding - encoding of files in your language bundle (moodle/lang/xx/). Source code (GNU GPL) is included in the jar archive.

skodak



Average of ratings: -
In reply to Petr Skoda

Re: Fix for glossary import/export files (non 8859-1 encoding)

by Maciej Niemir -

Thank you!

I used your solution and it's work great.

For me it is very strange, that moodle programmers use utf8_encode function instaed of iconv, mb_string or something like that...