From: snacktime Date: 2006-08-13T14:21:49+09:00 Subject: Re: perl tr and ruby String#tr I figured out the problem. Ruby tr doesn't handle octal numbers like perl does. Not sure if it's just not implemented or maybe there is a correct way to do it I'm not sure of. In any case instead of trying to use tr to map the octal numbers I just made an array of decimal numbers for the even bit map and then made this function. Works fine. def setEvenParity(str) new = [] str.each_byte {|b| new << @even_parity[b]} new.pack("C*") end