Can't import CSV files including Chinese character

Re: Can't import CSV files including Chinese character

از koen roggemans در
Number of replies: 4
عکس Core developers عکس Documentation writers عکس Moodle HQ عکس Particularly helpful Moodlers عکس Plugin developers عکس Translators

This should be tested on the latest version.

Can you do that or attach a file here that doesn't work?

Bugs can be reported on https://tracker.moodle.org

In reply to koen roggemans

回复: Re: Can't import CSV files including Chinese character

از spoony liu در
I have tested the latest moodle( 3.7+ Build: 20190704). The problem does exist. Here is a file of user that I tested. It works well on  2.8.5+ that  I have been using for a long time.
In reply to spoony liu

Re: 回复: Re: Can't import CSV files including Chinese character

از koen roggemans در
عکس Core developers عکس Documentation writers عکس Moodle HQ عکس Particularly helpful Moodlers عکس Plugin developers عکس Translators

The document is ISO-8859-1 encoded. It works when uploading it and changing the document encoding to ISO-8859-1, but what comes out, doesn't look Chinese.

I don't know how to get back to Chinese characters starting from your document - it might be not possible.

Anyway, somewhere in the process of creating your document, you mixed up encodings, with this as a result. I think it's better to use UTF-8 for Chinese.

I made an example document. I don't know any Chinese - I just got some characters from a Chinese page somewhere, so the content of my file is complete nonsense and hopefully not offending لبخند


In reply to koen roggemans

Re: 回复: Re: Can't import CSV files including Chinese character

از Germán Valero در
عکس Documentation writers عکس Particularly helpful Moodlers عکس Plugin developers عکس Testers عکس Translators
I have often used Notepad++ to change the encoding of a file. It is fast, easy and free ;)
In reply to Germán Valero

Re: 回复: Re: Can't import CSV files including Chinese character

از koen roggemans در
عکس Core developers عکس Documentation writers عکس Moodle HQ عکس Particularly helpful Moodlers عکس Plugin developers عکس Translators
For this case, the current encoding is wrong - it is not the correct encoding that goes with the bytes in the file. So if you change the encoding of this file the correct way, like using Notepad++ or any other tool, the characters will never show up correctly - they will show the same wrong characters in a different encoding.
I don't know if it is possible to figure out what went wrong and revert that. I think in this case, the only thing you can do is start over and make sure you know during the whole process of creating the file which encoding you use and make sure that that encoding supports Chinese.
ISO_8859-1 doesn't support Chinese - it is a single byte encoding, only supporting 191 characters. There have been several encoding standards for Chinese, but not this one. So something went wrong in the creation of this file: the original encoding got lost and replaced wrongly by ISO_8859-1, thereby damaging the file.
It is weird that this works on a 2.8. A lot more weird then that it doesn't work on a 3.6.