1 Nov 2005 05:33
: How does Windows pass non-ascii filename to executable?
Shaddy Baddah <Shaddy_Baddah <at> hotmail.com>
2005-11-01 04:33:32 GMT
2005-11-01 04:33:32 GMT
Hi, This question doesn't really describe a Cygwin topic (thus the use of cygwin-talk), but it's probably as relevant for Cygwin as for regular native Windows executables. Any assistance would be greatly appreciated. Ok, what I want to know is, how does Windows pass non-ascii filenames to executables? Here is the scenario. I have attached a quite simplistic C test application. I compile it under either MingW or Cygwin like so: gcc -o nonasciifilenameargs nonasciifilenameargs.c I then go to the Windows file explorer and drag a file with Traditional Chinese characters in it, onto nonasciifilenameargs.exe. I see this output: argc == 2 argv[0] == "d:\home\shaddy\throwaway scripts\nonasciifilenameargs.exe" strlen(argv[0]) == "57" argv[1] == "G:\?? - Susan?.mp3" strlen(argv[1]) == "18" This is not a mystery to me. I get it that the encoding conversion to the local codepage (which is latin1) drops question mark (?) characters that are outside the codepage/set. However, I can double click on the same file, and Winamp picks it up(Continue reading)
: How does Windows pass non-ascii filename to executable?
RSS Feed