Open kiddkaffeine opened 1 month ago
Tagging subscribers to this area: @dotnet/area-system-text-encoding See info in area-owners.md if you want to be subscribed.
That is by design. The old options are no longer supported in modern .NET. Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
is the correct and documented way to achieve it.
Thanks for the feedback. I'm not sure if you guys control this or not but it seems like a lot of still maintained documentation refers to this, for example:
https://learn.microsoft.com/en-us/dotnet/android/building-apps/build-properties#mandroidi18n
The behavior is documented in https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding.getencoding?view=net-8.0#overloads. I'll let @matouskozak @vitek-karas @mdh1418 comment on the docs https://learn.microsoft.com/en-us/dotnet/android/building-apps/build-properties#mandroidi18n.
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger See info in area-owners.md if you want to be subscribed.
Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger See info in area-owners.md if you want to be subscribed.
Description
Per documentation, adding flags like
Reproduction Steps
Expected behavior
Shift JIS encoding returned.
Actual behavior
Exception thrown that encoding is not supported.
Regression?
Unknown, but possible based on workaround linked in documentation this worked in earlier .net releases and documentation is out of date.
Known Workarounds
Following https://www.nuget.org/packages/System.Text.Encoding.CodePages/#readme-body-tab and adding this:
// Register the CodePages encoding provider at application startup to enable using single and double byte encodings. Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
Seems to fix.
Configuration
No response
Other information
No response