Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle UTF-8 chars #110

Closed
VladimirAlexiev opened this issue Feb 5, 2021 · 7 comments
Closed

handle UTF-8 chars #110

VladimirAlexiev opened this issue Feb 5, 2021 · 7 comments

Comments

@VladimirAlexiev
Copy link

I added owl:Ontology and rdfs:isDefinedBy to schema.org (#108).

Now pylode -i schema-with-added-ontology.ttl -c true -o schema.html
fails with
'charmap' codec can't encode character '\xa3' in position 654973: character maps to <undefined>

It's on the pound sign in this comment: balance between £1,000 and £1,000,000 GBP.
The file is valid UTF-8 without BOM.

@nicholascar
Copy link
Member

This issue seems to be fixed in the latest release, 2.8.6. I say "seems" because it appeared to be working already. A test has been created for this using the files given above, see https://github.com/RDFLib/pyLODE/blob/master/tests/test_issue_110.py.

@nicholascar
Copy link
Member

Reopening as issue still present on Windows (I just didn't see it on my Mac)

@nicholascar nicholascar reopened this Feb 23, 2021
@smarie
Copy link

smarie commented Apr 9, 2021

I have a similar issue but PyLODE does not error - instead the generated html page contains an invalid character.

My source file is an UTF-8 turtle file with accentuated french character "é"

@smarie
Copy link

smarie commented Apr 9, 2021

My bad I was using PyLODE 2.4... :) I confirm that using the latest version fixes my problem

@VladimirAlexiev
Copy link
Author

As you can see in #119, pip install pylode doesn't upgrade from 2.8.5 to any later version.

So I got https://github.com/RDFLib/pyLODE/archive/refs/tags/2.8.6.zip and unzipped pylode.exe to c:\Users\vladimir.alexiev.000\AppData\Local\Programs\Python\Python37\Scripts\.

Now it works:

pylode -i schema-with-added-ontology.ttl -c true -o schema.html
Finished. ontdoc documentation in schema.html

and produces this:
or a range as in describing a bank account being suitable for a balance between £1,000 and £1,000,000 GBP, or the value of a salary, etc. It is recommended to use [[PriceSpecification]] Types to describe the price of an Offer, Invoice, etc.

@smrgeoinfo
Copy link

note this fix apparently didn't get into the 3.0.1 build...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants