Browse Source

rtl: add SetTextCodePage, GetTextCodePage functions which set/get TTextRec.CodePage field

git-svn-id: trunk@19541 -
paul 13 years ago
parent
commit
2254dad68a
2 changed files with 18 additions and 0 deletions
  1. 2 0
      rtl/inc/systemh.inc
  2. 16 0
      rtl/inc/text.inc

+ 2 - 0
rtl/inc/systemh.inc

@@ -997,6 +997,8 @@ Function  SeekEOF:Boolean;
 Procedure SetTextBuf(var f:Text; var Buf);[INTERNPROC:fpc_in_settextbuf_file_x];
 Procedure SetTextBuf(var f:Text; var Buf; Size:SizeInt);
 Procedure SetTextLineEnding(var f:Text; Ending:string);
+function GetTextCodePage(var T: Text): TSystemCodePage;
+procedure SetTextCodePage(var T: Text; CodePage: TSystemCodePage);
 {$endif FPC_HAS_FEATURE_TEXTIO}
 
 {****************************************************************************

+ 16 - 0
rtl/inc/text.inc

@@ -441,6 +441,22 @@ Begin
   TextRec(F).LineEnd:=Ending;
 End;
 
+function GetTextCodePage(var T: Text): TSystemCodePage;
+begin
+{$ifndef ver2_4}
+  GetTextCodePage:=TextRec(T).CodePage;
+{$else}
+  GetTextCodePage:=0;
+{$endif ver2_4}
+end;
+
+procedure SetTextCodePage(var T: Text; CodePage: TSystemCodePage);
+begin
+{$ifndef ver2_4}
+  TextRec(T).CodePage:=CodePage;
+{$endif ver2_4}
+end;
+
 
 Function fpc_get_input:PText;compilerproc;
 begin