/// <summary>
/// Convert a single Chinese character into Pinyin
/// </ summary>
/// <param name = "SingleChs"> Single Chinese character </ param>
/// <returns> Pinyin </ returns>
public static string SingleChs2Spell (string SingleChs)
{
byte [] array;
int iAsc;
string strRtn = string.Empty;
array = Encoding.Default.GetBytes(SingleChs);
try
{
iAsc = (short) (array[0]) * 256 + (short) (array[1]) - 65536;
}
catch
{
iAsc = 1;
}
if (iAsc > 0 && iAsc < 160)
return SingleChs;
for (int i = (pyvalue.Length - 1); i >= 0; i--)
{
if (pyvalue[i] <= iAsc)
{
strRtn = pystr[i];
break;
}
}
-------------------------------------------------- ------------------------------- The above part is to get the complete spelling of Chinese characters ----------- --------------------------
// Turn the first letter to uppercase
if (strRtn.Length> 1)
{
strRtn = strRtn.Substring (0, 1) .ToUpper () + strRtn.Substring (1);
}
-------------------------------------------------- ---------- The above small piece of code is used to get the first letter ---------------------------- ---------------
return strRtn;
}