Closed
Bug 314231
Opened 20 years ago
Closed 20 years ago
If link target URL has non-ASCII char that is not encoded by UTF-8, the default file name is always escaped at "Save Link Target As..."
Categories
(SeaMonkey :: UI Design, defect, P1)
SeaMonkey
UI Design
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: masayuki, Assigned: masayuki)
References
()
Details
(4 keywords)
Attachments
(1 file, 2 obsolete files)
|
3.74 KB,
patch
|
masayuki
:
review+
masayuki
:
superreview+
dveditz
:
approval1.8.0.1+
dveditz
:
approval1.8.1+
|
Details | Diff | Splinter Review |
If link target URL has non-ASCII char that is not encoded by UTF-8, the default
file name is always escaped at "Save Link Target As..."
The test case is here.
http://bugzilla.mozilla.gr.jp/attachment.cgi?id=2931&action=view
You may look Japanese default file name only on the "href has encoded by
UTF-8".
On other links, you can look the escaped default file name.
# This is SeaMonkey version of bug 314222
| Assignee | ||
Comment 1•20 years ago
|
||
This fix this bug.
aDocument is always null in initFileInfo if it's called by "Save Link Target As...".
We should use current document charset instead of aDocument's charset if
aDocument is null.
Attachment #201159 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #201159 -
Flags: review?(neil.parkwaycc.co.uk)
Updated•20 years ago
|
Attachment #201159 -
Flags: review?(neil.parkwaycc.co.uk) → review?(cbiesinger)
Comment 2•20 years ago
|
||
Comment on attachment 201159 [details] [diff] [review]
Patch rv1.0
hm... would it be possible to instead pass an nsIURI to initFileInfo and have the caller take care of the charset?
Comment 3•20 years ago
|
||
Comment on attachment 201159 [details] [diff] [review]
Patch rv1.0
r- until I get a reply to comment 2
Attachment #201159 -
Flags: review?(cbiesinger) → review-
| Assignee | ||
Comment 4•20 years ago
|
||
Comment on attachment 201159 [details] [diff] [review]
Patch rv1.0
Oops. Sorry for the delay.
> would it be possible to instead pass an nsIURI to initFileInfo and have
> the caller take care of the charset?
I cannot understand well.
The caller(internalSave) does not have document. Because when "Save Link Target As...", the document is not loaded because the user doesn't move to linked target. Therefore, we need current document charset by referrer.
Attachment #201159 -
Flags: review- → review?(cbiesinger)
| Assignee | ||
Comment 5•20 years ago
|
||
Ah, I understan what you said.
Of course, it's possible. But current code make nsIURI in the initFileInfo.
I obeied current code.
Comment 6•20 years ago
|
||
Comment on attachment 201159 [details] [diff] [review]
Patch rv1.0
hrm, ok, but then why not just pass the charset to this function, instead of the entire referrer?
| Assignee | ||
Comment 7•20 years ago
|
||
Isn't my patch more readable than sending charset directly?
My params means,
if document is not null(so, the URI is loaded), we should use the doc charset.
otherwise(so, the URI is not loaded), if referrer is not null(so, it means previous document charset), we should use the charset.
otherwise, we assume that the charset is UTF-8 from general rule.
Status: NEW → ASSIGNED
| Assignee | ||
Comment 8•20 years ago
|
||
biesi:
Please continue to review.
| Assignee | ||
Comment 9•20 years ago
|
||
This bug is reproduced on Web Mail Service.
This is serious i18n bug. Please hurry up to review.
Severity: minor → major
Priority: -- → P1
| Assignee | ||
Comment 10•20 years ago
|
||
from mconnor,
> ------- Comment #5 From Mike Connor 2005-12-16 11:35 PST [reply] -------
>
> (From update of attachment 201154 [details] [diff] [review] [edit])
>>+ * @param aReferrer the referrer URI object (not URL string) to use, or null
>>+ * if no referrer should be sent.
>
> this comment is bogus, since we're simply passing the referrer to extract the
> charset, just use something like this:
>
> * @param aReferrer An nsIURI object for the referrer document, null if there is
> no referrer
I'll change this comment also in XPFE's patch.
Comment 11•20 years ago
|
||
as this function does not use the referrer, it would imo be better to always pass a charset to it and use that. the caller can decide whether to pass the referrer's origin charset or the document's charset. that way, the caller need not make up a referrer in case it doesn't have one.
Comment 12•20 years ago
|
||
Comment on attachment 201159 [details] [diff] [review]
Patch rv1.0
so I'll mark this review-.
Attachment #201159 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #201159 -
Flags: review?(cbiesinger)
Attachment #201159 -
Flags: review-
| Assignee | ||
Comment 13•20 years ago
|
||
Attachment #201159 -
Attachment is obsolete: true
Attachment #206229 -
Flags: superreview?
Attachment #206229 -
Flags: review?(cbiesinger)
| Assignee | ||
Updated•20 years ago
|
Attachment #206229 -
Flags: superreview? → superreview?(neil.parkwaycc.co.uk)
Comment 14•20 years ago
|
||
Comment on attachment 206229 [details] [diff] [review]
Patch rv2.0
thanks, and sorry again about the delay
Attachment #206229 -
Flags: review?(cbiesinger) → review+
| Assignee | ||
Updated•20 years ago
|
Keywords: regression
Comment 15•20 years ago
|
||
Comment on attachment 206229 [details] [diff] [review]
Patch rv2.0
> var sourceURL = getContentFrameURI(focusedWindow);
>+ var sourceDocument = getContentFrameDocument(focusedWindow);
>
> try {
>- return makeURI(sourceURL);
>+ return makeURI(sourceURL, sourceDocument.characterSet);
Nit: you could replace sourceURL with sourceDocument.location.href thus saving you the call to getContentFrameURI
>+ var charset = aDocument ? aDocument.characterSet : null;
>+ if (!aDocument && aReferrer)
>+ charset = aReferrer.originCharset;
This is clumsy... I'd use a double ?: or an if/else if/else to select between aDocument.characterSet and aReferrer.originCharset (or if you're feeling really leet, aDocument && aDocument.characterSet || aReferrer && aReferrer.originCharset).
Attachment #206229 -
Flags: superreview?(neil.parkwaycc.co.uk) → superreview+
| Assignee | ||
Comment 16•20 years ago
|
||
>>+ var charset = aDocument ? aDocument.characterSet : null;
>>+ if (!aDocument && aReferrer)
>>+ charset = aReferrer.originCharset;
> This is clumsy... I'd use a double ?: or an if/else if/else to select between
> aDocument.characterSet and aReferrer.originCharset (or if you're feeling really
> leet, aDocument && aDocument.characterSet || aReferrer &&
> aReferrer.originCharset).
Thanks,
My current patch is correctly. We should use aReferrer only if aDocument is null.
# Therefore, my first patch was wrong.
| Assignee | ||
Comment 17•20 years ago
|
||
Attachment #206229 -
Attachment is obsolete: true
Attachment #206517 -
Flags: superreview+
Attachment #206517 -
Flags: review+
Attachment #206517 -
Flags: approval1.8.0.1?
| Assignee | ||
Comment 18•20 years ago
|
||
checked-in.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•20 years ago
|
Attachment #206517 -
Flags: approval1.8.1?
Comment 19•20 years ago
|
||
Can anyone identify whether this patch affects tbird at all? Tbird does use the xpfe contentAreaUtils, but I can't tell from basic examination whether these functions are being used.
Updated•20 years ago
|
Flags: blocking-seamonkey1.0?
Comment 20•20 years ago
|
||
Comment on attachment 206517 [details] [diff] [review]
Patch for check-in
a=dveditz for drivers
Attachment #206517 -
Flags: approval1.8.1?
Attachment #206517 -
Flags: approval1.8.1+
Attachment #206517 -
Flags: approval1.8.0.1?
Attachment #206517 -
Flags: approval1.8.0.1+
Updated•20 years ago
|
Keywords: fixed1.8.0.1 → verified1.8.0.1
Cancelling blocking-seamonkey1.0 request since this is already fixed.
Flags: blocking-seamonkey1.0?
You need to log in
before you can comment on or make changes to this bug.
Description
•