THRIFT-3524 dcc32 warning "W1000 Symbol 'IsLowSurrogate' is deprecated: 'Use TCharHelper'" in Thrift.Protocol.JSON.pas
Client: Delphi
Patch: Jens Geyer
diff --git a/lib/delphi/src/Thrift.Utils.pas b/lib/delphi/src/Thrift.Utils.pas
index 15ea36f..17131ef 100644
--- a/lib/delphi/src/Thrift.Utils.pas
+++ b/lib/delphi/src/Thrift.Utils.pas
@@ -22,7 +22,7 @@
 interface
 
 uses
-  Classes, Windows, SysUtils, SyncObjs;
+  Classes, Windows, SysUtils, Character, SyncObjs;
 
 type
   IOverlappedHelper = interface
@@ -56,6 +56,14 @@
   end;
 
 
+  CharUtils = class sealed
+  public
+    class function IsHighSurrogate( const c : Char) : Boolean; static; inline;
+    class function IsLowSurrogate( const c : Char) : Boolean; static; inline;
+  end;
+
+
+
 implementation
 
 { TOverlappedHelperImpl }
@@ -186,4 +194,26 @@
 end;
 
 
+class function CharUtils.IsHighSurrogate( const c : Char) : Boolean;
+begin
+  {$IF RTLVersion  >= 28.0}  // XE7+
+  result := c.IsHighSurrogate();
+  {$ELSE}
+  result := Character.IsHighSurrogate( c);
+  {$IFEND}
+end;
+
+
+class function CharUtils.IsLowSurrogate( const c : Char) : Boolean;
+begin
+  {$IF RTLVersion  >= 28.0}  // XE7+
+  result := c.IsLowSurrogate();
+  {$ELSE}
+  result := Character.IsLowSurrogate( c);
+  {$IFEND}
+end;
+
+
+
+
 end.