Ken Takata wrote: > A wrong file may be opened when enc=utf-8 on Windows. > > E.g. (on Japanese Windows, the code page is cp932): > > echo foo>テ、.txt " Create a file. The filename is '<C3><A4>.txt' in cp932. > gvim --cmd "set enc=utf-8" ä.txt " 'ä.txt' is '<C3><A4>.txt' in utf-8. > > Opening a new empty file is expected, but the buffer contains "foo" which > means that "テ、.txt" is opened. > Currently, Vim uses a Wide function first, and if it fails, Vim may fallback > to an ANSI function. Actually it is needed only on Win9x. > If a Wide Win32 API fails, we should check the result of GetLastError() to > judge whether we should use an ANSI API. However, if a Wide C runtime function > fails, we should check g_PlatformId instead of GetLastError(). > > Attached fix-utf8-wrong-fallback.patch fixes this issue. > I also find the similar parts which should be fixed. > See fix-utf8-wrong-fallback-addition.patch.
Thanks. We should probably check error codes in more places. -- If Microsoft would build a car... ... the oil, water temperature, and alternator warning lights would all be replaced by a single "General Protection Fault" warning light. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
