khtml::Loader doesn't use a charset specified in Content-Type HTTP header. See the attached test case (accesses an external server)
Created attachment 4047 [details] test document
Created attachment 4048 [details] proposed patch
Comment on attachment 4048 [details] proposed patch These files are formatted somewhat inconsistently; I tried to match what I saw in the nearest parts. Also, there were tabs in some places; I used spaces, as usual.
A setter method should be called "setCharset()", not just "charset()". Also, what will this code do if the HTTP headers include an invalid or unknown charset? Will the code that deletes the codec and fetches a new one leave you with no coded in this case?
Comment on attachment 4048 [details] proposed patch r- for setCharset() rename, and please make clear why blindly deleting the codec is OK, or fix it if it isn't.
Created attachment 4079 [details] proposed patch Blindly deleting the codec was safe, because we were getting iso8859-1 for invalid charsets. But on a second thought, it was probably not such a good idea, because it didn't match what khtml::Decoder does for invalid charsets.
Comment on attachment 4079 [details] proposed patch r=me
I'll commit this.
Bug 5484 contains a fix for this patch.
*** Bug 4879 has been marked as a duplicate of this bug. ***