On 10/09/08 01:45, Vadim Zeitlin wrote: > Hello, > > Sorry in advance if I'm simply missing something but it looks like Vim > can't open files with Unicode file names which are not convertible to the > current locale. I'm still using 7.0 (standard Win32 version) but looking at > http://vim.svn.sourceforge.net/viewvc/vim/vim7/src/os_win32.c?view=markup > it seems to be still the same in the latest code as get_cmd_argsW() > function calls WideCharToMultiByte(GetACP()) and this fails (returns a > string full of question marks) if the string can't be represented in the > current user encoding. So, for example, opening a file "Аня.vcf" opens the > file "???.vcf" on my English Windows system. The annoying thing is not only > Vim fails to open it but that notepad (sic) opens it just fine so this > looks like the first example of something notepad does better than Vim I > found since a dozen years of using Vim ;-) > > Assuming I am not missing some trivial option/workaround which would allow > to open these files in Vim and also that nobody is already working on > fixing this, is it realistic to someone reasonably competent with Win32 but > not familiar with Vim code base to fix this? Looking at the code it seems > to be rather difficult to replace the narrow strings representing the file > names with the wide character ones so I thought about "simply" replacing > CP_ACP in os_win32.c with CP_UTF8 and then converting this UTF-8 string to > wchar_t before passing it to any Windows functions. Does this look like a > reasonable approach? > > Thanks in advance for any help! > VZ
1. Which version of Windows are you using? Which compiler was used to compile your version of Vim (as seen at the bottom of the output of ":version")? (Steve Hall uses Cygwin gcc and Bram uses MS Visual C, I think boith are OK, as is the MinGW version of gcc; but I had problems with Unicode in general when I was on W98 with the Borland C compiler) Steve's builds are at https://sourceforge.net/project/showfiles.php?group_id=43866&package_id=39721 ; if you want to compile Vim yourself, I recommend the procedure based on Cygwin gcc, described at http://users.skynet.be/antoine.mechelynck/vim/compile.htm 2. What is your 'encoding' option set to? Vim cannot, for any purpose, use any character which has no representation in your current 'encoding'. I'm going to bed now, but in the meantime you can check http://vim.wikia.com/wiki/Working_with_Unicode and/or http://vim.sourceforge.net/scripts/script.php?script_id=789 ("Switching to Unicode in an orderly manner"). If it doesn't work for you, give specifics, and if no one answers while I sleep, I will after I wake up. Best regards, Tony. -- "I don't believe in astrology. But then I'm an Aquarius, and Aquarians don't believe in astrology." -- James R. F. Quirk --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
