In getHandleOnFile legacy encoding is used for error message and Qt fails to understand it, as a result localized error message is unreadable. Apparently Qt assumes 1252, while actual ANSI encoding is system-defined and can be changed in system settings. The system itself doesn't depend on the setting as it natively works in unicode and ANSI api is supported for backward compatibility with software written for win9x. Use unicode strings and unicode winapi instead - FormatMessageW instead of FormatMessageA.
Read about unicode in windows: http://msdn.microsoft.com/en-us/library/windows/desktop/dd374081.aspx