Closed Bug 306310 Opened 20 years ago Closed 20 years ago

empty tab shows garbage -- about:blank needs an encoding

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: ian, Assigned: Biesinger)

References

(Depends on 1 open bug)

Details

(Keywords: verified1.8)

Attachments

(1 file, 1 obsolete file)

STEPS TO REPRODUCE 1. Set your default encoding to UTF-16. 2. Open a new tab. ACTUAL RESULTS Garbage is displayed. EXPECTED RESULTS Nothing is displayed. We are failing to auto-detect the encoding of about:blank (probably too little data to go on or something) and falling back on the default encoding. We should instead just be using the real encoding of about:blank, which is either US-ASCII or a superset of US-ASCII such as UTF-8.
Attached patch patch (obsolete) — Splinter Review
this is an awesome bug. Unfortunately, about:plugins and friends are harder to fix... they just redirect to a chrome:// url, and I'm not sure all chrome channels should specify a charset...
Assignee: darin → cbiesinger
Status: NEW → ASSIGNED
Attachment #194184 - Flags: superreview?(darin)
Attachment #194184 - Flags: review?(darin)
Comment on attachment 194184 [details] [diff] [review] patch Why not use utf-8 for about:blank as well? I guess I'm worried about cases where about:blank is loaded into a document and then mutated via the DOM (by privileged script).
Blocks: 252604
oh, I meant to change that to UTF-8. but DOM mutation should still be fine, shouldn't it? that charset only affects parsing, not DOM mutation... (hm... although it does affect the origin charset of URIs) I'll change it to UTF-8
Comment on attachment 194184 [details] [diff] [review] patch good point about DOM mutations... also, we now ignore the origin charset when encoding URIs ;-) we default to always encoding using UTF-8 for Firefox 1.5 ;-)
Attachment #194184 - Flags: superreview?(darin)
Attachment #194184 - Flags: superreview+
Attachment #194184 - Flags: review?(darin)
Attachment #194184 - Flags: review+
that's r+sr=darin with the change from us-ascii to utf-8 anyways for good measure.
don't we still use the origin charset for unescaping the URI for UI, or something like that?
Attachment #194184 - Attachment is obsolete: true
fixed on trunk Checking in netwerk/protocol/about/src/nsAboutBlank.cpp; /cvsroot/mozilla/netwerk/protocol/about/src/nsAboutBlank.cpp,v <-- nsAboutBlank.cpp new revision: 1.31; previous revision: 1.30 done Checking in netwerk/protocol/about/src/nsAboutBloat.cpp; /cvsroot/mozilla/netwerk/protocol/about/src/nsAboutBloat.cpp,v <-- nsAboutBloat.cpp new revision: 1.39; previous revision: 1.38 done Checking in netwerk/protocol/about/src/nsAboutCache.cpp; /cvsroot/mozilla/netwerk/protocol/about/src/nsAboutCache.cpp,v <-- nsAboutCache.cpp new revision: 1.40; previous revision: 1.39 done Checking in netwerk/protocol/about/src/nsAboutCacheEntry.cpp; /cvsroot/mozilla/netwerk/protocol/about/src/nsAboutCacheEntry.cpp,v <-- nsAboutCacheEntry.cpp new revision: 1.29; previous revision: 1.28 done
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
OS: Linux → All
Hardware: PC → All
Resolution: --- → FIXED
Comment on attachment 194433 [details] [diff] [review] utf-8 even for about:blank transferring r+sr=darin low risk patch to make various about: pages work with unusual default charset prefs
Attachment #194433 - Flags: superreview+
Attachment #194433 - Flags: review+
Attachment #194433 - Flags: approval1.8b4?
> don't we still use the origin charset for unescaping the URI for UI, or > something like that? Yeah, that does happen in some cases.
Attachment #194433 - Flags: approval1.8b4? → approval1.8b4+
MOZILLA_1_8_BRANCH: Checking in netwerk/protocol/about/src/nsAboutBlank.cpp; /cvsroot/mozilla/netwerk/protocol/about/src/nsAboutBlank.cpp,v <-- nsAboutBlank.cpp new revision: 1.30.20.1; previous revision: 1.30 done Checking in netwerk/protocol/about/src/nsAboutBloat.cpp; /cvsroot/mozilla/netwerk/protocol/about/src/nsAboutBloat.cpp,v <-- nsAboutBloat.cpp new revision: 1.38.18.1; previous revision: 1.38 done Checking in netwerk/protocol/about/src/nsAboutCache.cpp; /cvsroot/mozilla/netwerk/protocol/about/src/nsAboutCache.cpp,v <-- nsAboutCache.cpp new revision: 1.39.12.1; previous revision: 1.39 done Checking in netwerk/protocol/about/src/nsAboutCacheEntry.cpp; /cvsroot/mozilla/netwerk/protocol/about/src/nsAboutCacheEntry.cpp,v <-- nsAboutCacheEntry.cpp new revision: 1.28.12.1; previous revision: 1.28 done
Keywords: fixed1.8
Keywords: fixed1.8verified1.8
Depends on: 315381
Depends on: 354370
Blocks: 218101
Depends on: 369392
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: