From: Todd Benson Date: 2008-02-07T09:54:29+09:00 Subject: Re: Strange characters... how are they created? On Feb 6, 2008 6:22 PM, Daniel Waite wrote: > Todd Benson wrote: > > I don't know anything about bittorrent, but > > > > s = '20:Ÿø\îµÊ^Ω¬ ‡m$æÉ* ú0*' > > puts s.unpack('h*') > > > > might point you in the right direction. > > That's an interesting operation, but nay, no directional change. (Also, > pasting it into IRB causes my machine to beep and pause. Dunno why > though. Perhaps the characters being pasted mean something special to > Ruby?) > > I asked a friend of mine and he said that if you dump the output of the > digest method directly to a file, you'll get the funky output. > > My guess is console does some kind of conversion -- possibly with > character encoding? > > Anywho, the following... > > require 'digest/sha1' > > output = File.open('output', 'w+') > source = IO.read('./README_FOR_APP', 512) > output << Digest::SHA1.digest(source) > output.close > > Yields the same "style" output that Transmission generates. Oh, I see, you want to _create_ a digest. I misunderstood you. Todd