Click here to Skip to main content
15,441,568 members
Home / Discussions / C#
   

C#

 
Question.NET and c# windows form app Pin
Баярдаваа Ихтамир8-Aug-22 22:01
MemberБаярдаваа Ихтамир8-Aug-22 22:01 
AnswerRe: .NET and c# windows form app Pin
Richard Deeming8-Aug-22 22:42
mveRichard Deeming8-Aug-22 22:42 
AnswerRe: .NET and c# windows form app Pin
OriginalGriff9-Aug-22 0:36
mveOriginalGriff9-Aug-22 0:36 
AnswerRe: .NET and c# windows form app Pin
Gerry Schmitz9-Aug-22 9:19
mveGerry Schmitz9-Aug-22 9:19 
QuestionDecoding GBK, .NET 6 edition Pin
harold aptroot8-Aug-22 12:07
Memberharold aptroot8-Aug-22 12:07 
AnswerRe: Decoding GBK, .NET 6 edition Pin
lmoelleb8-Aug-22 22:02
Memberlmoelleb8-Aug-22 22:02 
GeneralRe: Decoding GBK, .NET 6 edition Pin
lmoelleb8-Aug-22 23:22
Memberlmoelleb8-Aug-22 23:22 
AnswerRe: Decoding GBK, .NET 6 edition Pin
Richard Deeming8-Aug-22 22:34
mveRichard Deeming8-Aug-22 22:34 
As far as I can see, code page 936 is called "gb2312" in .NET Framework, but .NET 6 doesn't seem to know about it - as you said, the Encoding.GetEncodings method only lists seven options.

It looks like you need to register the code pages provider from the System.Text.Encoding.CodePages package, which seems to be included in .NET 6 by default:
C#
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
Encoding gb2312 = Encoding.GetEncoding(936); // Chinese Simplified (GB2312)




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Decoding GBK, .NET 6 edition Pin
harold aptroot9-Aug-22 4:44
Memberharold aptroot9-Aug-22 4:44 
QuestionHow to close FileStream without causing an error in PdfViewer Pin
Code4Ever7-Aug-22 20:02
MemberCode4Ever7-Aug-22 20:02 
AnswerRe: How to close FileStream without causing an error in PdfViewer Pin
OriginalGriff7-Aug-22 20:25
mveOriginalGriff7-Aug-22 20:25 
GeneralRe: How to close FileStream without causing an error in PdfViewer Pin
Code4Ever7-Aug-22 20:38
MemberCode4Ever7-Aug-22 20:38 
GeneralRe: How to close FileStream without causing an error in PdfViewer Pin
OriginalGriff7-Aug-22 21:16
mveOriginalGriff7-Aug-22 21:16 
GeneralRe: How to close FileStream without causing an error in PdfViewer Pin
OriginalGriff7-Aug-22 21:59
mveOriginalGriff7-Aug-22 21:59 
AnswerRe: How to close FileStream without causing an error in PdfViewer Pin
Richard Deeming8-Aug-22 0:08
mveRichard Deeming8-Aug-22 0:08 
QuestionFacing problem when calling store procedure from c# code Pin
Mou_kol2-Aug-22 7:52
MemberMou_kol2-Aug-22 7:52 
AnswerRe: Facing problem when calling store procedure from c# code Pin
Richard Deeming2-Aug-22 21:21
mveRichard Deeming2-Aug-22 21:21 
GeneralRe: Facing problem when calling store procedure from c# code Pin
Mou_kol3-Aug-22 3:27
MemberMou_kol3-Aug-22 3:27 
GeneralRe: Facing problem when calling store procedure from c# code Pin
Victor Nijegorodov3-Aug-22 5:33
MemberVictor Nijegorodov3-Aug-22 5:33 
QuestionRe: Facing problem when calling store procedure from c# code Pin
thatraja2-Aug-22 21:36
professionalthatraja2-Aug-22 21:36 
AnswerRe: Facing problem when calling store procedure from c# code Pin
Gerry Schmitz3-Aug-22 5:58
mveGerry Schmitz3-Aug-22 5:58 
QuestionHow to dispose Interaction.Behaviors in WPF Pin
Code4Ever2-Aug-22 5:45
MemberCode4Ever2-Aug-22 5:45 
AnswerRe: How to dispose Interaction.Behaviors in WPF Pin
Gerry Schmitz2-Aug-22 6:21
mveGerry Schmitz2-Aug-22 6:21 
QuestionHow to set null value to a FOREIGN KEY using EF Core Pin
Code4Ever31-Jul-22 20:38
MemberCode4Ever31-Jul-22 20:38 
AnswerRe: How to set null value to a FOREIGN KEY using EF Core Pin
Richard MacCutchan31-Jul-22 21:37
mveRichard MacCutchan31-Jul-22 21:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.