1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ToolsClassLibrary
- {
-
-
-
- public static class MyEncoding
- {
-
-
-
-
-
- public static byte[] EncodingASCII(string buf)
- {
- byte[] data = Encoding.Unicode.GetBytes(buf);
- return data;
- }
-
-
-
-
-
- public static string DecodingASCII(byte[] bt)
- {
- string st = Encoding.Unicode.GetString(bt);
- return st;
- }
-
-
-
-
-
- public static byte[] EncodingUTF_8(string buf)
- {
- byte[] data = Encoding.UTF8.GetBytes(buf);
- return data;
- }
-
-
-
-
-
- public static string DecodingUTF_8(byte[] bt)
- {
- string st = Encoding.UTF8.GetString(bt);
- return st;
- }
- }
- }
|