Skip to content

exit with error code 0 when encountering conversion errors #340

@caeu

Description

@caeu

When trying to convert an SPSS sav file that has invalid byte sequence I get the error message but with exit code 0:

Converted 0 variables and 0 rows in 0.02 seconds
Error processing spssfile.sav: Unable to convert string to the requested encoding (invalid byte sequence)

echo $?
0

1-
I expect it to exit with a non-zero exit code, so I could fallback to alternative solution. Like using a custom R script and the "haven" package which allows passing the encoding.

2-
Is there a way to pass the encoding directly to Readstat cli, similar to the R haven package, for example:
readstat --encoding "latin-1" input -

Unfortunately, I can't provide the input file to reproduce.

ReadStat version 1.1.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions