Home > Net > Is there any difference between these two lines?
Is there any difference between these two lines?
Time:01-26
Is there any difference between these two lines? Byte [] b1.=Encoding UTF8. GetBytes (s); Byte [] b2=Encoding. GetEncoding (" utf-8 "). GetBytes (s);
CodePudding user response:
There is no difference, realized the function of the same
CodePudding user response:
Functions, implementation is different
CodePudding user response:
// //abstract: //Returns the encoding associated with the specified code page name. // //parameters: //name: //The code page, The name of The preferred encoding. Any value returned by The System. Text. Encoding. WebName //property is valid. Possible values are listed in the Name column of the table //that appears in the System. Text. Encoding the class topic. // //return the result: //The encoding associated with The specified code page. // //exception: //T: System. ArgumentException: //The name is not a valid code page name. - or - The code page indicated by The name is not //supported by the physicist platform. Public static Encoding GetEncoding (string name) { Encoding ret=null;
The switch (name) {//... Case "utf-8" : Ret=UTF8; break; //... } return ret;
}
Only on the operating efficiency, the subtle difference between may return to Encoding in according to the name above, is no different from other places, is a thing
CodePudding user response:
[quote=reference 3 floor 灬
Only on the operating efficiency, the subtle difference between may return to Encoding in according to the name above, is no different from other places, is a thing