CSIRO-enviro-informatics / ldrpyutils

Python utils for the Linked Data Registry
https://csiro-enviro-informatics.github.io/ldrpyutils
Other
3 stars 3 forks source link

Problem with parsing unicode characters in v1.1.6 of Excel2LDR #28

Open jyucsiro opened 6 years ago

jyucsiro commented 6 years ago

Problem with parsing unicode characters in v1.1.6 of Excel2LDR.

Traceback (most recent call last): File "C:/Repositories/git/github/csiro-env-info/ldrpyutils/gui/Excel2ldrGui.py", line 174, in OnSend self.run() File "C:/Repositories/git/github/csiro-env-info/ldrpyutils/gui/Excel2ldrGui.py", line 232, in run verbose=verbose File "C:\Repositories\git\github\csiro-env-info\ldrpyutils\ldrpyutils\core.py", line 60, in load_simple_file verbose=verbose File "C:\Repositories\git\github\csiro-env-info\ldrpyutils\ldrpyutils\core.py", line 237, in build_graph_and_post subreg_graph = get_subregister_graph(sub_reg_id, reglabel, regdescription, prefix_idx, nsMgr) File "C:\Repositories\git\github\csiro-env-info\ldrpyutils\ldrpyutils\core.py", line 324, in get_subregister_graph graph.add((subreg, DCT.description, Literal(str(regdescription)))) UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 22: ordinal not in range(128)

jyucsiro commented 6 years ago

This problem is thrown up if using python2.7 as the base. However, in python3, this isn't an issue.

Solution: compile excel2ldr using python3.