[Win32utils-devel] win32-clipboard encoding issue

Heesob Park phasis at gmail.com
Sat Jan 11 04:04:41 UTC 2014


Hi,


2014/1/11 Daniel Berger <djberg96 at gmail.com>:
> Hi all,
>
> I've just about got win32-clipboard 0.6.0 done. There's one test failure
> (ffi branch), on some non-ascii text. I don't know if it's an encoding issue
> or just a bad test. I hate encoding issues. If someone else could take a
> look, that would be great.
>
I have two test failures with win32-clipboard 0.6.0.
=======================================================
Failure:
test: format_name returns expected value(TC_Win32_ClipBoard)
test_clipboard.rb:133:in `block in <class:TC_Win32_ClipBoard>'
     130:   end
     131:
     132:   test "format_name returns expected value" do
  => 133:     assert_equal("HTML Format", Clipboard.format_name(49422))
     134:     assert_nil(Clipboard.format_name(9999999))
     135:   end
     136:
<"HTML Format">(UTF-8) expected but was
<"XCPTimerClass">(ASCII-8BIT)

diff:
? H  TML Form at
? XCP ime   Cl ss

? Encoding: UTF  -8
?           ASCII  BIT
Failure:
test: set and get unicode data as expected(TC_Win32_ClipBoard)
test_clipboard.rb:64:in `block in <class:TC_Win32_ClipBoard>'
     61:     assert_nothing_raised{
     62:        Clipboard.set_data('�琯貫貫慣�', Clipboard::UNICODETEXT)
     63:     }
  => 64:     assert_equal('�琯貫貫慣�', Clipboard.data(Clipboard::UNICODETEXT))
     65:   end
     66:
     67:   test "empty method basic functionality" do
<"\u0397\u03B5\u03BB\u03BB\u03B1\u03C2">(UTF-8) expected but was
<"\xCE\x97\xCE\xB5\xCE\xBB\xCE">(ASCII-8BIT)

diff:
? Ηελλας
? �������

? Encoding: UTF  -8
?           ASCII  BIT
=======================================================
I think the first failure is due to the number 49422 is not a correct
value of HTML Format in my case.

I made a patch and pull request for the second failure.
https://github.com/djberg96/win32-clipboard/pull/3

Regards,
Park Heesob


More information about the win32utils-devel mailing list