janlelis/clipboard

doesn't work well on unicode

Opened this issue · 3 comments

E:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/clipboard-1.0.6/lib/clipboard/windows.rb:54:in encode': U+FF11 to IBM437 in conversion from UTF-16LE to UTF-8 to IBM437 (Encoding::UndefinedConversionError) from E:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/clipboard-1.0.6/lib/clipboard/windows.rb:54:inpaste'
from E:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/clipboard-1.0.6/lib/clipboard/windows.rb:91:in copy' from E:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/clipboard-1.0.6/lib/clipboard.rb:49:incopy'
from E:/Programs/spacify.rb:14:in `

'

really stupid fix is at line 54 in windows.rb remove .encode(Encoding.default_external)

if you're curious i tried to put this on my clipboard: 1234

If someone needs a quick fix, just do Encoding.default_external = 'utf-8'.

Starting with version 1.1.0, encoding handling is left to the user. Closing this, but feel free to open a new issue if you run into problems with the new approach!