|
From: Schwalbe, M. (S. 1) <mat...@cr...> - 2013-09-12 09:22:07
|
Oops, Found out I should use Copy and Paste with more care: Fixed pastes in original mail further down. Thanks Matthias Schwalbe IT Services +41 44 333 86 10 (*413 8610) From: Schwalbe, Matthias (SQAS 1) Sent: Donnerstag, 12. September 2013 09:47 To: 'dot...@li...' Cc: Fichtner, Johann (SQAS 32) Subject: Encoding problem with SesameHttpProtocolVersion6Connector and Update(...) Hi Rob, There is a (simple) problem with SesameHttpProtocolVersion6Connector (and potentially other Connectors) in calls to both the synchronous and asynchronous versions of the Update(...) function. The SPARQL update queries get encoded in url encoded web form format: httpRequest.ContentType = "application/x-www-form-urlencoded"; The character set used by: builder.Append(HttpUtility.UrlEncode(this.EscapeQuery(sparqlUpdate))); UrlEncode(...) is utf-8, but the default format for decoding application/x-www-form-urlencoded, according to WEB documentation, is iso8859-1 which leads to garbled literal texts. This happens once text in the query uses characters outside the Latin character range, e.g. Chinese character, accented letters, umlauts. The simplest way to fix this would be to explicitly also state the character encoding used: httpRequest.ContentType = "application/x-www-form-urlencoded; charset=utf-8"; This character set it always used by UrlEncode(...) Thanks a lot sincerely yours PS: I used the latest (yesterday) dotNetRdf build from NuGet Matthias Schwalbe CREDIT SUISSE AG CREDIT SUISSE | IT Services, SQAS 1 Uetlibergstr. 231 (A/B+ZN) | 8070 Zürich | Switzerland Phone +41 44 333 86 10 mat...@cr... | www.credit-suisse.com |