I have a string that is one character long and can be any possible character value:
irb(main):001:0> \"\\x0\"
=> \"\\u0000\"
I though
I think the most elegant method (for alphanumeric chars) would be:
"a".tr('0-9a-z','1-9a-z0')
which would loop the a through to z and through the numbers and back to a.
I reread the question and see, that my answer has nothing to do with the question. I have no answer for manipulationg 8-bit values directly.