1 修复淘宝拍单窗口可能崩溃问题
2 拼多多中转仓拍单随机地址支持随机繁体字
This commit is contained in:
1 parent
5b9ed01fa1
commit
ac93305d5f
8 files changed
+155
-21
No files matched your search
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AllBase.Util;
|
||||
|
||||
public class ChineseStringConverter
|
||||
{
|
||||
private const int LCMAP_SIMPLIFIED_CHINESE = 0x02000000;
|
||||
private const int LCMAP_TRADITIONAL_CHINESE = 0x04000000;
|
||||
|
||||
[DllImport("kernel32", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
private static extern int LCMapString(int Locale, int dwMapFlags, string lpSrcStr, int cchSrc, [Out] string lpDestStr, int cchDest);
|
||||
|
||||
public static string ToSimplified(string source)
|
||||
{
|
||||
string target = new string(' ', source.Length);
|
||||
LCMapString(0x0800, LCMAP_SIMPLIFIED_CHINESE, source, source.Length, target, source.Length);
|
||||
return target;
|
||||
}
|
||||
|
||||
public static string ToTraditional(string source)
|
||||
{
|
||||
string target = new string(' ', source.Length);
|
||||
LCMapString(0x0800, LCMAP_TRADITIONAL_CHINESE, source, source.Length, target, source.Length);
|
||||
return target;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user