Description
According to the MSDN documentation, certain encodings limit some of the flags and parameters value that can be passed to these routines:
http://msdn.microsoft.com/en-us/library/ms776420.aspx
http://msdn.microsoft.com/en-us/library/ms776413(VS.85).aspx
If these flags and/or parameters are invalid, the calls fail. I have a patch for this problem.