how to write unicode string to a text file lazarus / 62-General ---------------------------------------------------------------------- fcu · 2018-12-19 08:00 Hi i'd like to write unicode string to a text file , i tried this but doesn't work Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$codepage utf8}var s : utf8string;var f : textfile;begin        s := 'Привет, мир';        AssignFile(f,'text.txt');        Rewrite(f);        writeln(f,s);        closefile(f);end. ---------------------------------------------------------------------- fcu · 2018-12-19 08:04 ok i fix it by add setcodepage function Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  SetCodePage(RawByteString(s), 1252, false);