Closed
Bug 408455
Opened 17 years ago
Closed 17 years ago
Unicode filenames passed via the command line get munged
Categories
(Toolkit Graveyard :: XULRunner, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 396052
People
(Reporter: cal, Unassigned)
Details
Attachments
(1 file, 4 obsolete files)
12.16 KB,
patch
|
benjamin
:
review-
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Build Identifier: CVS HEAD
because the argv/argc and nsiCommandLine stuff doesn't use the windows unicode versions, any unicode filenames passed via the command line aren't usable. the MOZ_REMOTE guts suffer from the same issue as they pass the non-unicode command line and working directory via an WM_COPYDAYA, losing unicode paths.
Reproducible: Always
Steps to Reproduce:
1. Create a file with non-latin characters in the name
2. Create a command line handling xpcom component (one that implements nsICommandLineHandler)
3. Drag the file onto the xulrunner stub
Actual Results:
The filename gets mangled into question marks
Expected Results:
The filename is preserved and can be used to access the file
a patch is attached. this is against CVS HEAD from a few days ago. the code is probably not 'correct', but it works. i need some pointers on how to do it 'right' :)
Reporter | ||
Comment 1•17 years ago
|
||
Attachment #293261 -
Flags: review+
Reporter | ||
Comment 2•17 years ago
|
||
Attachment #293262 -
Flags: review+
Reporter | ||
Comment 3•17 years ago
|
||
Attachment #293263 -
Flags: review+
Reporter | ||
Comment 4•17 years ago
|
||
Attachment #293264 -
Flags: review+
Comment 5•17 years ago
|
||
Can you make this into one patch against the trunk (HEAD)?
Updated•17 years ago
|
Attachment #293261 -
Flags: review+
Updated•17 years ago
|
Attachment #293262 -
Flags: review+
Updated•17 years ago
|
Attachment #293263 -
Flags: review+
Updated•17 years ago
|
Attachment #293264 -
Flags: review+
I believe that almost all of this work is already underway in bug 396052.
Reporter | ||
Comment 7•17 years ago
|
||
you're right - seems to be a lot of overlap with that bug. will try applying that patch tomorrow and see if it resolves all my issues.
Attachment #293261 -
Attachment is obsolete: true
Attachment #293262 -
Attachment is obsolete: true
Attachment #293263 -
Attachment is obsolete: true
Attachment #293264 -
Attachment is obsolete: true
Updated•17 years ago
|
Attachment #293267 -
Flags: review?(benjamin)
Comment 8•17 years ago
|
||
Comment on attachment 293267 [details] [diff] [review]
Single patch against HEAD
Yeah, I think my version is better, and as far as I can tell this only handles the remoting case (second launch), not the initial-launch case where arguments come in from main()
Attachment #293267 -
Flags: review?(benjamin) → review-
Reporter | ||
Comment 9•17 years ago
|
||
this handles the initial case too:
+#ifdef XP_WIN
+
+ PRUnichar **szArglist;
+ int nArgs;
+
+ szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
+
+ rv = cmdLine->InitW(nArgs, szArglist,
+ workingDir, nsICommandLine::STATE_INITIAL_LAUNCH);
+
+ LocalFree(szArglist);
+
+#else
rv = cmdLine->Init(gArgc, gArgv,
workingDir, nsICommandLine::STATE_INITIAL_LAUNCH);
+
+#endif
+
the main difference is that you pass around UTF8 while my patch passes around wide strings. means you don't need to add extra methods, but i avoided the manual parsing of the command line in the remoting handler by using CommandLineToArgvW(). your patch deals with the updater etc. though, so is almost certainly much better :)
Comment 10•17 years ago
|
||
Fixed by bug 396052 and some followups.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Updated•9 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•