mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 17:58:03 +02:00
Renames some utf8strings to strings as a temporary workaround for fpc 2.7 until the Unicode RTL encoding is decided
git-svn-id: trunk@33288 -
This commit is contained in:
parent
da01ce8458
commit
121b0d4e52
@ -214,9 +214,9 @@ function SetCurrentDirUTF8(const NewDir: String): Boolean;
|
||||
function CreateDirUTF8(const NewDir: String): Boolean;
|
||||
function RemoveDirUTF8(const Dir: String): Boolean;
|
||||
function ForceDirectoriesUTF8(const Dir: string): Boolean;
|
||||
function FileOpenUTF8(Const FileName : utf8string; Mode : Integer) : THandle;
|
||||
function FileCreateUTF8(Const FileName : utf8String) : THandle; overload;
|
||||
function FileCreateUTF8(Const FileName : utf8String; Rights: Cardinal) : THandle; overload;
|
||||
function FileOpenUTF8(Const FileName : string; Mode : Integer) : THandle;
|
||||
function FileCreateUTF8(Const FileName : string) : THandle; overload;
|
||||
function FileCreateUTF8(Const FileName : string; Rights: Cardinal) : THandle; overload;
|
||||
|
||||
// environment
|
||||
function ParamStrUTF8(Param: Integer): string;
|
||||
|
@ -41,7 +41,7 @@ function UTF16CharacterToUnicode(p: PWideChar; out CharLen: integer): Cardinal;
|
||||
function UnicodeToUTF16(u: cardinal): widestring;
|
||||
|
||||
function UnicodeLowercase(u: cardinal): cardinal;
|
||||
function UTF8LowerCaseViaTables(const s: utf8string): utf8string;
|
||||
function UTF8LowerCaseViaTables(const s: string): string;
|
||||
|
||||
implementation
|
||||
|
||||
@ -896,7 +896,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function UTF8LowerCaseViaTables(const s: utf8string): utf8string;
|
||||
function UTF8LowerCaseViaTables(const s: string): string;
|
||||
var
|
||||
i: PtrInt;
|
||||
CharLen: integer;
|
||||
|
@ -61,8 +61,8 @@ function UTF8Copy(const s: string; StartCharIndex, CharCount: PtrInt): string;
|
||||
procedure UTF8Delete(var s: String; StartCharIndex, CharCount: PtrInt);
|
||||
procedure UTF8Insert(const source: String; var s: string; StartCharIndex: PtrInt);
|
||||
|
||||
function UTF8LowerCase(const AInStr: utf8string; ALanguage: utf8string=''): utf8string;
|
||||
function UTF8UpperCase(const AInStr: utf8string; ALanguage: utf8string=''): utf8string;
|
||||
function UTF8LowerCase(const AInStr: string; ALanguage: string=''): string;
|
||||
function UTF8UpperCase(const AInStr: string; ALanguage: string=''): string;
|
||||
function FindInvalidUTF8Character(p: PChar; Count: PtrInt;
|
||||
StopOnNonASCII: Boolean = false): PtrInt;
|
||||
function ValidUTF8String(const s: String): String;
|
||||
@ -71,8 +71,8 @@ procedure AssignUTF8ListToAnsi(UTF8List, AnsiList: TStrings);
|
||||
|
||||
//compare functions
|
||||
|
||||
function UTF8CompareStr(const S1, S2: utf8string): Integer;
|
||||
function UTF8CompareText(const S1, S2: utf8string): Integer;
|
||||
function UTF8CompareStr(const S1, S2: string): Integer;
|
||||
function UTF8CompareText(const S1, S2: string): Integer;
|
||||
|
||||
type
|
||||
TConvertResult = (trNoError, trNullSrc, trNullDest, trDestExhausted,
|
||||
@ -668,7 +668,7 @@ end;
|
||||
The columns in the file UnicodeData.txt are explained here:
|
||||
http://www.ksu.ru/eng/departments/ktk/test/perl/lib/unicode/UCDFF301.html#Case Mappings
|
||||
}
|
||||
function UTF8LowerCase(const AInStr: utf8string; ALanguage: utf8string=''): utf8string;
|
||||
function UTF8LowerCase(const AInStr: string; ALanguage: string=''): string;
|
||||
var
|
||||
CounterDiff: PtrInt;
|
||||
InStr, InStrEnd, OutStr: PChar;
|
||||
@ -1810,7 +1810,7 @@ end;
|
||||
The columns in the file UnicodeData.txt are explained here:
|
||||
http://www.ksu.ru/eng/departments/ktk/test/perl/lib/unicode/UCDFF301.html#Case Mappings
|
||||
}
|
||||
function UTF8UpperCase(const AInStr: utf8string; ALanguage: utf8string=''): utf8string;
|
||||
function UTF8UpperCase(const AInStr: string; ALanguage: string=''): string;
|
||||
var
|
||||
i, InCounter, OutCounter: PtrInt;
|
||||
OutStr: PChar;
|
||||
@ -2270,7 +2270,7 @@ end;
|
||||
Note: Use this function instead of AnsiCompareStr.
|
||||
This function guarantees proper collation on all supported platforms.
|
||||
------------------------------------------------------------------------------}
|
||||
function UTF8CompareStr(const S1, S2: utf8string): Integer;
|
||||
function UTF8CompareStr(const S1, S2: string): Integer;
|
||||
begin
|
||||
Result := SysUtils.CompareStr(S1, S2);
|
||||
end;
|
||||
@ -2283,9 +2283,9 @@ end;
|
||||
Note: Use this function instead of AnsiCompareText.
|
||||
This function guarantees proper collation on all supported platforms.
|
||||
------------------------------------------------------------------------------}
|
||||
function UTF8CompareText(const S1, S2: utf8string): Integer;
|
||||
function UTF8CompareText(const S1, S2: string): Integer;
|
||||
var
|
||||
S1Lower, S2Lower: utf8string;
|
||||
S1Lower, S2Lower: string;
|
||||
begin
|
||||
S1Lower := UTF8LowerCase(S1);
|
||||
S2Lower := UTF8LowerCase(S2);
|
||||
|
@ -377,17 +377,17 @@ begin
|
||||
Result:=SysUtils.DirectoryExists(UTF8ToSys(Directory));
|
||||
end;
|
||||
|
||||
function FileOpenUTF8(Const FileName : utf8string; Mode : Integer) : THandle;
|
||||
function FileOpenUTF8(Const FileName : string; Mode : Integer) : THandle;
|
||||
begin
|
||||
Result := SysUtils.FileOpen(FileName, Mode);
|
||||
end;
|
||||
|
||||
function FileCreateUTF8(Const FileName : utf8string) : THandle;
|
||||
function FileCreateUTF8(Const FileName : string) : THandle;
|
||||
begin
|
||||
Result := SysUtils.FileCreate(FileName);
|
||||
end;
|
||||
|
||||
function FileCreateUTF8(Const FileName : utf8String; Rights: Cardinal) : THandle;
|
||||
function FileCreateUTF8(Const FileName : string; Rights: Cardinal) : THandle;
|
||||
begin
|
||||
Result := SysUtils.FileCreate(FileName, Rights);
|
||||
end;
|
||||
|
@ -588,7 +588,7 @@ begin
|
||||
Result:=False;
|
||||
end;
|
||||
|
||||
function FileOpenUTF8(Const FileName : utf8string; Mode : Integer) : THandle;
|
||||
function FileOpenUTF8(Const FileName : string; Mode : Integer) : THandle;
|
||||
const
|
||||
AccessMode: array[0..2] of Cardinal = (
|
||||
GENERIC_READ,
|
||||
@ -607,13 +607,13 @@ begin
|
||||
//if fail api return feInvalidHandle (INVALIDE_HANDLE=feInvalidHandle=-1)
|
||||
end;
|
||||
|
||||
function FileCreateUTF8(Const FileName : utf8string) : THandle;
|
||||
function FileCreateUTF8(Const FileName : string) : THandle;
|
||||
begin
|
||||
Result := CreateFileW(PWideChar(UTF8Decode(FileName)), GENERIC_READ or GENERIC_WRITE,
|
||||
0, nil, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
end;
|
||||
|
||||
function FileCreateUTF8(Const FileName : utf8String; Rights: Cardinal) : THandle;
|
||||
function FileCreateUTF8(Const FileName : string; Rights: Cardinal) : THandle;
|
||||
begin
|
||||
Result := CreateFileW(PWideChar(UTF8Decode(FileName)), GENERIC_READ or GENERIC_WRITE,
|
||||
0, nil, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user