Press_ALT_F4 Posted November 20, 2013 Share Posted November 20, 2013 Hallo, sorry for my english i want save/read strings like this: вℓα¢к∂єαтн™ in a txt-file or in a sqlite-db. when i save the txt-file as unicode or UTF and i read it, returns it like this: вℓα¢к∂єαтн™- (win xp) how can i reach that i can save and read the special character correctly? thx for help. good bye samplecode: program New; var datei: Integer; var s: string; var a: TStrArray; begin datei := OpenFile('E:\Datenbanken\rotliste3.txt', False); ReadFileString(datei, s, FileSize(datei)); WriteLn(s); CloseFile(datei); a:=explode(';',s); writeln(a[5] + ' --- ' + IntToStr(High(a))); end. Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 20, 2013 Share Posted November 20, 2013 As far as I can remember, SCAR currently doesn't support loading/saving unicode strings from/to files with those particular functions. Try TStringList. Quote Link to comment Share on other sites More sharing options...
Press_ALT_F4 Posted November 21, 2013 Author Share Posted November 21, 2013 thx for answer but i need die strings not in the current script. the script should write in a kind of database. a other script on other client in network need the data. any idea? bye other question: how can i send a enter in a txt-file with appendfile? i try this but dont work: f := Appendfile(LogsPath + 'Test.txt', False); WriteFileString(f, 'Hello Mars?' + #13); or this f := Appendfile(LogsPath + 'Test.txt', False); WriteFileString(f, 'Hello Mars?' + chr(13)); both dont work any idea whats wrong? Quote Link to comment Share on other sites More sharing options...
FHannes Posted November 21, 2013 Share Posted November 21, 2013 As I said, try using TStringList if you need to handle unicode strings. Also, if you're using AppendFile, the file has to already exist. Quote Link to comment Share on other sites More sharing options...
Press_ALT_F4 Posted November 22, 2013 Author Share Posted November 22, 2013 thx can u create a simple example please? i cant understand how can me help the TStringList. do u habe any idea for my second question or should i create a new thread? bye Quote Link to comment Share on other sites More sharing options...