-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for CP1252 Encoding #33
base: master
Are you sure you want to change the base?
Conversation
@codepwner, can you please attach that file? I would like to find out why the original code wasn't working correctly with it. I that's not possible, can you please provide the strEncoding value which was failing? Current code works correctly for me with both "CP1252" and "cp1252". And even with "C̈P̈1252". |
I was able to recreate the issue using this file. The SPSS project has no other modifications than the one I checked in. I was not aiming to do any development in the project, but when the nuget version was throwing the error, I decided to pull the source and was able to make this hack of a fix to get past my issue. |
@codepwner, thank you for the file. But the library works correctly with that file on my side. Text and byte representation of the encoding are the same as yours, but the encoding is correctly resolved by the following lines in the GetEncoding() method:
It seems that the source of the problem is in the Encoding.GetEncodings() method. But it seems than in projects which target .Net Core that method returns only a few default encodings (PowerShell/PowerShell#6580). So it's better to make this fix more universal in order to support other encodings. Something like this:
|
I was getting an error on a particular file and when I made this change, it allowed it to proceed.