anchor.diff:        if FPos.AnsiChr < FEnd.AnsiChr then
         begin
           Len := GetNextEucAsShiftJis(Buffer2);
  -        MultiByteToWideChar(FCodePage, 0, PAnsiChar(@Buffer2[0]), Len, @Result, 1);
  +        MultiByteToWideChar(932, 0, PAnsiChar(@Buffer2[0]), Len, @Result, 1);
         end
         else
           Result := TBuffChar(0);
  
positive.code:         begin
            Buffer[0] := Chr;
            Result := 1;
          end;
  
        {two byte codes / 94 character sets}
        bjsX0208_1978,
        bjsX0208_1983:
          Result := GetAsShiftJis(Chr, GetNext, Buffer);
      end;
    end;
  end;
  
negative.code:   Bytes[1] := B;
  end;
  
  //-- BG ---------------------------------------------------------- 15.07.2012 --
  function StrNCmpA(Str1, Str2: PAnsiChar; N: Integer): Integer;
  var
    StrEnd: PAnsiChar;
  begin
    StrEnd := Str1 + N;
    while Str1 < StrEnd do
    begin
      Result := Ord(Str1^) - Ord(Str2^);
      if (Result <> 0) or (Str1^ = #0) then
        Exit;
      Inc(Str1);
      Inc(Str2);
    end;
    Result := 0;
  end;
  
  //-- BG ---------------------------------------------------------- 15.07.2012 --
  function StrNPosA(Str, SubStr: PAnsiChar; N: Integer): PAnsiChar;
  // returns a pointer to the first occurrence of SubStr in the first N chars of Str.
  // Finds SubStr only, if the entire SubStr is within the first N chars.
  // Example:
  //   StrNPosA('expression', 'press', 7) finds pointer to 'pression' while
  //   StrNPosA('expression', 'press', 6) retuns nil, as 'press' is not in the first 6 chars ('expres').
  var
    L: Integer;
    StrEnd: PAnsiChar;
  begin
    StrEnd := SubStr;
    while StrEnd^ <> #0 do
      Inc(StrEnd);
    L := StrEnd - SubStr;
    if L > 0 then  // Make sure substring not null string and SubStr fits into Str at all.
    begin
      Result := Str;
      StrEnd := Str + N - L;
      while (Result < StrEnd) and (Result^ <> #0) do
      begin
        if StrNCmpA(Result, SubStr, L) = 0 then
          Exit;
        Inc(Result);
      end;
    end;
    Result := nil;
  end;
  
  { TBuffCharSetCodePageInfo }
  