由于UTF8编码的问题导致SynEdit 源码显示为乱码不能编译,请按下面代码进行修改:
1. SynEdit.pas
function TCustomSynEdit.IsWordBreakChar(AChar: WideChar): Boolean; begin if Assigned(Highlighter) then Result := Highlighter.IsWordBreakChar(AChar) else case AChar of #0..#32, '.', ',', ';', ':', '"', '''', #$00B4, '`', #$00B0, '^', '!', '?', '&', '$', '@', #$00A7, '%', '#', '~', '[', ']', '(', ')', '{', '}', '<', '>', '-', '=', '+', '*', '/', '\', '|': Result := True; else Result := False; end;
function TSynCustomHighlighter.IsWordBreakChar(AChar: WideChar): Boolean; begin case AChar of #0..#32, '.', ',', ';', ':', '"', '''', #$00B4, '`', #$00B0, '^', '!', '?', '&', '$', '@', #$00A7, '%', '#', '~', '[', ']', '(', ')', '{', '}', '<', '>', '-', '=', '+', '*', '/', '\', '|': Result := True; else Result := False; end; end;
function IsWordBreakChar(C: WideChar): Boolean; begin case C of #0..#32, '.', ',', ';', ':', '"', '''', #$00B4, '`',#$00B0, '^', '!', '?', '&', '$', '@', #$00A7, '%', '#', '~', '[', ']', '(', ')', '{', '}', '<', '>', '-', '=', '+', '*', '/', '\', '|': Result := True; else Result := False; end; end;
procedure TSynJavaSyn.Next; begin fTokenPos := Run; case fRange of rsComment: CommentProc; rsDocument: CommentProc; else begin fRange := rsUnknown; case fLine[Run] of '&': AndSymbolProc; #39: AsciiCharProc; '@': AtSymbolProc; '}': BraceCloseProc; '{': BraceOpenProc; #13: CRProc; ':': ColonProc; ',': CommaProc; '=': EqualProc; '>': GreaterProc; 'A'..'Z', 'a'..'z', '_', '$', #$00C0..#$00D6,#$00D8..#$00F6, #$00F8..#$00FF: IdentProc; #10: LFProc; '<': LowerProc; '-': MinusProc; '*': MultiplyProc; '!': NotSymbolProc; #0: NullProc; '0'..'9': NumberProc; '|': OrSymbolProc; '+': PlusProc; '.': PointProc; '#': PoundProc; '?': QuestionProc; '%': RemainderSymbolProc; ')': RoundCloseProc; '(': RoundOpenProc; ';': SemiColonProc; '/': SlashProc; #1..#9, #11, #12, #14..#32: SpaceProc; ']': SquareCloseProc; '[': SquareOpenProc; #34: StringProc; '~': TildeProc; '^': XOrSymbolProc; else UnknownProc; end; end; end;
function TSynJavaSyn.IsIdentChar(AChar: WideChar): Boolean; begin case AChar of '_', '$', '0'..'9', 'a'..'z', 'A'..'Z', #$00C0..#$00D6, #$00D8..#$00F6,#$00F8..#$00FF: Result := True; else Result := False; end; end;