Double-Byte RTF stream?

General TRichView support forum. Please post your questions here
Post Reply
pix
Posts: 4
Joined: Tue Aug 12, 2008 1:49 am

Double-Byte RTF stream?

Post by pix »

hi,
is there way to load UTF16 encoded RTF stream into TRichView?

it only support LoadRTFFromStream() which is single-byte stream.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Normally, RTF contains only characters with codes <127 (except for the mode when pictures are saved in a binary form, which is rarely used).
So, RTF data can be easily converted from UTF16 to ANSI.
Just load this RTF in WideString, assign this WideString to String (a conversion will be performed), save this String to Stream, load RTF from the stream.
This techinque is used by new versions of TRichView when loading RTF from unicode memo fields, supported by Delphi 2006+ (for example, from MS Access memos).
Post Reply