[Win32utils-devel] Fwd: [win32-clipboard] ArgumentError: invalid byte sequence in US-ASCII when copying from clipboard (#1)

Daniel Berger djberg96 at gmail.com
Thu Jul 14 11:13:23 EDT 2011

Bug posted by Max Mitchell on github for win32-clipboard. Suggestions?

If I have the following copied into my Windows clipboard: `Hello world, 
£12 is the cost` and I try to access the clipboard:

require 'rubygems'
require 'win32/clipboard'
include Win32

c = Clipboard.data
... I get an `ArgumentError: invalid byte sequence in US-ASCII` from 
line 123 in `clipboard.rb` caused by using the pound symbol. If I try 
force the clipboard to read as Unicode it gives the same error. Is there 
a way to read in these characters/the full clipboard?

I'm using the following:

* Windows XP
* Ruby 1.9.2p180 (2011-02-18)
* win32/clipboard 0.5.2

More information about the win32utils-devel mailing list