Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi Standard Input Output Code page

Delphi 2010

When reading from file using readLn procedure, by default i get unicode string converted from code page 1251 (code page of windows).

How can i change this and read from file in other code page, in 1252 or UTF16 ?

like image 922
Astronavigator Avatar asked Nov 05 '22 14:11

Astronavigator


1 Answers

Don't use ReadLn/WriteLn for new code. As suggested by Michael Madsen use TStreamReader in SysUtils.

like image 58
alex Avatar answered Nov 15 '22 06:11

alex