Вниз
Скачать: 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.004 c
10-1169154882
sinys
2007-01-19 00:14
2010.10.24
Вынос сессии на COM сервер


2-1280118410
linuxoid
2010-07-26 08:26
2010.10.24
как правильнее составить цикл?


15-1279649508
Цукор5
2010-07-20 22:11
2010.10.24
Скриншот с мышью


2-1280601835
Дмитрий2
2010-07-31 22:43
2010.10.24
TBookmark


3-1247050667
Mamed1971
2009-07-08 14:57
2010.10.24
SQL server Replication




   Наверх