Home > Net >  Gb2312 encoding, error to utf-8, how to convert back?
Gb2312 encoding, error to utf-8, how to convert back?

Time:11-11

 
Var s="blue";
Var=gb2312 Encoding. GetEncoding (" gb2312 ");
.=var utf8 Encoding utf8;

Var gbBts=gb2312. GetBytes (s);
String utf8String=utf8. Get string (gbBts);


How to convert utf8String to "blue", please?

CodePudding user response:

 
Var s="blue";
Var=gb2312 Encoding. GetEncoding (" gb2312 ");
.=var utf8 Encoding utf8;

Var gbBts=gb2312. GetBytes (s);
String gb2312str=gb2312. Get string (gbBts);


  •  Tags:  
  • C#
  • Related