Browse Source

* unicode version of isleadchar. utf8 still to follow, see #34754

git-svn-id: trunk@41085 -
marco 6 years ago
parent
commit
0da16e7dbe
2 changed files with 9 additions and 0 deletions
  1. 6 0
      rtl/objpas/sysutils/syswide.inc
  2. 3 0
      rtl/objpas/sysutils/syswideh.inc

+ 6 - 0
rtl/objpas/sysutils/syswide.inc

@@ -11,6 +11,11 @@
     *********************************************************************
 }
 
+function IsLeadChar(Ch: WideChar): Boolean;
+begin
+    Result := (Ch >= #$D800) and (Ch <= #$DFFF);
+end;
+
 function Trim(const S: widestring): widestring;
 	var 
 	  Ofs, Len: sizeint;
@@ -180,6 +185,7 @@ begin
   result:=(Ch<=#$FF) and (ansichar(byte(ch)) in CSet);
 end;
 
+
 {$macro on}
 {$define INWIDESTRINGREPLACE}
 {$define SRString:=WideString}

+ 3 - 0
rtl/objpas/sysutils/syswideh.inc

@@ -35,3 +35,6 @@ function StrCopy(Dest, Source: PWideChar): PWideChar; overload;
 function StrLCopy(Dest,Source: PWideChar; MaxLen: SizeInt): PWideChar; overload;
 Function CharInSet(Ch:WideChar;Const CSet : TSysCharSet) : Boolean;
 function WideStringReplace(const S, OldPattern, NewPattern: WideString;  Flags: TReplaceFlags): WideString;
+
+function IsLeadChar(Ch: WideChar): Boolean; inline; overload;
+