CollectionBuilder / collectionbuilder-csv

CollectionBuilder-CSV is a "stand alone" template for creating digital collection and exhibit websites using Jekyll and a metadata CSV.
MIT License
21 stars 16 forks source link

Latin n (characters) result to an error #28

Closed pvperez1 closed 2 years ago

pvperez1 commented 2 years ago

My metadata contains a latin n, when viewed in vscode, it appears as a question mark. Also, when bundle exec jekyll s was run, the site do not generate and results to an error. How can we present latin or accented characters? Thanks!

Screenshot 2022-04-07 012509
evanwill commented 2 years ago

@pvperez1 sounds like a file character encoding issue. The question mark character is displayed when a character isn't encoded correctly (or is being interpreted in the wrong encoding), so the editor doesn't know what character to display. The corrupted characters shouldn't break anything, however, a CSV created by Excel often can (the encoding “UTF-8 with BOM” will cause errors in Ruby).

Can you point me to the repository with the issue?

Basic notes:

The metadata CSV needs to be in UTF-8 (without BOM). There are some tips on: https://collectionbuilder.github.io/cb-docs/docs/metadata/uploading/ UTF-8 can encode any characters--so if formatted correctly, you can display any kind of accents, etc.

Sometimes you can fix the CSV by re-encoding on VS Code and choosing UTF-8 (click the encoding such as "UTF-8" at the bottom of the editor window, displayed in the blue bar at the bottom right). However, sometimes the characters are fully corrupted in the CSV (because it is interpreting it in the wrong encoding to start with)--so you might need to go back to the source spreadsheet and export it again, or figure out what the encoding really is. If you create metadata in Excel--don't try to save the CSV from Excel, it doesn't work! Import the xlsx file into Sheets or OpenRefine or LibreOffice, then create the CSV from one of those tools instead.

pvperez1 commented 2 years ago

Ah yes, sorry about that. Working with CollectionBuilder-CSV, I noticed that the metadata.csv file can be now be easily opened with Microsoft Excel without disrupting the program, and so I sometimes use Microsoft Excel. I just put the latin n using vscode and is now working. Thanks!

evanwill commented 2 years ago

Yeah, @pvperez1 Excel won't properly parse the UTF-8 csv (if you have any special characters in it, they will be corrupted) and can't properly export a csv--you can create metadata directly in Excel, using the xlsx file format then export using something else--but going back and forth with CSV + Excel doesn't work. If you want a desktop app for editing spreadsheets, I would use LibreOffice (its free and open). There is also some plugins for VS Code for editing spreadsheets--but I am not familiar with them, so can't suggest anything! I do a lot of csv editing just directly in Code, not so hard once you get used to looking at it. I use the Rainbow CSV extension to make visualizing the columns easier.