User import - characters dropped

User import - characters dropped

by Brendon Hatcher -
Number of replies: 4

Hi

Here are my workflows

Data created in Excel

  1. Open Excel 2010
  2. Create a set of user data
  3. In the name, replace an e with é (by going to Insert, Symbol)
  4. Save as an excel file
  5. Save as a CSV
  6. Type = CSV (Comma delimited)
  7. Tools / Web options / Encoding / UTF 8
  8. Save
  9. Open the file in Notepad - character is present
  10. Open the file in Notepad ++ - character is present, but encoding is shown as ANSI
  11. Import to Moodle, and the character is dropped - literally just taken out of the name

Check the data

  1. Open the file in Notepad ++, change the encoding to UTF-8 and the character gets replaced with a weird code (can't copy it)
  2. Save, open again, character shows correctly
  3. Import into Moodle, character gets dropped again

Create the data in Notepad++

  1. Open Notepad ++
  2. Change encoding to UTF-8
  3. Type the data
  4. Paste in the SAME character from excel
  5. Save, import, character comes in fine

Any comments?

I need a simple workflow for creating and managing user imports from a spreadsheet, as non-technical people will be doing it.

Thanks

Brendon

Average of ratings: -
In reply to Brendon Hatcher

Re: User import - characters dropped

by Floyd Saner -

Brendon,

Yep, I ran into this all the time, especially when working with Spanish text. MS Excel 2010 does not properly encode everything in UTF8, even when the setting is enabled. What I did was export from Excel, then open in NotePad++ and change the encoding to UTF8.  

I now use Office 365 and find the UTF8 encoding works with that version.

Floyd

Average of ratings: Useful (1)
In reply to Floyd Saner

Re: User import - characters dropped

by Brendon Hatcher -

My test

  1. Create the file in Excel
  2. Save as CSV with UTF-8
  3. Open in Notepad ++
  4. Encoding / Convert to UTF-8
  5. Extended characters look weird
  6. Save
  7. Import to Moodle
  8. Works!

Thanks, Floyd!

Regards
Brendon

In reply to Brendon Hatcher

Re: User import - characters dropped

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Brendon,

You can save yourself a some time and trouble by getting and using Libre Office. (It is free to download and use and can do anything I was ever able to do in M$ Office.) I have been using LibreOffice Calc for years to upload users. When you go, File > Save as, put a checkmark in the box for, Edit filter settings, then click, Save. In the new popup, click the down arrow for Character set and change to Unicode (UTF-8), and then click OK.

This method has allowed me to use all characters, such as, é, without any problems. I just tested again and verified it works, as it has over the past five or six years since I started using this process with Moodle 3.0 forward to the current code that will become 3.7.

Average of ratings: Useful (1)
In reply to AL Rachels

Re: User import - characters dropped

by Brendon Hatcher -
Hi


Thanks for connecting my process to an obvious software solution!  I have used LibreOffice before, but hadn't thought of it as a solution to this issue.

Also, I have just tested my earlier workflow using Excel 2018 and the issue still remains.  Changing the encoding in Excel doesn't work - I still get ANSI.

Regards
Brendon