FieldStudiesCouncil / QGIS-Biological-Recording-Tools

QGIS plugin for biological recorders. Created with the FSC Tomorrow's Biodiversity project.
GNU General Public License v3.0
10 stars 4 forks source link

Further problems with non-standard characters in taxon names #6

Closed burkmarr closed 7 years ago

burkmarr commented 7 years ago

From an email from Marco Zenatello:

Hi Richard, I am still using your (excellent) tool to produce draft atlas maps for birds. However, if I use Italian names as a taxon field, TEMP map layers are not produced for those birds whose name contains an accent (e.g. Chiffchaff, which in Italian is written "Luì piccolo"). It's a minor bug which I can easily overcome by editing my dataset, but perhaps you may be interesting to know it! That's all - have a good day Marco

burkmarr commented 7 years ago

From my response email:

Hi Marco,

I made an update yesterday to deal with characters like periods and brackets in species names. Have you tried with this new release? If it still doesn’t work I’ll take a look at it.

Rich

burkmarr commented 7 years ago

From Marcos response email:

No, it doesn't... I updated the plugin to 2.7.0 just now. I am (still) using Qgis 2.12.2 When the csv is uploaded to QGIS via the "Create new source layer from CSV" button, in its table of contents the "ì" characters appear as a odd symbol with a question mark, and a Temp "invalid" layer is produced, which contains all the points from the "Luì ..." species. If you want to check,please find attached a small data sample.

burkmarr commented 7 years ago

This problem had two parts.

Firstly I established that Marco's test CSV file was encoded in ANSI (also known as Windows 1252). I found this out by opening it in Windows NotePad and selecting'Save As' - the file encoding is visible from a drop-down list. When a CSV is opened using the 'Create new source layer from CSV' button on the Biological Records Tool it assumes a file encoding of UTF-8. One way of getting round this is to use Notepad to save a copy of the CSV to another file, changing the encoding to UTF-8 in the drop-down list, then open that with the 'Create new source layer from CSV' button. But a better way is to use QGIS' core 'Add Delimited Text Layer' to open the CSV - specifying 'Windows 1252' as the encoding. The resultant CSV layer (whether point geometry or 'no geometry') can be selected in the 'Source layer' drop-down in the Biological Recording Tool.

This first step fixes the problem Marco noted with the characters appearing incorrectly in QGIS Attributes Table tool. But a second problem with the Biological Recording Tool itself was responsible for the 'invalid' layers being detected when the non-standard characters were encountered. I have fixed this and created a new release (2.7.4).

burkmarr commented 7 years ago

Assuming this was resolved.