Jose's Read Only Forum 2023

General Category => General Discussion => Topic started by: Edwin Knoppert on May 18, 2011, 08:58:16 PM

Title: Unicode streamout for rtf?
Post by: Edwin Knoppert on May 18, 2011, 08:58:16 PM
I seen one other topic that the RichEdit20W streamout streams ansi code.

The flag is %SF_RTF or %SF_UNICODE

Function TheCallback( ByRef dwCookie As CookieSet, ByVal dwBuff As Dword, ByVal cb As Long, ByRef pcb As Dword ) As Long

' Shows plain ansi:
? Peek$( dwBuff, cb )

' Shows 'blocks':
? Peek$$( dwBuff, cb )

Removing the %SF_UNICODE results in the exact same behaviour.

Any idea?

Filling it with unicode + this flag works fine.

Title: Re: Unicode streamout for rtf?
Post by: Laurence Jackson on May 24, 2011, 12:55:16 AM
I haven't tried it, and I speak as someone who has to deal with RTF from time to time rather than as an RTF expert, but I believe that RTF is at most a 8-bit format. Characters beyond ASCII (though I believe that 8-bit characters from ANSI and ISO code pages can be entered directly) are encoded as special entities which use only ASCII characters.

That is, I wouldn't expect RichEdit to stream out unicode RTF because it doesn't exist. I would expect to be able to stream in and stream out unicode TEXT only. Even if RichEdit is using unicode internally, If you ask it to stream out RTF, I would expect it to encode the output into 8-bit RTF form.
Title: Re: Unicode streamout for rtf?
Post by: Edwin Knoppert on May 24, 2011, 09:54:33 PM
Thanks, we'll see if i get some more info or responses
Thanks,