trichview.com

trichview.support




Re: UTF-8


Return to index


Author

Message

Sergey Tkachenko

Posted: 01/28/2003 0:20:12


var Stream: TStream;

     ws: WideString;

     s: String;


// saving text in ws

Stream := TMemoryStream.Create;

rv.SaveTextToStreamW('', Stream, 80, False, False);

Stream.Position := 0;

SetLength(ws, Stream.Size div 2);

Stream.ReadBuffer(Pointer(ws)^, Stream.Size);

Stream.Free;


// converting to UTF8

s := Utf8Encode(ws);


// saving to file

Stream := TFileStream.Create(FileName, fmCreate);

Stream.WriteBuffer(PChar(s)^, Length(s));

Stream.Free;




>

> Hi, does anyone know of a way to convert the unicode file saved with

SaveTextW,

> to UTF-8 format?

>

> Thanks, Gary





Powered by ABC Amber Outlook Express Converter