浏览代码

Support output/log of Unicode directory and file names.

Martijn Laan 11 月之前
父节点
当前提交
1fd19b5d31

+ 4 - 3
Components/Lzma2/Util/7z/7zMain.c

@@ -2,9 +2,10 @@
 2024-02-28 : Igor Pavlov : Public domain */
 2024-02-28 : Igor Pavlov : Public domain */
 
 
 /* Changes by Martijn Laan for Inno Setup:
 /* Changes by Martijn Laan for Inno Setup:
-   -Does not include <stdio.h> but instead defines fputs' prototype and a stdout dummy, allowing
+   -Don't include <stdio.h> but instead define fputs' prototype and a stdout dummy, allowing
     the test application code to be embedded in another application (which should implement fputs)
     the test application code to be embedded in another application (which should implement fputs)
-   Zero other changes */
+   -Use CP_UTF8 in PrintString
+   Otherwise unchanged */
 
 
 #include "Precomp.h"
 #include "Precomp.h"
 
 
@@ -261,7 +262,7 @@ static SRes PrintString(const UInt16 *s)
   Buf_Init(&buf);
   Buf_Init(&buf);
   res = Utf16_To_Char(&buf, s
   res = Utf16_To_Char(&buf, s
       #ifndef MY_USE_UTF8
       #ifndef MY_USE_UTF8
-      , CP_OEMCP
+      , CP_UTF8
       #endif
       #endif
       );
       );
   if (res == SZ_OK)
   if (res == SZ_OK)

+ 1 - 1
Projects/Src/Compression.SevenZipDecoder.pas

@@ -67,7 +67,7 @@ end;
 
 
 function _fputs(str: PAnsiChar; unused: Pointer): Integer; cdecl;
 function _fputs(str: PAnsiChar; unused: Pointer): Integer; cdecl;
 begin
 begin
-  Log(String(str));
+  Log(UTF8ToString(str));
   Result := 1;
   Result := 1;
 end;
 end;
 
 

二进制
Projects/Src/Compression.SevenZipDecoder/7ZipDecode/IS7ZipDec.obj