You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/03/29 13:36:41 UTC
[jira] [Commented] (JENA-1312) Bad UTF-8 string causes different
behaviour between "fuseki -v" and "fuseki".
[ https://issues.apache.org/jira/browse/JENA-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15947138#comment-15947138 ]
ASF GitHub Bot commented on JENA-1312:
--------------------------------------
GitHub user afs opened a pull request:
https://github.com/apache/jena/pull/229
JENA-1312: Verbose logging: capture bytes then safe-decode to string.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/afs/jena jena-1312
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/jena/pull/229.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #229
----
commit 1a089359f612942e79739788729adadb55d5269c
Author: Andy Seaborne <an...@apache.org>
Date: 2017-03-29T13:35:51Z
JENA-1312: Verbose logging: capture bytes then safe-decode to string.
----
> Bad UTF-8 string causes different behaviour between "fuseki -v" and "fuseki".
> -----------------------------------------------------------------------------
>
> Key: JENA-1312
> URL: https://issues.apache.org/jira/browse/JENA-1312
> Project: Apache Jena
> Issue Type: Bug
> Reporter: Andy Seaborne
>
> This is the raw bytes for a BOM - i.e. no UTF-8 encoded. This report is not specific to this bad encoded data.
> {noformat}
> #!/bin/bash
> DATA=$'PREFIX : <http://exmaple/> INSERT DATA { :s :p "abc\xFE\xFFxyz" }'
> curl -XPOST \
> --header 'Content-type: application/sparql-update' \
> --data "$DATA" \
> http://localhost:3030/ds/update
> {noformat}
> With -v:
> {noformat}
> [2017-03-28 18:23:27] Fuseki WARN [2] Runtime IO Exception (client left?) RC = 500 : java.nio.charset.MalformedInputException: Input length = 1
> org.apache.jena.atlas.RuntimeIOException: java.nio.charset.MalformedInputException: Input length = 1
> at org.apache.jena.atlas.io.IO.exception(IO.java:233)
> at org.apache.jena.fuseki.servlets.SPARQL_Update.executeBody(SPARQL_Update.java:183)
> {noformat}
> (this is in the verbose handling)
> This causes a 500.
> It is using a Java StreamDecoder. Decoding via, e.g, new String(bytes, UTF-8) works, no error. It is a different code path in the JDK.
> Without "-v", a 204 response is generated (javacc converts the bytes to characters, not java).
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)