TestUtility.cs
using System;
using System.Text ;
namespace AutomatedTest
{
/// <summary>
/// TestUtility 的摘要说明。
/// </summary>
public class TestUtility
{
public TestUtility()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public static string ConvCHAR(int pPosition)
{
string PerChar="";
if(pPosition>26)
{
pPosition -=26;
PerChar="A";
}
byte aByte=byte.Parse ((pPosition+64).ToString());
byte[] bytes1={aByte,0x42,0x43};
byte[] bytes2={0x98,0xe3};
char[] chars=new char [3];
Decoder d=Encoding.UTF8.GetDecoder ();//页面引用using System.text;
int charLen=d.GetChars(bytes1,0,bytes1.Length ,chars,0);
charLen +=d.GetChars(bytes2,0,bytes2.Length ,chars,charLen);
foreach(char c in chars)
{
Console.Write ("U+"+((ushort)c).ToString ()+" ");
return PerChar+c.ToString ();
}
return "Need an entry";
}
}
}