Feature request: Ignore Byte Order Mark

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Feature request: Ignore Byte Order Mark

fiveop
I would like to use the ontology located in file 'om-2.0.rdf' from https://github.com/HajoRijgersberg/OM/ as it is provided. Unfortunately, the file starts with a useless byte order mark (https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8), which trips up Owlready2's '_guess_format'. To make Owlready2 more robust (and accept allowed but useless byte order marks in utf-8 files) I suggest to add

if s.startswith(b"\xef\xbb\xbf"): s = s[3:]

after

if isinstance(s, str): s = s.encode("utf-8")

in _guess_format (driver.py)
Reply | Threaded
Open this post in threaded view
|

Re: Feature request: Ignore Byte Order Mark

Jiba
Administrator
Hi,

Thank you for your proposal. I've added it in the development version.

Jiba