Displaying 1 result from an estimated 1 matches for "flipped_byt".
Did you mean:
flipped_bytes
2006 Feb 02
5
Fwd: win32-clipboard and Unicode zero bytes
...ut didn''t
have any luck.
Any ideas?
Thanks,
Dan
# test.rb
$:.unshift Dir.pwd
require ''clipboard''
def unicopy(hex_name_array)
Win32::Clipboard.set_data(win32unicode(hex_name_array),
Win32::Clipboard::UNICODETEXT)
true
end
def extract_flipped_bytes(unicode_char_string)
[unicode_char_string[2,2].to_i(16),
unicode_char_string[0,2].to_i(16)]
end
def win32unicode(unicode_char_strings)
flipped_bytes = unicode_char_strings.collect do |
str |
extract_flipped_bytes(str)
end
flipped_bytes.flatten.pack(''C*'')
end
p...