[Win32utils-devel] Fwd: FFI::MemoryPointer.read_wide_string?
djberg96 at gmail.com
Mon Nov 11 15:46:41 UTC 2013
I take it that method does not currently exist (I didn't see it in the
What about modifying the existing Pointer#read_string method so that it
accepts an encoding as an optional second argument?
I'm not sure how to implement that, though. It appears that
Pointer#read_string is calling get_string, which is defined in
AbstractMemory.c (in the FFI source). Is it a simple matter of using
wmemchr instead of memchr? Or is it more complex than that?
Or maybe this is better implemented as its own method. I defer to you. :)
On Mon, Nov 11, 2013 at 8:14 AM, Heesob Park <phasis at gmail.com> wrote:
> 2013/11/12 Daniel Berger <djberg96 at gmail.com>:
> > Resend due to mailing list issue.
> > ---------- Forwarded message ----------
> > From: Daniel Berger <djberg96 at gmail.com>
> > Date: Thu, Nov 7, 2013 at 12:44 AM
> > Subject: FFI::MemoryPointer.read_wide_string?
> > To: Development and ideas for win32utils projects
> > <win32utils-devel at rubyforge.org>
> > Hi all,
> > Currently the FFI::MemoryPointer#read_string reads up until the first
> > byte. But with wide strings I need to read up until the first two
> > consecutive null bytes.
> > Would it make sense and be useful to add a read_wide_string method that
> > that?
> I think read_string_with_enc(string,encoding) is more useful.
> Park Heesob
> win32utils-devel mailing list
> win32utils-devel at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the win32utils-devel