{"comment":{"created_at":"2011-10-19T01:15:42Z","body":"Updated by eik...@gmail.com on 2011-03-30T09:06:23\n\nThis issue was updated by revision ff1300f36d53.\n\n...","updated_at":"2011-10-19T01:15:42Z","url":"https://api.github.com/repos/gjhiggins/rdflib/issues/comments/2450455","id":2450455,"user":{"avatar_url":"https://secure.gravatar.com/avatar/918398787dc9e085672703644972e5e4?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"918398787dc9e085672703644972e5e4","url":"https://api.github.com/users/gjhiggins","id":16417,"login":"gjhiggins"}},"action":"created","issue":{"number":83,"created_at":"2011-10-19T01:15:23Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Originally filed by anthonyg...@gmail.com on 2009-09-24T14:12:35\n\nWhat steps will reproduce the problem?\n\r\nfrom codecs import getreader\r\nfrom rdflib.Graph import Graph\r\nfrom StringIO import StringIO\r\n\r\nrdf = getreader('utf-8')(StringIO(u\"\"\"@prefix skos:\r\n<http://www.w3.org/2004/02/skos/core#> .\r\n@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\r\n@prefix : <http://www.test.org/#> .\r\n\r\n:world rdf:type skos:Concept;\r\n    skos:prefLabel \"World\"@en.\r\n:africa rdf:type skos:Concept;\r\n    skos:prefLabel \"Africa\"@en;\r\n    skos:broaderTransitive :world.\r\n:CI rdf:type skos:Concept;\r\n    skos:prefLabel \"C\\u00f4te d'Ivoire\"@en;\r\n    skos:broaderTransitive :africa.    \r\n\"\"\".encode('utf-8')))\r\n        \r\ng = Graph()\r\ng.parse(rdf, 'http://www.test.org', 'n3')\r\nprint len(g)\r\n\r\nWhat is the expected output? What do you see instead?\n\r\nExpect - 3\r\nActual - UnicodeEncodeError: 'ascii' codec can't encode character u'\\xf4'\r\nin position 1: ordinal not in range(128)\r\n\r\nWhat version of the product are you using? On what operating system?\n\r\nrdflib 2.4.2 / Windows Vista 64 bit / Python 2.4.4\r\n\r\nPlease provide any additional information below.\n\r\nThis breaks in the same way if you pass in a unicode file using\r\ncodecs.open('filename', 'r', 'utf-8')\r\nIt parses without error if you pass in a unicode file opened using\r\nopen('filename', 'r'), however, characters outside ASCII then get double\r\nescaped. e.g. \"\\\\xf4\".","comments":7,"title":"UnicodeEncodeError: 'ascii' codec can't encode character - N3Parser breaks when parsing unicode","updated_at":"2011-10-19T01:15:42Z","url":"https://api.github.com/repos/gjhiggins/rdflib/issues/83","id":1989536,"assignee":null,"milestone":null,"closed_at":"2011-10-19T01:15:37Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/918398787dc9e085672703644972e5e4?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"918398787dc9e085672703644972e5e4","url":"https://api.github.com/users/gjhiggins","id":16417,"login":"gjhiggins"},"html_url":"https://github.com/gjhiggins/rdflib/issues/83","labels":[{"name":"Component-Parser","url":"https://api.github.com/repos/gjhiggins/rdflib/labels/Component-Parser","color":"ededed"},{"name":"Milestone-Unscheduled","url":"https://api.github.com/repos/gjhiggins/rdflib/labels/Milestone-Unscheduled","color":"ededed"}],"state":"closed"},"legacy":{"issue_id":1989536,"comment_id":2450455}}