Can't upload Groups with Chinese Characters.

Can't upload Groups with Chinese Characters.

by Frankle Lee 李智高 -
Number of replies: 11

Hi, everyone!

I have kept trying upload groups by a csv file within a course, and finally I found that if the csv file is English Letter only, if works fine. But if my groupname is in Chinese or with any Chinese Characters, it fails, and keep telling me that the "groupname" namefield is invalid.

Since the csv file can't be saved in UTF-8, so any solution for this issue? Any suggestion? I have more than 20 courses and 30 groups for each. Manually adding the group would be a nightmaredeaddeaddeaddead

Average of ratings: -
In reply to Frankle Lee 李智高

Re: Can't upload Groups with Chinese Characters.

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Why can you not save the file as UTF-8?

In reply to Marcus Green

回复: Re: Can't upload Groups with Chinese Characters.

by Frankle Lee 李智高 -

Thanks, Marcus!

Because according to the Documentation, the csv file couldn't be saved in UTF-8. 

https://docs.moodle.org/26/en/Import_groups

 

And even I tried to save the file into UTF-8, When I tried to upload the file, it kept returning the message that the fieldname "groupname" is invalid.

So, UTF-8 is not a solution. 

Any other suggestion?

 

By the way, I am using moodle 2.6, Will this poblem be solved in the later version?

In reply to Frankle Lee 李智高

Re: 回复: Re: Can't upload Groups with Chinese Characters.

by William Lu -
Picture of Particularly helpful Moodlers

小李,你好:

The following instruction is based on Moodle2.6 for you.

1. Make sure you sever setting is unicode=OK:

server


2. Make sure your .csv file can display the 汉字 properly in the PURE text editor, rather than in MS Excel or Word.

chinese


3. Upload file and select UTF-8

encode


4. Preview

pre

5. Result view

e


6. Course user view

user





In reply to William Lu

回复: Re: 回复: Re: Can't upload Groups with Chinese Characters.

by Frankle Lee 李智高 -

Thanks, William!

Do you mean that I should:

  1. create groups in course
  2. enroll users into course
  3. put users into groups

by updating my users with a csv file?

 

I believe that is a solution and I can upload students with Chinese characters with my moodle 2.6.

So, should I conclude that the upload groups function does not support Chinese character?

In reply to Frankle Lee 李智高

Re: 回复: Re: 回复: Re: Can't upload Groups with Chinese Characters.

by William Lu -
Picture of Particularly helpful Moodlers

Hi Frank,

  1. create groups in course---YES, create groups first.
  2. enroll users into course---use .csv file.
    3. put users into groups------use the same .scv file

There is an import groups feature in course level: https://docs.moodle.org/23/en/Import_groups

You can create users at site level via .csv, but I don't think it will create groups at same time.

Conclusion: 

Upload users into course groups function DOES not support Chinese characters.

此贴或上一贴若有用,别忘了点赞哦。

In reply to William Lu

Re: 回复: Re: 回复: Re: Can't upload Groups with Chinese Characters.

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Sorry I can't help with the Chinese character issue but just to say you can create groups with a csv file at the same time as uploading users into the newly created groups (existing or new users) from Site administration>Users>Accounts>Upload users.

See the documentation Upload users

In reply to Mary Cooch

Re: 回复: Re: 回复: Re: Can't upload Groups with Chinese Characters.

by William Lu -
Picture of Particularly helpful Moodlers

Hi Mary,

You are absolutely correct. 

Moodle CAN create GROUPs and users at same time. I always create groups in course first, silly me sad.

And it works fine with Chinese character. 


Hi Frank, here is updated conclusion:

1. 2. 3.: create users and groups same time in one .csv file.

Works well with Chinese character.
Average of ratings: Useful (1)
In reply to William Lu

回复: Re: 回复: Re: 回复: Re: Can't upload Groups with Chinese Characters.

by Frankle Lee 李智高 -

Thanks, William.

I will try to update my users and create groups at the same time in one .csv file. I think that will solve my problem.

Thanks again.

But the issue still bothers me that the upload groups function, it seems different from the upload user function to me. They are two different functions, aren't they? 

I still feel a strong need for the upload groups function to creating groups with Chinese Characters.

In reply to Frankle Lee 李智高

Re: 回复: Re: 回复: Re: 回复: Re: Can't upload Groups with Chinese Characters.

by William Lu -
Picture of Particularly helpful Moodlers

There is NOT a tool called 'Upload group'. The 'Upload users' tool create users and group at same time.

If you think you have got users already, then use the same 'Upload users' tool, but add a column 'group1', then select 'Update' users.

There is only an import groups feature in course level: https://docs.moodle.org/23/en/Import_groups, but I think the 'Upload users' tool is better and quicker.

I just tested with Chinese Characters on Moodle2.6, all works fine. 

Try the attached .csv file.

1u

2u

3u

Average of ratings: Useful (1)
In reply to William Lu

回复: Re: 回复: Re: 回复: Re: 回复: Re: Can't upload Groups with Chinese Characters.

by Frankle Lee 李智高 -

Thanks, William!

I tried your csv file and it works perfectly!

I am very curious about your file.

I open it in notepad++, it seems like this:

 

 

But when I opened it in windows notepad, it seems like this:

 

Any idea about this? The next time I need to import Groups, I will use your csv file and edit it in notepad++, but I really like to understand the reason behind this difference. 

By the way, this csv file is saved in UTF-8 right?

 

In reply to Frankle Lee 李智高

Re: 回复: Re: 回复: Re: 回复: Re: 回复: Re: Can't upload Groups with Chinese Characters.

by William Lu -
Picture of Particularly helpful Moodlers

The next time I need to import Groups, I will use your csv file and edit it in notepad++, 

Yes,  Always use a pure text editor.

but I really like to understand the reason behind this difference. 

MS Windows is sucks. 

By the way, this csv file is saved in UTF-8 right?

Just pure text is OK. If it hasn't been polluted by Windows, even .txt works.