Subject:
[ruby-ffi] Re: Using Windows Unicode functions
From:
Quintus
Date:
1/19/10 11:41 AM
To:
ruby-ffi

I think you're refering to these lines?
-----------------------------------
buffer.force_encoding("UTF-16LE")
puts buffer.encode("ISO-8859-1").rstrip #Everything displayed correct
-----------------------------------
If I comment them out, that hasn't any effect. I still get the same
error.
If it had, I'd been wondering why, because they don't change the
"buffer"
object (besides the encoding tag, of course).

Marvin

On 19 Jan., 11:40, rogerdpack <rogerdp...@gmail.com> wrote:
> > t2.rb:32:in `message_box': string contains null byte (ArgumentError)
> >   from t2.rb:32:in `<main>'
> > -------------------------------------
> > An UTF-16LE encoded string *contains* NUL bytes, I know--but I want to
> > use Unicode functions, so: How to do that?
>
> Try taking out the test for null byte and see if it "passes like a
> champ"?
> -r