Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ public class TupleQueryResultFormat extends QueryResultFormat {
/**
* SPARQL Query Result CSV Format.
*/
public static final TupleQueryResultFormat CSV = new TupleQueryResultFormat("SPARQL/CSV", List.of("text/csv"),
StandardCharsets.UTF_8, List.of("csv"), SPARQL_RESULTS_CSV_URI, NO_RDF_STAR);
public static final TupleQueryResultFormat CSV = new TupleQueryResultFormat("SPARQL/CSV",
List.of("text/csv;charset=UTF-8", "text/csv"), StandardCharsets.UTF_8, List.of("csv"),
SPARQL_RESULTS_CSV_URI, NO_RDF_STAR);

/**
* SPARQL Query Result TSV Format.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.eclipse.rdf4j.query.resultio;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

class TupleQueryResultFormatTest {

@Test
@DisplayName("CSV default MIME type should include UTF-8 charset parameter as required by spec")
void csvMimeTypeShouldIncludeCharsetParameter() {
assertThat(TupleQueryResultFormat.CSV.getDefaultMIMEType())
.as("MIME type should advertise UTF-8 charset")
.isEqualTo("text/csv;charset=UTF-8");
}
}
Loading