You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, thanks for making this software freely available 👍
I was trying to read a SAS file with UTF-8 strings but whose metadata however claims to be in windows-1252.
I thought I could override this setting by using SasFileReaderImpl sasFileReader = new SasFileReaderImpl(fis, "UTF-8");
which didn't work though:
Field f = sasFileReader.getClass().getDeclaredField("sasFileParser");
f.setAccessible(true);
SasFileParser sfp = (SasFileParser) f.get(sasFileReader);
f = sfp.getClass().getDeclaredField("encoding");
f.setAccessible(true);
String enc = (String)f.get(sfp);
System.out.println(enc); // would still output windows-1252
setting the encoding via reflection ultimately did produce the correct (afaics) results. Is this intended behaviour and if so would you think it migh be beneficial to add an option to allow overriding the charset settings from the file's metadata?
The text was updated successfully, but these errors were encountered:
Hi @dernst , thanks for reporting this issue. Currently, the problem with setting the encoding is fixed in the master branch, and it will be included in the next release. You can override the encoding settings from the file's metadata when creating an instance of the SasFileReaderImpl class.
Firstly, thanks for making this software freely available 👍
I was trying to read a SAS file with UTF-8 strings but whose metadata however claims to be in windows-1252.
I thought I could override this setting by using
SasFileReaderImpl sasFileReader = new SasFileReaderImpl(fis, "UTF-8");
which didn't work though:
setting the encoding via reflection ultimately did produce the correct (afaics) results. Is this intended behaviour and if so would you think it migh be beneficial to add an option to allow overriding the charset settings from the file's metadata?
The text was updated successfully, but these errors were encountered: