a side note on:
where you say:
Ruby being as powerful as it is simple to code in still isn't 100
percent perfect. One such requirement to make life easier would be a
method to convert a byte array into a string such as Java's String str
= new String(byte)
and then you go a long way to come up with:
string = ''
byte_array.each do |byte|
what is curious is that you are aware of #unpack. there is an opposite
method, #pack, which does exactly what you think is lacking (but is
"byte_array_to_string(input)" yields the same results as "input.pack('U*')"
now for some self advert: you could have found the information easily
in pleac, it's in this chapter:
btw, avoid "new String(byte)" in java, as it depends on platform's
default encoding. always use the two arguments form and tell java that
the byte array is UTF-8, ISO-8859-1, or whatever it's encoded in, it
will save you from being severely bitten someday you decide to install
your new server with other defaults.
Guillaume Cottenceau - http://zarb.org/~gc/