I know that my answer is too simple but I am just saying it.
Why don't you create your won procedure to convert using arrays, getting every single character from string and putting into array (where the size of array will be variable which you get from the system, like size of wchar,..., max length, and so on).
Once I did so and it works (at least in different windows platforms, I didn't use solaris till now).
Have fun!