20/09/03 21:11:58.06 97aiR77+.net
>>451 Ruby
Fpath = 'test.bin'
File.open( Fpath, 'wb' ){|fh| fh.write "Hello word\n" }
Tbl10 = "\xC0\xCB".force_encoding(Encoding::BINARY)
tb = (0..255).to_a.map{|x| ('%08b' % x).tr( '10', Tbl10 ) }
buff = File.open( Fpath, 'rb' ).each_byte.map{|x| tb[x] }
puts buff.join().encode( Encoding::UTF_8, Encoding::CP932 )
print buff.map{|x| x.tr( Tbl10, '10' ).to_i(2).chr }.join
#=> ヒタヒヒタヒヒヒヒタタヒヒタヒタヒタタヒタタヒヒヒタタヒタタヒヒヒタタヒタタタタヒヒタヒヒヒヒヒヒタタタヒタタタヒタタヒタタタタヒタタタヒヒタヒヒタタヒヒタヒヒヒヒヒヒタヒタヒ
#=> Hello word