ckan / ckanext-dcat

CKAN ♥ DCAT
https://docs.ckan.org/projects/ckanext-dcat
167 stars 146 forks source link

Support for latin characters. #16

Closed poguez closed 10 years ago

poguez commented 10 years ago

Is there support for latin characters? I had some issues while working with texts in spanish that contain áéíóúÁÉÍÓÚ.

The error happens with this two occurrences in the same order as the errors in the log

identifier: "valoración-programas"
identifier: "Cartografía de las oficinas"

Error Log

2014-06-23 15:57:11,232 DEBUG [ckanext.dcat.harvesters] In DCATHarvester gather_stage
2014-06-23 15:57:11,235 DEBUG [ckanext.dcat.harvesters] Getting file http://xxxxx/catalogo.json
2014-06-23 15:57:13,564 DEBUG [ckanext.dcat.harvesters] Got identifier: inventario-federal
2014-06-23 15:57:13,581 ERROR [ckanext.harvest.harvesters.base] Error parsing file: 'ascii' codec can't encode character u'\xf3' in position 8: ordinal not in range(128)
2014-06-23 15:57:13,585 ERROR [ckanext.harvest.queue] Gather stage failed
2014-06-23 16:28:13,642 DEBUG [ckanext.harvest.queue] Received harvest job id: 06e4906e-eab1-4069-8fd5-1bc4a17a262c
2014-06-23 16:28:13,653 DEBUG [ckanext.dcat.harvesters] In DCATHarvester gather_stage
2014-06-23 16:28:13,655 DEBUG [ckanext.dcat.harvesters] Getting file http://xxxxx/catalogo.json
2014-06-23 16:28:15,801 DEBUG [ckanext.dcat.harvesters] Got identifier: IVF
2014-06-23 16:28:15,824 ERROR [ckanext.harvest.harvesters.base] Error parsing file: 'ascii' codec can't encode character u'\xed' in position 9: ordinal not in range(128)
2014-06-23 16:28:15,829 ERROR [ckanext.harvest.queue] Gather stage failed
defvol commented 10 years ago

IMHO, the requirement should not be "latin chars" but UTF-8 support

amercader commented 10 years ago

@poguez Looks like it was just a debug message that was not properly encoded. Could you pull latest master, restart the harvester processes and see if that fixes the issue?

As an aside, on my experience using special (non-ascii) characters for identifiers ends up causing trouble sooner or later so my recommendation is always to avoid them. But this should fix your issue anyway.

amercader commented 10 years ago

@poguez did the patch fix the issue?

defvol commented 10 years ago

yes!

http://adela.datos.gob.mx/coneval/catalogo.json http://catalogo.datos.gob.mx/harvest/coneval

awesome +1000

amercader commented 10 years ago

Genial!

poguez commented 10 years ago

Works great!