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

Correctly handle \u in Notation 3 files. #426

Merged
merged 5 commits into from
Nov 20, 2014

Conversation

amandasaurus
Copy link

It was using case insensitive regex, so it was mistaking \u and \U.

Sec 6.4 of the W3C spec (http://www.w3.org/TR/turtle/#sec-escapes) says that it's either \uXXXX (4 chars) or \UXXXXXXXX (8 chars). The current code uses a regex, but the regex has the case-insensitive flag set. So if there is a \uXXXX in the turtle file, the 8 character regex for \U will match and it'll try to pull in 8 character (rather than 4).

I've included tests that demostrate this.

It was using case insensitive regex, so it was mistaking \u and \U.
@joernhees
Copy link
Member

hmm, from what you write and the changes this seems legit, but other tests now fail...

@gromgull you wrote that :p

Rory McCann and others added 2 commits November 17, 2014 02:23
It was using case insensitive regex, so it was mistaking \u and \U.
… Add correct case for prefix escape in unicode expansion in litterals
@ymph
Copy link
Contributor

ymph commented Nov 17, 2014

Hello,

I was encountering the same problem and was about to apply the exact same correction when I found this pull request.
Imade a fork and applied Rory's correction + corrected the problems induced in the treatment of unicode escape sequence in string literals as shown by the failing tests. You can see my commit @ IRI-Research@96c30f9

Ideally, I would like to add a pull request to this pull request, but i do not quite know how to do it.
Would you like me to issue a new pull request ?

Regards,

Rory McCann added 2 commits November 17, 2014 10:00
@amandasaurus
Copy link
Author

@ymph I have merged that commit into this branch. The Travis CI tests mostly pass, except for the python 3.4 one, which failed due to a network problem of accessing github

@ymph
Copy link
Contributor

ymph commented Nov 17, 2014

@rory Thank you very much, this is certainly the best way.
Too bad the Travis CI build errored on what seems to be a network glitch...

Regards,

@joernhees
Copy link
Member

re-running the test...
succeeded: https://travis-ci.org/RDFLib/rdflib/builds/41223462

joernhees added a commit that referenced this pull request Nov 20, 2014
correctly handle \u and \U in n3 files
@joernhees joernhees merged commit 465345f into RDFLib:master Nov 20, 2014
@joernhees
Copy link
Member

@rory and @ymph thanks for fixing this ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants