windows下使用的lazarus/fpc安装到中文的目录时出错的问题由以下3个不支持中文引起的:
1、make.exe
我使用mingw64带的make.exe替换不支持中文的make.exe
2、fpc编译器
暂时知道是读取fpc.cfg时不支持utf8格式,可以fpc.cfg转为gb2312(fpc编译器还需要增加对中文的支持才能真正使用)
3、lazarus
由于lazarus\components\codetools\definetemplates.pas 的ProcessOutputLine处理中文时有问题引起的
1)在usrs增加LConvEncoding单元
2)按红色代码修改
procedure ProcessOutputLine(Line: string);varUpLine: string;function IsUpLine(p: integer; const s: string): boolean;beginResult:=StrLComp(@UpLine[p], PChar(s), length(s)) = 0;end;varSymbolName, SymbolValue, NewPath: string;i, len, CurPos: integer;Filename: String;p: SizeInt;beginLine:={$ifdef linux}SysToUtf8{$else}CP936ToUTF8{$endif}(Line);len := length(Line);if len <= 6 then Exit; // shortest match CurPos := 1;// skip timestamp e.g. [0.306]if Line[CurPos] = '[' then beginrepeat
经修改后,已可能正常编译安装lazarus/fpc,但还不能真正使用。
等完成fpc编译器修正后才可以。
