[Haskell-cafe] Re: Unicode workaround for getDirectoryContents under Windows?

Simon Marlow marlowsd at gmail.com
Thu Jun 18 05:22:30 EDT 2009


On 16/06/2009 21:19, Bulat Ziganshin wrote:
> Hello Simon,
>
> Tuesday, June 16, 2009, 5:02:43 PM, you wrote:
>
>> I don't know how getArgs fits in here - should we be decoding argv using
>> the ACP?
>
> myGetArgs = do
>     alloca $ \p_argc ->  do
>     p_argv_w<- commandLineToArgvW getCommandLineW p_argc
>     argc<- peek p_argc
>     argv_w<- peekArray (i argc) p_argv_w
>     mapM peekTString argv_w>>= return.tail
>
> foreign import stdcall unsafe "windows.h GetCommandLineW"
>    getCommandLineW :: LPTSTR
>
> foreign import stdcall unsafe "windows.h CommandLineToArgvW"
>    commandLineToArgvW :: LPCWSTR ->  Ptr CInt ->  IO (Ptr LPWSTR)

Presumably we'd also have to remove the +RTS ... -RTS in Haskell if we 
did this, correct?

Cheers,
	Simon



More information about the Haskell-Cafe mailing list