Closed Bug 123044 Opened 23 years ago Closed 23 years ago

charset should be on nsIChannel, not nsIHttpChannel

Categories

(Core :: Networking, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: bzbarsky, Assigned: darin.moz)

References

Details

(Keywords: arch, topembed+)

Per IRC discussion with Darin, we should expose charset on nsIChannel, not nsIHttpChannel. Then parts of multipart channels should also expose their charsets.
cc'ing some folks who might have input on this.
there are more channels than not which do not care about charsets. Why forces this on them?
dougt: true, but it is very common for nsIChannel clients to want to know if there is charset information. just like contentLength and contentType, these values can have defaults which mean "channel doesn't know." eg. we could use a value of NULL to indicate an unknown charset. also, it just seems like something you'd generically need if given a random data stream. things like contentType and contentLength make sense, and so does contentCharset. it's a way of identifying the data in a generic way. therefore seems appropriate to provide it on nsIChannel. IMO the fact that many protocols don't provide a charset doesn't necessarily justify leaving it off of nsIChannel.
Yep... I agree. The notion of 'charset' needs to be pushed up into nsIChannel. Since we expose the content-type at the nsIChannel level, we need to provide charset info so consumers know how to interpret "text/..." content without relying on protocol-specific interface methods... RFC 2277 also puts forth an argument for having the 'charset available for ALL protocols...' (just to reference an RFC :-)) Will this remain a 'readonly attribute string' ? i also think that we should document that the returned charset must be a IANA registered name... just to be clear that ALL protocols must use the same charset namespace... -- rick
it should probably be a r/w attribute so content sniffers can assign/override default charset as specified by the channel impl.
-> me
Assignee: neeti → darin
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9.9
sounds good to me ;-) -- rick
-> 1.0
Target Milestone: mozilla0.9.9 → mozilla1.0
Blocks: 128508
Keywords: arch, mozilla1.0
Moving Netscape owned 0.9.9 and 1.0 bugs that don't have an nsbeta1, nsbeta1+, topembed, topembed+, Mozilla0.9.9+ or Mozilla1.0+ keyword. Please send any questions or feedback about this to adt@netscape.com. You can search for "Moving bugs not scheduled for a project" to quickly delete this bugmail.
Target Milestone: mozilla1.0 → mozilla1.2
forgot to add topembed on this one.
Keywords: topembed
Target Milestone: mozilla1.2 → mozilla1.0
Keywords: topembedtopembed+
fixed-on-trunk see patch in bug 128508 created nsIChannel::contentCharset, removed nsIHttpChannel::charset.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.