--nextPart1451952.0oQjK8udyI
Content-Type: text/plain;
charset s-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hello all.
I am unpacking some unicode strings from a binary file. I have a string like:
"W\000M\000/\000T\000r\000a\000c\000k\000N\000u\000m\000b\000e\000r\000\000\000\003"
and I need to turn it into:
"WM/TrackNumber"
When I 'puts' the string it prints fine but I need to assign it to a variable,
and when I try something like:
require 'jcode'
$KCODE = 'UTF8'
s.each_char { |ch| print ch }
it will print each char but return the original unicode string. And when I
try:
n = ""
s.each_char { |ch| n += ch }
The entire unicode char is being added to n.
So can I extract an ascii representation of this string? I will admit I don't
know the first thing about unicode and I may be totally lost here...
Thanks for consideration.
-d
--
darren kirby :: Part of the problem since 1976 :: http://badcomputer.org
"...the number of UNIX installations has grown to 10, with more expected..."
- Dennis Ritchie and Ken Thompson, June 1972
--nextPart1451952.0oQjK8udyI
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
iD8DBQBEmv5hwPD5Cr/3CJgRAqLeAKCx6Txyvo4sn0Xu+b//cd7ceBuIRQCeJ4Ju
2qU6s45lgc4mVHNyhmgHBdsy
-----END PGP SIGNATURE-----
--nextPart1451952.0oQjK8udyI--