Closed
Bug 194067
Opened 23 years ago
Closed 20 years ago
support unicode file name on drag and drop(D&D)
Categories
(Core :: Internationalization, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: kaleida, Assigned: emk)
References
Details
(Keywords: intl)
Attachments
(1 file, 2 obsolete files)
|
11.96 KB,
patch
|
emaijala+moz
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130
When you drag and drop onto Mozilla URLs/Internet Shortcuts (created using
Internet Explorer 6.0) that contain any foreign characters in the title, Mozilla
refuses to open them.
Reproducible: Always
Steps to Reproduce:
1. Open the following Web page:
http://www.linux.ru
using Internet Explorer 6.0 and add this Web page to Favorites.
2. Drag and drop this new Favorite/Internet Shortcut onto Mozilla 1.2.1
3. The following error message will be displayed:
“Alert
The file /C:/Documents and Settings/user/Favorites/Linux.?? ? ????????? ??
??????? - ?????? Linux.url cannot be found. Please check the location and try again.
OK”
Actual Results:
The following error message will be displayed:
“Alert
The file /C:/Documents and Settings/user/Favorites/Linux.?? ? ????????? ??
??????? - ?????? Linux.url cannot be found. Please check the location and try again.
OK”
Expected Results:
Mozilla should have opened the specified Web page, since the URL was valid. (It
does work in Internet Explorer 6.0).
ok, this happens in 2/10-08
I tested with にほん.url and בּת.url both fail.
Assignee: asa → neeti
Component: Browser-General → XPCOM
QA Contact: asa → scc
Comment 2•23 years ago
|
||
How is this different from bug 185818?
Updated•23 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 3•23 years ago
|
||
*** Bug 185818 has been marked as a duplicate of this bug. ***
changing component to Intl
Component: XPCOM → Internationalization
QA Contact: scc → ylong
Yuying, do you see this problem with the latest trunk builds? Thanks.
Comment 6•23 years ago
|
||
I saw this on 04-09 trunk build / WinXP-JA:
Some unicode characters titled pages (e.g. Chinese or Korean on Japanese system)
has this problem. But no problem with Japanese or French titled pages.
Comment 7•23 years ago
|
||
> Some unicode characters titled pages (e.g. Chinese or Korean on
> Japanese system) has this problem. But no problem with Japanese or
> French titled pages.
Correction: the problem happens on all non-native non-ascii charaters.
This bug still has not been fixed, even in Mozilla 1.4 for Windows.
I am using Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624
Comment 9•22 years ago
|
||
There's a fix for this(see bug 162361), but that has been put on hold because
we haven't yet decided what to do with NSPR file IO APIs (necessary to fix this)
| Reporter | ||
Comment 10•22 years ago
|
||
This bug is still present in Mozilla 1.5.
Comment 11•20 years ago
|
||
This should be fixed on the (firefox) trunk build thanks to my check-in of the patch for bug 162361. Anybody would be welcome to test it and verify it as fixed if it's indeed fixed.
| Assignee | ||
Comment 12•20 years ago
|
||
Unfortunately we can't still open dropped Internet Shortcuts with Unicode name after bug 162361 and bug 278161 are fixed.
We will have to handle CFSTR_SHELLIDLIST per masayuki.
Comment 13•20 years ago
|
||
(In reply to comment #12)
> Unfortunately we can't still open dropped Internet Shortcuts with Unicode name
> after bug 162361 and bug 278161 are fixed.
> We will have to handle CFSTR_SHELLIDLIST per masayuki.
You're right. I mixed up this issue with importing MS IE favorites.
Comment 14•20 years ago
|
||
Yeah, I have a patch for supporting the Unicode on D&D.
But the patch is not completed. I'll create the patch after return to Japan.
Assignee: neeti → masayuki
Summary: Mozilla cannot open Favorites containing foreign (Unicode) characters that were created Internet Explorer 6.0. → support unicode file name on drag and drop(D&D)
| Assignee | ||
Comment 15•20 years ago
|
||
I have a much simpler idea.
We can simply replace ::DragQueryFileA with ::DragQueryFileW because we dropped support for Win9x.
Comment 16•20 years ago
|
||
Comment on attachment 217662 [details] [diff] [review]
Patch rv 1.0
I'd like to use this chance to make the code more readable using some nice string stuff we have. I know there is old code like that, but could you use nsString and its friends (beginWriting, ToNewUnicode)?
+ PRUint32 len = nsCRT::strlen(inFileName);
+ if ( (len > 4) && nsCRT::IsAscii(&inFileName[len - 4])
+ && ((char)inFileName[len - 4] == '.')
+ && (nsCRT::ToLower((char)inFileName[len - 3]) == 'u')
+ && (nsCRT::ToLower((char)inFileName[len - 2]) == 'r')
+ && (nsCRT::ToLower((char)inFileName[len - 1]) == 'l') )
This would be much nicer with StringEndsWith using nsCaseInsensitiveStringComparator.
+ *aLen = fileNameLen * 2;
Use sizeof(PRUnichar) instead of 2. It's much more indicative on what the meaning is (and future proof).
- nsMemory::Free ( NS_REINTERPRET_CAST(char*, data) );
+ nsMemory::Free ( NS_REINTERPRET_CAST(char*, data) );
Data would be PRUnichar, no? But do you actually need the cast at all?
+ PRUnichar* dest = NS_REINTERPRET_CAST(PRUnichar*, pDropFile + 1);
|pDropFile + 1| should be |pDropFile + pDropFile->pFiles|.
+ const PRUnichar* source = pFileName;
+ memcpy(dest, source, (allocLen - 1) * 2); // copies the null character in pFileName as well
Variable "source" is unnecessary.
Attachment #217662 -
Flags: review?(emaijala) → review-
| Assignee | ||
Comment 17•20 years ago
|
||
Sorry, I tried to replace |PRUnichar*| with |nsString|, but I don't understand where to use beginWriting or ToNewUnicode.
> |pDropFile + 1| should be |pDropFile + pDropFile->pFiles|.
Due to magical C pointer arithematic, |pDropFile + 1| will add |sizeof(DROPFILES)| to the internal pointer value. And |pDropFile->pFiles| is always set to |sizeof(DROPFILES)|.
If it's preferable to type |pDropFile->pFiles| explicitly, it should be like:
PRUnichar* dest = NS_REINTERPRET_CAST(PRUnichar*, NS_REINTERPRET_CAST(char*, pDropFile) + pDropFile->pFiles);
I think it's too lengthy.
Other nits are resolved.
Attachment #217662 -
Attachment is obsolete: true
Attachment #217736 -
Flags: review?(emaijala)
Comment 18•20 years ago
|
||
(In reply to comment #17)
> Due to magical C pointer arithematic, |pDropFile + 1| will add
> |sizeof(DROPFILES)| to the internal pointer value. And |pDropFile->pFiles| is
> always set to |sizeof(DROPFILES)|.
> If it's preferable to type |pDropFile->pFiles| explicitly, it should be like:
> PRUnichar* dest = NS_REINTERPRET_CAST(PRUnichar*, NS_REINTERPRET_CAST(char*,
> pDropFile) + pDropFile->pFiles);
> I think it's too lengthy.
Right, but I prefer the lengthy way for readability and safety (what if somethign changes and pDropFiles isn't sizeof(DRPOFILES) anymore?).
| Assignee | ||
Comment 19•20 years ago
|
||
Attachment #217736 -
Attachment is obsolete: true
Attachment #218604 -
Flags: review?(emaijala)
Attachment #217736 -
Flags: review?(emaijala)
| Assignee | ||
Comment 20•20 years ago
|
||
Ere:
Could you review the patch? I changed your point in comment #18.
Do I need also using new string API? Honestly, I have no idea how to rewrite the code.
Comment 21•20 years ago
|
||
Comment on attachment 218604 [details] [diff] [review]
Patch rv 1.2
It's fine for me.
Attachment #218604 -
Flags: review?(emaijala) → review+
| Assignee | ||
Comment 22•20 years ago
|
||
Comment on attachment 218604 [details] [diff] [review]
Patch rv 1.2
Requesting sr.
Attachment #218604 -
Flags: superreview?(roc)
Comment on attachment 218604 [details] [diff] [review]
Patch rv 1.2
+ PRUnichar* dest = NS_REINTERPRET_CAST(PRUnichar*, NS_REINTERPRET_CAST(char*, pDropFile) + pDropFile->pFiles);
I agree with Masatoshi and would just go with pDropFile + 1, but this is OK.
Attachment #218604 -
Flags: superreview?(roc) → superreview+
Comment 24•20 years ago
|
||
checked-in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment 25•20 years ago
|
||
Masayuki, I think we still need a patch for the branch (that should work on Win9x/ME. Of course, on Win 9x/ME, non-system-codepage char. wouldn't be supported). Can you do that (perhaps in a separate bug filed specifically for 1.8 branch) as you indicated in comment #14?
Comment 26•20 years ago
|
||
(In reply to comment #25)
> Masayuki, I think we still need a patch for the branch (that should work on
> Win9x/ME. Of course, on Win 9x/ME, non-system-codepage char. wouldn't be
> supported). Can you do that (perhaps in a separate bug filed specifically for
> 1.8 branch) as you indicated in comment #14?
>
I file a new bug that is bug 336225. I'll work on that ASAP.
# Kimura-san:
# If you want to work on that, please take it :-)
| Assignee | ||
Comment 27•20 years ago
|
||
(In reply to comment #26)
> # Kimura-san:
> # If you want to work on that, please take it :-)
OK, I'll take it.
Comment 28•20 years ago
|
||
thanks.
You need to log in
before you can comment on or make changes to this bug.
Description
•