datapackage-java icon indicating copy to clipboard operation
datapackage-java copied to clipboard

character set of a resource

Open jze opened this issue 3 years ago • 1 comments

Overview

It seems that the character set of a resource is not taken into account. Here is a simple test case with ISO8859-1 encoding.

URL url = new URL("https://opendata.zitsh.de/frictionless/haltestellen-smartes-dorfshuttle-stand-01-2022.json");
String jsonString =  new Scanner(url.openStream()).useDelimiter("\\A").next();
ObjectNode resourceJson = (ObjectNode) JsonUtil.getInstance().createNode(jsonString);
Resource resource = Resource.build(resourceJson, null, false);
Iterator<String[]> iter = resource.stringArrayIterator();
while(iter.hasNext()) {
    System.out.println(Arrays.toString(iter.next()));
}

Please preserve this line to notify @iSnow (lead of this repository)

jze avatar Aug 05 '22 15:08 jze

Thanks for raising the issue! First off, sorry for the late answer, I was busy with other stuff and couldn't catch up with Github.

Concerning your issue, I can confirm that it is a valid bug. It doesn't just concern this project but also the tableschema-java project that is used here to read the data. Fixing it will required quite a bit of work...

iSnow avatar Dec 02 '22 21:12 iSnow