Browse Source

* Select proper stringbuilder depending on size of char

Michaël Van Canneyt 1 year ago
parent
commit
6f25cccda9
1 changed files with 4 additions and 0 deletions
  1. 4 0
      rtl/objpas/sysutils/sysstrh.inc

+ 4 - 0
rtl/objpas/sysutils/sysstrh.inc

@@ -346,7 +346,11 @@ Type
 {$undef SBUNICODE}
 {$undef SBUNICODE}
 
 
 Type
 Type
+{$IF SIZEOF(CHAR)=1}
   TStringBuilder = TAnsiStringBuilder;
   TStringBuilder = TAnsiStringBuilder;
+{$ELSE}
+  TStringBuilder = TUnicodeStringBuilder;
+{$ENDIF}
 
 
 function SafeFormat (const Fmt: AnsiString; Args: array of const; const FormatSettings: TFormatSettings): UTF8String; overload;
 function SafeFormat (const Fmt: AnsiString; Args: array of const; const FormatSettings: TFormatSettings): UTF8String; overload;
 function SafeFormat (const Fmt: AnsiString; Args: array of const): UTF8String; overload;
 function SafeFormat (const Fmt: AnsiString; Args: array of const): UTF8String; overload;