emacs-devel
[Top][All Lists]
Advanced

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

Re: Unicode support for the MS Windows clipboard


From: Jason Rumney
Subject: Re: Unicode support for the MS Windows clipboard
Date: Wed, 28 Jul 2004 14:03:34 +0100
User-agent: Mozilla Thunderbird 0.7.1 (Windows/20040626)

Benjamin Riefenstahl wrote:
Benjamin Riefenstahl <address@hidden> writes:
  
We could decide not to use selection-coding-system at all.  In that
case we probably don't need any variable at all, just trusting the
system to give us the right information.
    

On second thought, that would also loose the ability to specify a
non-default encoding for 8-bit text.  Although I doubt that many
receiving applications use that correctly :-(.  And those that could
use it will probably all prefer a Unicode version when we offer that
in addition.
  
Here are my suggestions, which should make things work the same way as all other Windows apps by default, and any changes to selection-coding-system would be for specialised uses (ie, for use with other software that does something unusual) so it would not be unreasonable to expect users to either know what they are doing or have a precise recipe to follow.


Default selection-coding-system to utf-16-le (or utf-16le, whichever is appropriate).

When selection-coding-system is utf-16-le, use CF_UNICODETEXT, and put a copy on CF_TEXT in the system's default encoding for Windows 9x apps that do not understand Unicode.

If the user changes selection-coding-system, use only CF_TEXT or CF_OEMTEXT, depending on the coding-system specified (codepage < 900 should be a good enough test I think, but double check there are not exceptions).  When putting data on the clipboard as CF_TEXT, we should try to set an appropriate CF_LOCALE if we can determine it, so that automatic conversion to CF_UNICODETEXT works correctly.


reply via email to

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