Austin Ziegler wrote:
> Better, from my perspective:
> 
>  raise u"Not PNG." unless @top[0, 8] == "\x89PNG\x0d\x0a\x1a\x0a"

It would make more sense if it worked exactly like regexes:
   $KCODE = 'u'
   raise "Not PNG." unless @top[0, 8] == "\x89PNG\x0d\x0a\x1a\x0a"n
or
   $KCODE = 'n'
   raise "Not PNG."u unless @top[0, 8] == "\x89PNG\x0d\x0a\x1a\x0a"

Can I read the specs for ruby2 somewhere? It would be better than speculating 
about how the m17n strings might be implemented. I took a look at the 1.9 docs 
on ruby-doc.org but there is no 'encoding' accessor. It's all the same methods 
as the docs for ruby 1.8.4, although there are a bunch of methods which are 
*not* available in my install of 1.8.4: ["iseuc", "issjis", "isutf8", "kconv", 
"new", "scn", "toeuc", "tojis", "tosjis", "toutf16", "toutf8"]

Oh, here's another thought. How is *that* supposed to behave?
   str.encoding = :sjis
   str.split(//u)

Daniel