OSDN Git Service

半角スペースの文字化け対策
authorh677 <h677>
Thu, 15 Jan 2004 15:05:15 +0000 (15:05 +0000)
committerh677 <h677>
Thu, 15 Jan 2004 15:05:15 +0000 (15:05 +0000)
res/ExternalBoardPlugIn/ShitarabaJBBSPlugIn.dpr
res/ExternalBoardPlugIn/ShitarabaPlugIn.dpr

index 729456e..09814f3 100644 (file)
@@ -79,7 +79,7 @@ const
        MAJOR_VERSION                   = 1;
        MINOR_VERSION                   = 0;
        RELEASE_VERSION         = 'beta';
-       REVISION_VERSION        = 11;
+       REVISION_VERSION        = 12;
 
 // =========================================================================
 // \8eG\97p\8aÖ\90\94
@@ -369,6 +369,7 @@ var
        uri                                             : TIdURI;
        uriList                         : TStringList;
        datURL                          : string;
+    tmpText: string;
 begin
 
        Result := dsError;
@@ -406,8 +407,8 @@ begin
                if (responseCode = 200) or (responseCode = 206) then begin
                        downResult := TStringList.Create;
                        try
-                               downResult.Text := EUCtoSJIS( string( tmp ) );
-
+                tmpText := CustomStringReplace( string( tmp ), '¡÷¡®', ' ' );
+                               downResult.Text := EUCtoSJIS( tmpText );
                                if downResult.Count > 0 then begin
                                        if FileExists( FilePath ) then
                                                logStream := TFileStream.Create( FilePath, fmOpenReadWrite or fmShareDenyWrite )
@@ -880,6 +881,7 @@ var
        uri                                             : TIdURI;
        uriList                         : TStringList;
        i                                                       : Integer;
+    tmpText : String;
 begin
 
        Result := dsError;
@@ -916,7 +918,8 @@ begin
                                ForceDirectoriesEx( Copy( FilePath, 1, LastDelimiter( '\', FilePath ) ) );
 
                                // EUC \82ð Shift_JIS \82É
-                               FDat.Text := EUCtoSJIS( string( downResult ) );
+                tmpText := CustomStringReplace( string( downResult ), '¡÷¡®', ' ');
+                               FDat.Text := EUCtoSJIS( tmpText );
                                // \82µ\82½\82ç\82ΠJBBS \82Í\83`\83F\83b\83N\97p\82É\90æ\93ª\82Æ\8dÅ\8fI\8ds\82ª\93¯\82
                                i := FDat.Count - 1;
                                if i > 0 then   // 1 \8cÂ\82¾\82Á\82½\82ç\8fã\89º\82à\82­\82»\82à\96³\82¢\82©\82ç 0 \82Í\8aÜ\82Ü\82¸
index 318ad88..3d0c712 100644 (file)
@@ -367,6 +367,7 @@ var
        uriList                         : TStringList;
        datURL                          : string;
        downResult              : TStringList;
+    tmpText : String;
 const
        LF                                              = #10;
 begin
@@ -418,7 +419,8 @@ begin
 
                                                if Count = 0 then begin
                                                        Result := dsComplete;
-                                                       downResult.Text                 := EUCtoSJIS( string( tmp ) );
+                            tmpText := CustomStringReplace( string( tmp ), '¡÷¡®', ' ');
+                                                       downResult.Text                 := EUCtoSJIS( string( tmpText ) );
                                                        logStream.Position      := logStream.Size;
                                                        logStream.Write( PChar( downResult.Text )^, Length( downResult.Text ) );
 
@@ -429,7 +431,8 @@ begin
                                                end else if LF = tmp^ then begin
                                                        // \90V\8bK\81A\82Ü\82½\82Í\92Ç\8bL
                                                        Result := dsDiffComplete;
-                                                       downResult.Text                 := EUCtoSJIS( string( tmp + 1 ) );
+                            tmpText := CustomStringReplace( string( tmp + 1 ), '¡÷¡®', ' ');
+                                                       downResult.Text                 := EUCtoSJIS( string( tmpText ) );
                                                        logStream.Position      := logStream.Size;
                                                        logStream.Write( PChar( downResult.Text )^, Length( downResult.Text ) );
 
@@ -444,7 +447,8 @@ begin
                                                        modified                        := LastModified;
                                                        responseCode    := InternalDownload(
                                                                PChar( datURL ), modified, tmp2, 0, Size );
-                                                       downResult.Text := EUCtoSJIS( string( tmp2 ) + string( tmp ) );
+                            tmpText := CustomStringReplace( string( tmp2 ) + string( tmp ), '¡÷¡®', ' ');
+                                                       downResult.Text := EUCtoSJIS( tmpText );
                                                        logStream.Position := 0;
                                                        logStream.Write( PChar( downResult.Text )^, Length( downResult.Text ) );
 
@@ -803,6 +807,7 @@ var
        responseCode    : Longint;
        uri                                             : TIdURI;
        uriList                         : TStringList;
+    tmpText : String;
 begin
 
        Result := dsError;
@@ -839,7 +844,8 @@ begin
                                ForceDirectoriesEx( Copy( FilePath, 1, LastDelimiter( '\', FilePath ) ) );
 
                                // EUC \82ð Shift_JIS \82É
-                               FDat.Text := EUCtoSJIS( string( downResult ) );
+                tmpText := CustomStringReplace( string( downResult ), '¡÷¡®', ' ');
+                               FDat.Text := EUCtoSJIS( tmpText );
                                // \95Û\91
                                FDat.SaveToFile( FilePath );