From 0fe588545bd39653b112a4407836f517280c72f9 Mon Sep 17 00:00:00 2001 From: Maxim Kolchin Date: Sat, 15 Feb 2014 16:41:42 +0400 Subject: [PATCH] Added charset=UTF-8 in Content-Type and Encoded the update paramenter to UTF-8. --- rdflib/plugins/stores/sparqlstore.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rdflib/plugins/stores/sparqlstore.py b/rdflib/plugins/stores/sparqlstore.py index 5579c277a..281bcd6eb 100644 --- a/rdflib/plugins/stores/sparqlstore.py +++ b/rdflib/plugins/stores/sparqlstore.py @@ -17,7 +17,7 @@ """ SPARQL_POST_UPDATE = "application/sparql-update" -SPARQL_POST_ENCODED = "application/x-www-form-urlencoded" +SPARQL_POST_ENCODED = "application/x-www-form-urlencoded; charset=UTF-8" # Defines some SPARQL keywords LIMIT = 'LIMIT' @@ -628,7 +628,7 @@ def remove(self, spo, context): def _do_update(self, update): import urllib if self.postAsEncoded: - update = urllib.urlencode({'update': update}) + update = urllib.urlencode({'update': update.encode("utf-8")}) self.connection.request( 'POST', self.path, update.encode("utf-8"), self.headers) return self.connection.getresponse()