Skip to content
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

Shift-JIS Encoding throws 'System.NotSupportedException' in BodyName #33979

Closed
imxike opened this issue Mar 23, 2020 · 5 comments
Closed

Shift-JIS Encoding throws 'System.NotSupportedException' in BodyName #33979

imxike opened this issue Mar 23, 2020 · 5 comments
Labels
area-System.Text.Encoding backlog-cleanup-candidate An inactive issue that has been marked for automated closure. question Answer questions and provide assistance, not an issue with source code or documentation.
Milestone

Comments

@imxike
Copy link

imxike commented Mar 23, 2020

Net Core 3.1 (netcoreapp3.1)
Visual Studio Community 2019 (16.5.0)
OS: Windows 10 (1903)

When i'm trying to use JsonConvert.SerializeObject my Object which have japan-character. It raise the following exception

Newtonsoft.Json.JsonSerializationException: 'Error getting value from 'BodyName' on 'System.Text.DBCSCodePageEncoding'.'
NotSupportedException: No data is available for encoding 932. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.

Trying to find whats problem here, i found that the encoding i'm using throw exception in the property. I have registered the EncodingProvider.Instance before i'm using it
image

Is it unable to use SerializeObject which have shift-jis encoding in .net core 3. Or is it a bug from the encoding. Please help. Thank you.

@GrabYourPitchforks GrabYourPitchforks transferred this issue from dotnet/core Mar 23, 2020
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. Please help me learn by adding exactly one area label.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Mar 23, 2020
@nechvatalp
Copy link

I experience the same issue.

@tarekgh tarekgh added question Answer questions and provide assistance, not an issue with source code or documentation. and removed untriaged New issue has not been triaged by the area owner labels Jul 6, 2020
@tarekgh tarekgh added this to the Future milestone Jul 6, 2020
@tarekgh
Copy link
Member

tarekgh commented Jul 6, 2020

We don't support serializing the encoding objects in .NET Core. You may need to look at your object and try to have it to serialize the encoding name as a string instead of the actual encoding object. if you have more details we can try to look at and try to help providing the workaround.

@ghost
Copy link

ghost commented Nov 5, 2021

Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

This process is part of the experimental issue cleanup initiative we are currently trialing in a limited number of areas. Please share any feedback you might have in the linked issue.

@ghost
Copy link

ghost commented Nov 20, 2021

This issue will now be closed since it had been marked no recent activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.

@ghost ghost closed this as completed Nov 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Dec 20, 2021
@eiriktsarpalis eiriktsarpalis added the backlog-cleanup-candidate An inactive issue that has been marked for automated closure. label Feb 18, 2022
@ghost ghost removed the no-recent-activity label Feb 18, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Text.Encoding backlog-cleanup-candidate An inactive issue that has been marked for automated closure. question Answer questions and provide assistance, not an issue with source code or documentation.
Projects
None yet
Development

No branches or pull requests

6 participants