From a7159ecf1dac2b5e6e699f82aafd02890bc3a6d2 Mon Sep 17 00:00:00 2001 From: Yeechan Lu Date: Mon, 17 Mar 2014 03:36:38 +0800 Subject: [PATCH] ToPinyin: Convert to SimpChinese at first --- Wox.Infrastructure/ChineseToPinYin.cs | 1 + Wox.Infrastructure/Wox.Infrastructure.csproj | 1 + 2 files changed, 2 insertions(+) diff --git a/Wox.Infrastructure/ChineseToPinYin.cs b/Wox.Infrastructure/ChineseToPinYin.cs index 83cf44f650..8e0dc6e68e 100644 --- a/Wox.Infrastructure/ChineseToPinYin.cs +++ b/Wox.Infrastructure/ChineseToPinYin.cs @@ -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; diff --git a/Wox.Infrastructure/Wox.Infrastructure.csproj b/Wox.Infrastructure/Wox.Infrastructure.csproj index c34ad3a0ce..3047e8d4db 100644 --- a/Wox.Infrastructure/Wox.Infrastructure.csproj +++ b/Wox.Infrastructure/Wox.Infrastructure.csproj @@ -32,6 +32,7 @@ 4 + ..\packages\Newtonsoft.Json.5.0.8\lib\net35\Newtonsoft.Json.dll