Closed Bug 288154 Opened 19 years ago Closed 19 years ago

If the path has 0x7c in its name, firefox cannot open the file (Should encode 0x7c to %7C)

Categories

(Core :: XPCOM, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8beta4

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

(Keywords: intl)

Attachments

(1 file, 2 obsolete files)

See this report with UTF-8.

If the path has 0x7c in its name(e.g., on Win-Ja, "c:\翻訳\test.html"),
firefox cannot open the file at launching from Explorer.
This is not reproduced on Suite.
And it is not reproduced by entering "http://翻訳.jp" from Run of Start Menu.

"翻訳" is 0x96 0x7C 0x96 0xF3 in Shift_JIS.
It is not reproduced when firefox already exists.
But excluding if "Open links from other applications in" is "New Window".
related to bug 221445 ? (0x7C = pipe)
This bug is caused by following code.

browser.js#1363, browser.js#1371, browser.js#1396
These lines use |aURIString.split("|");|
This should be processed in UTF16 or UTF8.
not a regression in Firefox, this has never worked, at least since 2002 sometime.

*** This bug has been marked as a duplicate of 221445 ***
Status: NEW → RESOLVED
Closed: 19 years ago
Keywords: regression
Resolution: --- → DUPLICATE
No, it is not the bug of "|".
This problem is the multi-byte charachter that has 0x7c.
not single charachter problem.

Jungshik:
Do you think it?
original reporter in Japanese bugzilla says not reproduced at Phoenix 0.1 �` 0.4
and reproduced after Phoenix 0.5.
the problem is in the same code, and rather than fixing the bad implementation,
we need to implement multiple homepages in a sane way.
Phoenix 0.5 shipped in December 2002, so that jibes with what I said.  Something
that worked over two years and a couple name changes in the past is a bit far
back for a regression.

This is a byproduct of that bug, and while we could just reopen and mark
depending, there isn't much point leaving two bugs to spam.
I'm reopening this bug.
This bug is not dup to bug 221445.
"0x96 0x7C 0x96 0xF3" is encoded to "%96|%96%F3" by Firefox.
It is a bug. It should be "%96%7C%96%F3".
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Assignee: bugs → masayuki
Status: REOPENED → NEW
Summary: If the path has 0x7c in its name, firefox cannot open the file → If the path has 0x7c in its name, firefox cannot open the file (Should encode 0x7c to %7C)
Status: NEW → ASSIGNED
OS: Windows 2000 → All
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → Firefox1.1
Component: OS Integration → XPCOM
Product: Firefox → Core
Target Milestone: Firefox1.1 → ---
Target Milestone: --- → mozilla1.8beta4
Does it work if you drag and drop a file to a running firefox? How about opening
via 'File | Open'? 

Does it make any difference whether firefox is running or not when you
double-click on a file in Windows Explorer? 

If answers to all my questions are yes (which I think is the case), this is
clearly a dupe of bug 278161

For now, I'm making this depend on bug 278161. If it's confirmed that my guess
is right, please, resolve it as a dupe of bug 278161
Depends on: 278161
If Bug 278161 is fixed, this bug is fixed too.
When do you fix bug 278161?
If you cannot fix before firefox 1.5 beta, I should fix this before 1.5 beta
release.
This bug is reproduced when it is booting only.
I.e., On Windows, an user boot firefox by the HTML file double click.
Attached patch Patch rv1.0 (obsolete) — Splinter Review
It fixes the problem. But it is ad hoc.

If '|' is after non-ASCII char, it may be a part of multi byte char. Becuase
'|' is not valid character for path and file name of URI. But it was used for
drive delimiter. If we escape '|' always, it makes another problem.(we cannot
open "file:///C|/foo/bar.txt".) But this patch doesn't make this problem.

However, if bug 278161 is fixed by jshin, this patch is not needed.
Attachment #190168 - Flags: superreview?(darin)
Attachment #190168 - Flags: review?(darin)
Flags: blocking1.8b4?
Comment on attachment 190168 [details] [diff] [review]
Patch rv1.0

>Index: xpcom/io/nsEscape.cpp

>+      // And, we should escape the pipe character after non-ascii character.
>+      // The pipe character is not valid character for path and file name.
>+      // But it's used for dive delimiter instead of colon (C|/foo/bar.txt).
>+      // However, the pipe character after non-ascii may be a part of multi
>+      // byte character.

I would change this text to something simpler like this:

	// And, we should escape the '|' character when it occurs after any
	// non-ASCII character as it may be part of a multi-byte character.

I don't think there's any need to mention drive delimiters here.


r+sr=darin
Attachment #190168 - Flags: superreview?(darin)
Attachment #190168 - Flags: superreview+
Attachment #190168 - Flags: review?(darin)
Attachment #190168 - Flags: review+
Attached patch Patch rv1.1Splinter Review
The risk is low. This is very important intl bug.
Attachment #190168 - Attachment is obsolete: true
Attachment #190805 - Flags: superreview+
Attachment #190805 - Flags: review+
Attachment #190805 - Flags: approval1.8b4?
Attachment #190805 - Flags: approval1.8b4? → approval1.8b4+
checked-in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago19 years ago
Resolution: --- → FIXED
Flags: blocking1.8b4?
Attachment #9341048 - Attachment description: WIP: Backed out changeset (Bug 288154) for encoding pipe character in URL query parser → Backed out changeset (Bug 288154) for encoding pipe character in URL query parser
Attachment #9341048 - Attachment description: Backed out changeset (Bug 288154) for encoding pipe character in URL query parser → Bug 1674369 - Backed out changeset (Bug 288154) for encoding pipe character in URL query parser

Comment on attachment 9341048 [details]
WIP: Backed out changeset (Bug 288154) for encoding pipe character in URL query parser

Revision D182064 was moved to bug 1674369. Setting attachment 9341048 [details] to obsolete.

Attachment #9341048 - Attachment is obsolete: true
Attachment #9341048 - Attachment description: Bug 1674369 - Backed out changeset (Bug 288154) for encoding pipe character in URL query parser → WIP: Backed out changeset (Bug 288154) for encoding pipe character in URL query parser
Attachment #9341048 - Attachment is obsolete: false

Comment on attachment 9341048 [details]
WIP: Backed out changeset (Bug 288154) for encoding pipe character in URL query parser

Revision D182064 was moved to bug 1674369. Setting attachment 9341048 [details] to obsolete.

Attachment #9341048 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: