Вниз
Скачать: CL | DM;

ANSI <-> WIDE   Найти похожие ветки 

 
Jon ©   (2008-11-05 01:52) [0]

What is the best way to convert a Unicode file to an ANSI file?
The function Koi8ToAnsi works well for the Cyrillic alphabet, is there a general UTF method?
I understand that D2009 can do it with the TEncoding class but looking for a KOL and Delphi 7 equivalent.


 
L`Autour ©   (2008-11-05 06:15) [1]

WinApi: WideCharToMultiByte


 
samir105 ©   (2008-11-05 16:11) [2]

You can use Utf8Encode to convert unicode to utf8 and Utf8Decode to convert unicode to utf8.


var
 ws: widestring;
 s: string;
begin
 ws:="some unicode text";
 s:=Utf8Encode(ws); // Utf8 string
end;


 
Jon ©   (2008-11-05 18:05) [3]

Thanks guys. I found that reading with a stream then writing to a text file worked.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.003 c
2-1280431419
MAXHO
2010-07-29 23:23
2010.10.24
Как вравнить дату ?


15-1279632976
Galera
2010-07-20 17:36
2010.10.24
NT AUTHORITY SYSTEM перегрузит ваш компьютер


2-1280146994
nordford
2010-07-26 16:23
2010.10.24
Обход препятсвия


2-1275650542
Archi
2010-06-04 15:22
2010.10.24
Голосовой чат. Нужна помощь


15-1279225777
Юрий
2010-07-16 00:29
2010.10.24
С днем рождения ! 16 июля 2010 пятница




   Наверх