ReadStat icon indicating copy to clipboard operation
ReadStat copied to clipboard

exit with error code 0 when encountering conversion errors

Open caeu opened this issue 6 months ago • 0 comments

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

caeu avatar Jun 28 '25 11:06 caeu