unit DelphiCompat;

interface

{$IFNDEF UNICODE}
type
  TSysCharSet = set of Char;

function CharInSet(C: Char; ASet: TSysCharSet): boolean; overload;
function CharInSet(C: WideChar; ASet: TSysCharSet): boolean; overload;
{$ENDIF}

implementation

{$IFNDEF UNICODE}
function CharInSet(C: Char; ASet: TSysCharSet): boolean;
begin
  Result := C in ASet;
end;

function CharInSet(C: WideChar; ASet: TSysCharSet): boolean;
begin
  if C >= #256 then
    Result := False
  else
    Result := AnsiChar(C) in ASet;
end;
{$ENDIF}

end.
