Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MalformedInputException when parsing csv file with umlauts #766

Open
ryanthara opened this issue Sep 3, 2021 · 0 comments
Open

MalformedInputException when parsing csv file with umlauts #766

ryanthara opened this issue Sep 3, 2021 · 0 comments

Comments

@ryanthara
Copy link

I try to parse a csv file from a public geodata server Fixpunkte_BS.csv that contains umlauts like 'ä' and 'ö' in the first line of the file.

Therefore I use the callback approach.

// Callback
try {
    csv = CsvParser
            .separator(separator)
            .forEach(file2Read.toFile(), new ListCollector<>()).getList();
    return true;
} catch (IOException e) {
    LOGGER.error("Comma separated values file '{}' could not be read.", file2Read.toString());
}

Example:

Punktnummer;Punktkategorie;E (LV95);N (LV95);Höhe (LN02);Lage-Genauigkeit;Lage-Zuverlässigkeit;Höhen-Genauigkeit;Höhen-Zuverlässigkeit;Vermarkungsart;Punktart

It is quite equal if the encoding is 'UTF-8' or 'Windows 1252'. It always ends in the

java.nio.charset.MalformedInputException: Input length = 1.

Did I miss something to avoid this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant