Subject: Re: Cut and paste Unicode plain text
From: Andrew Dunbar (hippietrail@yahoo.com)
Date: Tue Jun 05 2001 - 08:15:19 CDT
Mike Nordell wrote:
>
> Andrew Dunbar wrote:
> > Mike Nordell wrote:
> > >
> > > Should we possibly also add a CF_LOCALE object to the clipboard?
> >
> > CF_RTF will work for 8 bit, multibyte, and unicode RTF.
> > On NT the OS adds the CF_LOCALE of the current input locale which
> > is OK for now.
>
> Oh, I didn't know that. Does it add a CF_LOCALE for every SetClipboardData?
> (a plain URL will do)
I thought CF_LOCALE was just for plain text but RTF and HTML also
could behave a bit differently depending on locale. RTF should
always put its codepage in its formatting anyway. We don't support
HTML clipboard data. But it's definitely a good thing for text
and it won't hurt to always set CF_LOCALE.
Sorry I don't have a URL. I found it on my local MSDN which I can't
access now from 98 ):
> > But since the user can change the input locale at
> > any time we may be able to improve it.
>
> Hence my question about adding CF_LOCALE to our "clips". Imagine copying
> (8-bit) text using one locale, changing locale and the pasting. We'd still
> assume the original chars to be pasted I think.
Well we just treat the clipboard as raw bytes now so we will
interpret anything outside ASCII wrongly if we paste under a different
locale.
> Thinking a bit more I believe we indeed need a new function to add Unicode
> text to the clipboard; we don't want to add CF_UNICODETEXT for simple
> 8859-1, do we?
I haven't explored all cases but Windows does do automatic conversions
when possible. There's at least some bonuses to always putting
CF_UNICODE on the clipboard. One is that it means we always take
control, another I can think of is that our smart quotes will be
preserved, so will anything the user got from the "insert symbol"
dialog.
Andrew.
-- http://linguaphile.sourceforge.net _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
This archive was generated by hypermail 2b25 : Tue Jun 05 2001 - 08:13:41 CDT