我有RAR-component 2.0和Delphi2010。此组件使用AnsiString作为文件路径。如何使其成为unicode?我在RAR.pas中将AnsiString更改为String,但没有帮助。
谢谢!
最佳答案
在RAR.pas中:
将TRARArchiveInformation的fFileName
字段和Filename
属性更改为WideString。
更改TRAR.OpenFile
,使FileName
参数为WideString。
在TRAR.OpenArchive(Extract:boolean)
中更改此行:ArcName := PAnsiChar(fArchiveInformation.FileName);
对此:ArcNameW := PWideChar(fArchiveInformation.FileName);
在RAR_DLL.pas中:
更改GetFileModifyDate
,使此行:
h := OpenFile(PAnsiChar(FileName), Struct, OF_SHARE_DENY_NONE);
这是:
h := FileOpen(FileName, fmOpenRead or fmShareDenyNone);
并从var块中删除
Struct: TOFSTRUCT;
行。
关于delphi - Delphi:使Unicode RAR-Component 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6323121/