I harvested graph http://dbpedia.org/data/Belgium.xml
This SPARQL query below fails in java at TupleQueryResult.hasNext() if the object\'s 2000th character is a non/ASCII one:
select ?g ?p bif:left(?o,2000) as ?objData
where {graph ?g {?s ?p ?o .
filter(?s=iri(<http://dbpedia.org/resource/Belgium>)) .
filter (?p=<http://dbpedia.org/ontology/abstract>) }}
Works on Virtuoso SPARQL end-point. If replaced bif:left(?o, 2000) with fn:substring(?o, 1,2000) it also worked in java.
Example code snippet attached.
Example code snippet