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

W

Wu Nan

[Note: parts of this message were removed to make it a legal post.]

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.
 
W

Wu Nan

[Note: parts of this message were removed to make it a legal post.]

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
 
W

Wu Nan

[Note: parts of this message were removed to make it a legal post.]

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. :(

Any way, thank you very much.

Nan
 
D

Daniel Berger

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 =3D multi_to_wide(str)

Regards,

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top