ToPinyin: Convert to SimpChinese at first

This commit is contained in:
Yeechan Lu
2014-03-17 03:36:38 +08:00
parent b65f562c61
commit a7159ecf1d
2 changed files with 2 additions and 0 deletions

View File

@@ -77,6 +77,7 @@ namespace Wox.Infrastructure
public static string ToPinYin(string txt)
{
txt = txt.Trim();
txt = Microsoft.VisualBasic.Strings.StrConv(txt, Microsoft.VisualBasic.VbStrConv.SimplifiedChinese, 0);
byte[] arr = new byte[2]; //每个汉字为2字节
StringBuilder result = new StringBuilder();//使用StringBuilder优化字符串连接
int charCode = 0;

View File

@@ -32,6 +32,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\net35\Newtonsoft.Json.dll</HintPath>
</Reference>