Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

ANSI <-> WIDE


Jon ©   (2008-11-05 01:52:00) 

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.


Jon   (2008-11-05 18:05:00) [1]

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


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

You can use Utf8Encodeto convert unicode to utf8 and Utf8Decodeto convert unicode to utf8.


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


L`Autour   (2008-11-05 06:15:00) [3]

WinApi: WideCharToMultiByte


Наверх

Титульная страница Поиск, карта сайта Написать письмо