Subject: Windows 95 clipboard & Unicode

From: Wenlin Institute (wenlin@wenlin.com)
Date: Wed Feb 11 1998 - 21:11:37 EST


Dear fellow Unicode programmers,

The book "Developing International Software" by Nadine Kano,
published by Microsoft Press, says:

   "Windows 95 supports the same clipboard formats as
   Windows NT: CF_UNICODETEXT, CF_OEMTEXT, and CF_TEXT
   (which really should be called CF_ANSITEXT). Any text
   copied to the clipboard is enumerated in all three
   formats, so it's possible to cut and paste across
   applications supporting different character sets. For
   example, a simple piece of text can be copied from one
   application in ANSI format and pasted to another in
   Unicode format or vice versa." (page 87)

However, IsClipboardFormatAvailable(CF_UNICODETEXT) returns
false when IsClipboardFormatAvailable(CF_TEXT) returns true,
and GetClipboardData(CF_UNICODETEXT) returns NULL when
GetClipboardData(CF_TEXT) returns a non-NULL value.

It also appears that data copied to the clipboard with
SetClipboardData(CF_UNICODETEXT, ...) can't be pasted into
non-Unicode applications (even when the data is all in the
ASCII range).

Does Microsoft's claim have any basis in reality?

Documentation supplied with the Borland C compiler says:

   "The system implicitly converts data between certain
   clipboard formats: if a window requests data in a format
   that is not on the clipboard, the system converts an
   available format to the requested format. The system can
   convert data between the text formats CF_UNICODETEXT,
   CF_TEXT, and CF_OEMTEXT; ...If the system provides a
   conversion between multiple formats, there is no
   advantage to placing multiple formats on the clipboard."

It would be convenient to use CF_UNICODETEXT exclusively
and not bother with CF_TEXT, and it would seem
straightforward for the operating system to perform the
conversion "implicitly". Unfortunately it doesn't seem to
work.

Thank you all for your consideration of this question
and for any information you can share.

Tom Bishop

Wenlin Institute, Inc. Software for Learning Chinese
4405 Walnut St. Oakland, CA 94619 Phone: (510) 534-1675
E-mail: wenlin@wenlin.com Web: http://www.wenlin.com



This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:20:39 EDT