[ANNOUNCEMENT] Updated: cygutils 1.4.16-7

Takashi Yano takashi.yano@nifty.ne.jp
Sat Sep 25 07:23:54 GMT 2021

On Sat, 25 Sep 2021 13:31:25 +0900
Takashi Yano wrote:
> Hi Mark,
> Sometimes, putclip shows error
> "Unable to open the clipboard"
> when I run 'echo A | putclip'.
> I digged into this problem, and found OpenClipboard() sometimes
> fails with error ERROR_ACCESS_DENIED if it is called just after
> SetClipboardData() and CloseClipboard().
> Currently, putclip calls OpenClipboard()/CloseClipboard() four
> times. Is there any reason why closing and reopening clipboard
> several times?
> Is there any problem if you open clipboard once and close it at
> the end of function int putclip() just like the patch attached?
> The problem above disappears if the patch is applied.

I noticed that putclip/getclip have another problem.

These utils assume the charset is always UTF-8, however, cygwin
supports locales which charset is not UTF-8 (such as CP932, EUC-JP,
CP850, CP1251, etc.).

Therefore, what abount using mbstowcs/wcstombs rather than
MultiByteToWideChar/WideCharToMultiByte like the patch attached?

Takashi Yano <takashi.yano@nifty.ne.jp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clip-charset.patch
Type: application/octet-stream
Size: 3207 bytes
Desc: not available
URL: <https://cygwin.com/pipermail/cygwin/attachments/20210925/344cb45d/attachment.obj>

More information about the Cygwin mailing list