getclip and putclip garble unicode characters

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Fri Jun 25 18:54:32 GMT 2021


On 2021-06-25 12:01, Thomas Wolff wrote:
> Am 24.06.2021 um 08:35 schrieb Andrey Repin via Cygwin:
>> Greetings, Миронов Леонид Владимирович!
>>> getclip and putclip from cygutils-extra garble unicode characters:
>>> non-latin characters copied to clipboard in windows are replaced with
>>> question marks when retrieved with getclip in cygwin, and non-latin
>>> characters copied to clipboard using putclip are pasted it in windows
>>> looking like utf-8 displayed in cp1252 but can be retrieved with getclip
>>> exactly as pasted, so it looks like the problem is not in the way the 
>>> data
>>> is copied but in the way cygwin and windows communicate text encoding to
>>> each other. LC_CTYPE=en_US.UTF-8, windows ANSI codepage is set to 
>>> cp1251 - 1251, not 1252.
>> This looks like you are using a program incapable of dealing with unicode
>> clipboard. To achieve better results, switch your input 
>> language/keyboard to
>> matching language before copying text from application. I.e. switch to
>> Russian then copy text, then check what is returned by getclip.
>> But then, why LC_CTYPE is en_US?
> getclip and putclip are just broken, they don't even work in a pure 
> UTF-8 environment.
> Already noticed 9 years ago... 
> https://sourceware.org/legacy-ml/cygwin/2012-03/msg00648.html
> including a script-based replacement.

Just cat [<>] /dev/clipboard: recent Windows changes may have affected 
Windows<->X copy and paste transparency.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]


More information about the Cygwin mailing list