Skip to content

readstat not converting encoding of XPORT variable labels #172

Description

@ofajardo

This is comming from this issue in pyreadstat.

This file contains variable labels with non-ascii characters, the first one appearing in column index 173:

o,p\x92-DDT comment code

\x92 seems to be a windows-1252 for apostrophe if I translate manually to utf-8, so theoretically iconv should translate it correctly, however it does not. I try to set the encoding with readstat_set_file_character_encoding and still it seems that readstat ignores it.

I have observed that most readstat_parse_* functions (sas7bdat, sas7bcat, dta, sav) have lines

ctx->input_encoding = parser->input_encoding;
 ctx->output_encoding = parser->output_encoding;

But I don't see them in xport, also not in por. Maybe the conversion is not enabled?

sample file is here

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions