Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2010.10.24;
Скачать: 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 вся ветка

Текущий архив: 2010.10.24;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.005 c
3-1246952901
bafy
2009-07-07 11:48
2010.10.24
Как подключить библиотеки для работы с ODBC?


6-1228000045
Pall
2008-11-30 02:07
2010.10.24
tcp сервер


15-1279190064
Novik
2010-07-15 14:34
2010.10.24
Современное телевидение


15-1279608089
И. Павел
2010-07-20 10:41
2010.10.24
Банковское округление


6-1227811974
stas
2008-11-27 21:52
2010.10.24
Проверить наличие коннекта к определенному IP