Commit 9d2c2cf6 刘韬

替换 u o特殊字符

1 个父辈 d3833fb6
...@@ -145,7 +145,8 @@ namespace ScanCodeServer ...@@ -145,7 +145,8 @@ namespace ScanCodeServer
int x = (int)Math.Round(hv_Column.DArr[i]); int x = (int)Math.Round(hv_Column.DArr[i]);
int y = (int)Math.Round(hv_Row1.DArr[i]); int y = (int)Math.Round(hv_Row1.DArr[i]);
string str = hv_DecodedDataStrings.SArr[i]; string str = hv_DecodedDataStrings.SArr[i];
str = SpecialCharReplace(str);
//var isv = IsStringValid(str); //var isv = IsStringValid(str);
CodeInfo code = new CodeInfo(str, x, y); CodeInfo code = new CodeInfo(str, x, y);
codeList.Add(code); codeList.Add(code);
...@@ -205,6 +206,20 @@ namespace ScanCodeServer ...@@ -205,6 +206,20 @@ namespace ScanCodeServer
} }
} }
public static string SpecialCharReplace(string str)
{
if (str.IndexOf("惟") > -1)
{
str = str.Replace("惟", "Ω");
}
if (str.IndexOf("渭") > -1)
{
str = str.Replace("渭", "μ");
}
return str;
}
static bool IsStringValid(string str) static bool IsStringValid(string str)
{ {
Encoding encoding = Encoding.GetEncoding("gb2312"); // 修改为你需要的编码方式 Encoding encoding = Encoding.GetEncoding("gb2312"); // 修改为你需要的编码方式
......
...@@ -93,6 +93,7 @@ namespace ScanCodeServer ...@@ -93,6 +93,7 @@ namespace ScanCodeServer
{ {
CodeInfo ci = new CodeInfo(Marshal.PtrToStringAnsi(tpResults[i].hText), tpResults[i].iCenterX, tpResults[i].iCenterY); CodeInfo ci = new CodeInfo(Marshal.PtrToStringAnsi(tpResults[i].hText), tpResults[i].iCenterX, tpResults[i].iCenterY);
ci.CodeType = Marshal.PtrToStringAnsi(tpResults[i].hType); ci.CodeType = Marshal.PtrToStringAnsi(tpResults[i].hType);
ci.CodeStr = HDCodeHelper.SpecialCharReplace(ci.CodeStr);
codelist.Add(ci); codelist.Add(ci);
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!