itakingiteasy
2011-May-19 19:37 UTC
[Wine] No newline in wine printf with multibyte string
Hello. This code: http://paste.pocoo.org/show/391911/ seems to work incorrectly with wine (at least with my 1.3.20-ubuntu6 version), while working well with native linux and native windows. When mingw32-compiled binary is executed under wine it just does not print newline character properly in the end of code, at printf on line #37; if non-ascii characters in printing string are present. This causing printed line to be shared with next PS1 prompt, when executed in wine directly. Here is image illustrating that effect: [Image: ftp://neverb.net/images/special/screenshot/wine_issue/linux_wine_cmd_exe.png ] Note also missing extra newline in wine cmd.exe prompt. It should be there as it is in native windows cmd.exe: [Image: ftp://neverb.net/images/special/screenshot/wine_issue/native_windows.png ] Possible workarounds: add '\r' before '\n' weed out non-ascii character from printing string use WCHAR instead of wchar_t use wprintf(L"%ls\n"~ But all this workarounds are just sideways, i hope that there is some real solution. Also, guys from #winehackers noticed that it may be not wine, but compiler or system failure. They suggested to use -fshort-wchar mingw flag, but it changed nothing. Also, workaround using WCHAR also belongs to them. I would be glad if someone make it clear, why this happens and how to fix it without adding another layer of compatability to the code. Thanks.
Apparently Analagous Threads
- Winetricks gfw under root vs under user
- [Authlogic]
- [Rspec] Using Mocha results in uninitialized constant, using a 'fix' breaks RSpec output
- [Bug 57660] New: nv?? show error nv??_screen_get_param:??? - unknown PIPE_CAP 76
- icecast2 sends metadata to clients but not actual stream