Closed Bug 93269 Opened 24 years ago Closed 24 years ago

Charset meta tag is ignored on view page source window when auto-detector is on

Categories

(Core :: Internationalization, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: ji, Assigned: shanjian)

References

()

Details

(Keywords: intl)

Attachments

(3 files)

*****Observed with linux 07/26 branch build***** When auto-detector is on, the charset meta tag is ignored on view page source window. Steps to reproduce: 1. Turn on auto-detector on Japanese. 2. Go to http://home.netscape.com/zh/cn 3. View page source on this page. Simplified Chinese characters are not displayed correctly. 4. Turn-off auto-detector, view this page source again, this time it's displayed correctly.
*** Bug 93267 has been marked as a duplicate of this bug. ***
Keywords: intl
Actually, I had a bug 92632 talking about same problem: Auto-detect set to different language, the Page Source will shows in-correctly. However, when I filed that bug, I thought it was because the fix of bug 90288. Then I checked 2 builds (07-25 and 07-26/27), and auto-detect set to different condition (07-25 OFF, and 07-27 with wrong language setting), so I thought it was my mistake, then I closed it cause I think that we can not handle such kind of case. Xianglan, if Auto-detect to Chinese, then the Page Source will display fine, right? I'm wondering do we consider this is a problem? it's on all platforms.
OS: Linux → All
Hardware: PC → All
My point is charset meta tag should have higher priority than auto-detector on both navigator window and view page source window.
And stored charset for a page w/o charset meta tag should also have higher priority than auto-detector for view page source window. For example, I turn on auto-detector on Japanes, when I visit a Chinese page w/o meta tag, I correct the view by selecting charset menu, then I view page source on this window, I should be able to view the page source window in the Chinese charset I set by selecting the menu, not in the charset sniffed by auto-detector.
This is a problem. I am investigating now.
Status: NEW → ASSIGNED
Attached patch proposed patchSplinter Review
Harish, this problem is related with your change in parser. Meta charset might be the only exception that need to be handled correctly in view source. I think it should be ok to do this special handling inside meta charset observer. Please review my code and make sure it is consistent with your change in parser. If everything looks OK, please give a r=, thanks!
QA Contact: andreasb → ylong
+ while(IS_SPACE_CHARS(httpEquivValue[lastIdx]) && lastIdx > 0) + lastIdx--; This will still fail when out of bounds. Should be + while(lastIdx > 0 && IS_SPACE_CHARS(httpEquivValue[lastIdx])) { + lastIdx--; + }
Actually, it should be + while(lastIdx >= 0 && IS_SPACE_CHARS(httpEquivValue[lastIdx])) { + lastIdx--; + }
Harish, I rechecked my patch and I found out that it is not really necessary to check the last quote character. So I update my patch one more time. Could you take a look? thanks!
r=harishd for patch id=45255.
blizzard, can you sr this patch?
sr=blizzard
fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Fixed verified on 09-04 trunk build on Win2k-CN and Linux RH6.2-Ja.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: