How to convert a ruby string into WChar string in ruby?

Hi,
I want to use the Win32API, however the API I use need the WChar string
as a
parameter.
So how can I convert a ruby string into WChar String?

Thanks very much.

Quoth Wu Nan:

Hi,
I want to use the Win32API, however the API I use need the WChar string as a
parameter.
So how can I convert a ruby string into WChar String?

Thanks very much.

There have been previous posts about this. If you search the archives
I’m sure
you’ll find it.

Hi,
Thank you for your hint, but I have searched it all around the world
with
Google and also searched the archives.
Maybe I used a wrong Key words, I found nothing I want.

Could you give me something more information?

Thanks very much.

Nan

2007/12/26, Konrad M. [email protected]:

Quoth Wu Nan:

Thanks very much.

There have been previous posts about this. If you search the archives I’m
sure
you’ll find it.


Konrad M. [email protected] http://konrad.sobertillnoon.com/

Maybe this will help you (maybe not):
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/195059

I’ve been googling for “site:blade.nagaokaut.ac.jp ruby-talk archives
windows
wide character”, you can try digging through that too.

Regards,

Thank you,
In fact I have found this post before.
It indicate the difference between Ruby string and UTF16 string.
I have tried to find a ruby way (Beatifully and simply), it seems I
should
do it manually now. :frowning:

Any way, thank you very much.

Nan

2007/12/26, Konrad M. [email protected]:

On Dec 25, 4:23 am, “Wu Nan” [email protected] wrote:

Hi,
I want to use the Win32API, however the API I use need the WChar string as a
parameter.
So how can I convert a ruby string into WChar String?

Thanks very much.

require ‘windows/unicode’
include Windows::Unicode

str = multi_to_wide(str)

Regards,

Dan