anchor.diff:  {$endif}
   
   function UTF8RangeToRegEx(Lo,Hi:longword):ansistring;
  -type TString6Chars=string[6];
  +type TString6Chars=array[0..6] of ansichar;
   const Seq0010ffff:array[0..6,0..4,0..1] of longint=((($00,$7f),(-1,-1),(-1,-1),(-1,-1),(-1,-1)),        // 00-7F
                                                       (($c2,$df),($80,$bf),(-1,-1),(-1,-1),(-1,-1)),      // C2-DF 80-BF
                                                       (($e0,$e0),($a0,$bf),($80,$bf),(-1,-1),(-1,-1)),    // E0-E0 A0-BF 80-BF
  
positive.code:  begin
    case CharValue of
     $00000000..$0000007f:begin
      SetLength(result,1);
      result[1]:=ansichar(byte(CharValue));
     end;
     $00000080..$000007ff:begin
      SetLength(result,2);
      result[1]:=ansichar(byte($c0 or ((CharValue shr 6) and $1f)));
      result[2]:=ansichar(byte($80 or (CharValue and $3f)));
     end;
  // {$ifdef PLREStrictUTF8}$00000800..$0000d7ff,$0000e000..$0000ffff{$else}$00000800..$0000ffff{$endif}:begin
     $00000800..$0000ffff:begin
      SetLength(result,3);
      result[1]:=ansichar(byte($e0 or ((CharValue shr 12) and $0f)));
      result[2]:=ansichar(byte($80 or ((CharValue shr 6) and $3f)));
      result[3]:=ansichar(byte($80 or (CharValue and $3f)));
     end;
     $00010000..$0010ffff:begin
      SetLength(result,4);
      result[1]:=ansichar(byte($f0 or ((CharValue shr 18) and $07)));
      result[2]:=ansichar(byte($80 or ((CharValue shr 12) and $3f)));
      result[3]:=ansichar(byte($80 or ((CharValue shr 6) and $3f)));
      result[4]:=ansichar(byte($80 or (CharValue and $3f)));
     end;
     $00200000..$03ffffff:begin
      SetLength(result,5);
      result[1]:=ansichar(byte($f8 or ((CharValue shr 24) and $03)));
      result[2]:=ansichar(byte($80 or ((CharValue shr 18) and $3f)));
      result[3]:=ansichar(byte($80 or ((CharValue shr 12) and $3f)));
  
negative.code:     result[5]:=ansichar(byte($80 or (CharValue and $3f)));
     end;
     $04000000..$7fffffff:begin
      result[0]:=ansichar(byte(6));
      result[1]:=ansichar(byte($fc or ((CharValue shr 30) and $01)));
      result[2]:=ansichar(byte($80 or ((CharValue shr 24) and $3f)));
      result[3]:=ansichar(byte($80 or ((CharValue shr 18) and $3f)));
  