OSDN Git Service

文字列の全半角ひらカナを半角カナに統一するところでの余分な
authorh677 <h677>
Sat, 29 Oct 2005 14:52:48 +0000 (14:52 +0000)
committerh677 <h677>
Sat, 29 Oct 2005 14:52:48 +0000 (14:52 +0000)
文字列の生成を抑制。

MojuUtils.pas

index 2c949c6..dea2dd4 100644 (file)
@@ -251,21 +251,19 @@ end;
  *************************************************************************)
 function ZenToHan(const s: string): string;
 var
-       //Chr: array [0..1024] of char;
-       Chr: string;
        ChrLen  : Integer;
 begin
-       SetLength(Chr, Length(s));
+       SetLength(Result, Length(s));
        ChrLen := Windows.LCMapString(
                 GetUserDefaultLCID(),
 //              LCMAP_HALFWIDTH,
                 LCMAP_HALFWIDTH or LCMAP_KATAKANA or LCMAP_LOWERCASE,
                 PChar(s),
                 Length(s),
-                PChar(Chr),
-                Length(Chr)
+                PChar(Result),
+                Length(Result)
                 );
-       Result := Copy(Chr, 1, ChrLen);
+       SetLength(Result, ChrLen);
 end;
 
 (*************************************************************************