/// 半角转全角的函数
function ToSDB(AInput: Widestring): WideString;
var
I: Integer;
nChar: Cardinal;
begin
Result := AInput;
for I := 1 to Length(AInput) do
begin
nChar := Cardinal(WideChar(AInput));
if nChar = 32 then
begin
Result := WideChar(12288);
Continue;
end;
if (nChar < 127) then
Result := WideChar(nChar + 65248)
end;
end;
/// 全角转半角的函数
function ToDBC(const AInput: Widestring): Widestring;
var
I: Integer;
nChar: Cardinal;
begin
Result := AInput;
for I := 1 to Length(AInput) do
begin
nChar := Cardinal(WideChar(AInput));
if nChar = 12288 then
begin
Result := WideChar(32);
Continue;
end;
if (nChar > 65280) and (nChar < 65375) then
Result := WideChar(nChar - 65248)
end;
end;