help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying and pasting Cyrillic text between Emacs and other apps


From: Jason Rumney
Subject: Re: Copying and pasting Cyrillic text between Emacs and other apps
Date: 28 Jan 2004 20:28:08 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Eli Zaretskii <eliz@gnu.org> writes:

> The MSDN docs says that the function IsClipboardFormatAvailable can be
> used to see if CF_UNICODETEXT is supported.  Can Emacs use that
> function?

That function will only tell you if the clipboard currently contains
Unicode text. To detect if CF_UNICODETEXT is supported, you'd have to
put some text onto the clipboard first, destroying whatever some
other app has put there. This might be OK if it was done the first
time Emacs put data onto the clipboard though.

> So Emacs could put a CF_UNICODETEXT object, then the CF_TEXT object
> into the clipboard, and the Windows apps will then use the Unicode
> encoding if they can, else the system page encoded text.

On versions of Windows that support Unicode, Windows automatically
provides CF_UNICODETEXT when CF_TEXT is placed on the clipboard and
vice versa. The problem with the question marks appears to be due to
a lossy conversion after an app puts data on in CF_UNICODETEXT. For
non-lossy behaviour, we are probably better setting CF_LOCALE and
putting the text on as CF_TEXT, but reading text from the clipboard as
CF_UNICODETEXT. This would allow Emacs to be used for the workaround
that was suggested earlier in this thread.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]