Skip to content

No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. #35

@deepak206

Description

@deepak206

I am trying to read the .sav file and getting this issue.

No data is available for encoding 1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.

using (FileStream fileStream = new FileStream("{file_path}/test.sav", FileMode.Open, FileAccess.Read))
            {                
                SpssReader spssDataset = new SpssReader(fileStream);
                foreach (var variable in spssDataset.Variables)
                {
                    Console.WriteLine("{0} - {1}", variable.Name, variable.Label);

                    foreach (KeyValuePair<double, string> label in variable.ValueLabels)
                    {
                        Console.WriteLine(" {0} - {1}", label.Key, label.Value);
                    }
                }

Please let me know what I am doing wrong

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions