mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-07 15:58:20 +02:00
lazutils: fixed UTF8FindNearestCharStart for 64bit long strings
git-svn-id: trunk@45053 -
This commit is contained in:
parent
ad050e9ddd
commit
5992cb80f4
@ -54,8 +54,8 @@ function UnicodeToUTF8SkipErrors(CodePoint: cardinal; Buf: PChar): integer;
|
|||||||
function UnicodeToUTF8Inline(CodePoint: cardinal; Buf: PChar): integer; inline;
|
function UnicodeToUTF8Inline(CodePoint: cardinal; Buf: PChar): integer; inline;
|
||||||
function UTF8ToDoubleByteString(const s: string): string;
|
function UTF8ToDoubleByteString(const s: string): string;
|
||||||
function UTF8ToDoubleByte(UTF8Str: PChar; Len: PtrInt; DBStr: PByte): PtrInt;
|
function UTF8ToDoubleByte(UTF8Str: PChar; Len: PtrInt; DBStr: PByte): PtrInt;
|
||||||
function UTF8FindNearestCharStart(UTF8Str: PChar; Len: integer;
|
function UTF8FindNearestCharStart(UTF8Str: PChar; Len: SizeInt;
|
||||||
BytePos: integer): integer;
|
BytePos: SizeInt): SizeInt;
|
||||||
// find the n-th UTF8 character, ignoring BIDI
|
// find the n-th UTF8 character, ignoring BIDI
|
||||||
function UTF8CharStart(UTF8Str: PChar; Len, CharIndex: PtrInt): PChar;
|
function UTF8CharStart(UTF8Str: PChar; Len, CharIndex: PtrInt): PChar;
|
||||||
// find the byte index of the n-th UTF8 character, ignoring BIDI (byte len of substr)
|
// find the byte index of the n-th UTF8 character, ignoring BIDI (byte len of substr)
|
||||||
@ -484,8 +484,8 @@ end;
|
|||||||
|
|
||||||
{ Find the start of the UTF8 character which contains BytePos,
|
{ Find the start of the UTF8 character which contains BytePos,
|
||||||
Len is length in byte, BytePos starts at 0 }
|
Len is length in byte, BytePos starts at 0 }
|
||||||
function UTF8FindNearestCharStart(UTF8Str: PChar; Len: integer;
|
function UTF8FindNearestCharStart(UTF8Str: PChar; Len: SizeInt; BytePos: SizeInt
|
||||||
BytePos: integer): integer;
|
): SizeInt;
|
||||||
begin
|
begin
|
||||||
Result:=0;
|
Result:=0;
|
||||||
if (UTF8Str<>nil) and (Len>0) and (BytePos>=0) then begin
|
if (UTF8Str<>nil) and (Len>0) and (BytePos>=0) then begin
|
||||||
|
Loading…
Reference in New Issue
Block a user