[Win32utils-devel] [ win32utils-Bugs-20722 ] Windows::Error.get_last_error only returns the first character (PATCH)

Daniel Berger djberg96 at gmail.com
Thu Jun 19 01:11:11 EDT 2008

On Wed, Jun 18, 2008 at 5:22 PM,  <noreply at rubyforge.org> wrote:


>>Comment By: John Whitley (whitley)
> Date: 2008-06-18 16:22
> Message:
> Actually, I rescind my patch above.  The deeper problem
> seems to lie in win32-api, api.c, this code:
>   // The order of 'A' and 'W' is reversed if $KCODE is set
> to 'UTF8'.
>   if(!strcmp(rb_get_kcode(), "UTF8")){
>      first  = "W";
>      second = "A";
>   }
> W functions accept/return UTF16 not UTF8, which breaks the
> rest of the win32-* modules hard, as the bug above exhibits.
>  For example, Win32::Events are now created by passing UTF8
> Ruby string data to an interface expecting UTF16 (see the
> name parameter).
> Setting $KCODE to UTF8 should not change the interface of
> these functions, as it breaks unrelated client code.  As it
> stands 'W' functions always require special conversion
> handling, and should be non-default.


Well, I _did_ ask about this when I first implemented it. I guess it
wasn't such a good idea after all.

Suggestions? Fixable? Or remove it completely?


More information about the win32utils-devel mailing list