You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



You are here: Browser IQA Test Case index > Test cases description for Charset Handling part II

Test Cases for Browser Basic Charset Handling Part II:
Charset Priority and Override

Updated by software engineer Yuying Long

Setup and Deployment

  1. This is a basic i18n Browser feature. Fonts for i18n testing (e.g. Japanese fonts, Chinese fonts...etc.) are needed in order to run under the environment to display and input i18n data correctly.
  2. This document is only for testing Charset handling in Browser. It is not for testing in Composer, Mail/News...etc..
  3. Please go to Charset Handling Part I to check the test cases for Charset menu and Auto-Detect.
  4. This document focuses on HTML, please go to different detail test cases for XML, CSS, JavaScript...etc focused issues.
  5. Currently Netscape/Mozilla does not fully support the W3C HTML standard charset attribute in resource links; e.g.: Anchor, LINK, SCRIPT.
  6. The live web pages in this document could be changed any time, so they may not contain the information mentioned here. Please find test pages by click here.
  7. Please report bugs in bugzilla.mozilla.org under Browser product with Internationalization component.
  8. This document still under review, please email me for any comments about this document

Platform Combinations

Platforms

PC and Macintosh

Operating Systems

  • Windows (XP, 2000, NT, ME, 98... etc.)
  • Linux Red Hat 6.2, 7.1, 7.2, 7.3...etc.
  • Mac OS X, 9.x

Charsets:

Here are some charset examples for some languages:

  • Japanese (Shift-JIS, EUC-JP, ISO-2022-JP)
  • Traditional Chinese (Big5, EUC-TW, Big5HKSCS)
  • Simplified Chinese (GB2312, GBK, HZ, GB18030)
  • Korean (EUC-KR, UHC, JOHAB, ISO-2022-KR)
  • Western (ISO-8859-1, ISO-8859-15...)
  • ... etc.

Note: Some charset could be represented differently, e.g. SHIIFT-JIS could be x-jis, Shift-jis, Big5 could be Big-5...etc.

Test Cases

1. Charset in new opened Navigator (Browser) window

Test Case # Objective Steps To Perform Expected Results
1-1 Open a new Browser window with a new profile 1). Install new browser build
2). Launch browser with a new profile name.
There should only be one charset in the first tier Character Coding menu: western (ISO-8859-1).

The charset western (ISO-8859-1) is the default charset setting in Preferences | Languages.

1-2 Open a new Browser window with a previous Preferences language setting 1). Launch browser with a new profile name.
2). Go Edit | Preferences | Navigator | Languages, select any charset/encoding other than default (western-iso-8859-1), e.g. Arabic(IBM-864-I).
3). Go Edit | Preferences | Navigator. In "When Navigator starts up, display" section, select "Blank page".
4). Open another Navigator/Browser window using File | Open new Navigator window or quit browser and re-launch again.
The new Navigator/Browser window should open a blank page with charset marked as selected in step 1-2-2) (Arabic (IBM-864-I) if following example).
1-3 Open a new Browser window with the Navigator "Home Page" set to a page that has meta-charset 1). Repeat step 1-2-1) and 1-2-2).
2). Go Edit | Preferences | Navigator, in "When Navigator starts up, display" section, select "Home page"
3). In "Home Page" section, type a meta-charset page's URL in location field. e.g.:
http://home.netscape.com/ja/
4). Open another Navigator/Browser window using File | Open new Navigator window or quit browser and re-launch again.
The new Navigator window should load the page that was specified in step 1-3-3), and the charset that was specified in the page's meta-charset should be marked.
1-4 Open a new Browser window with the Navigator "Blank Page". 1). Go Edit | Preferences | Navigator. In "When Navigator starts up, display" section, select "Blank page". Will load a blank page and the charset will be marked as in Preferences default charset.
1-5 Open a new Browser window with the Navigator "Last page visited". 1). Go Edit | Preferences | Navigator. In "When Navigator starts up, display" section, select "Last page visited".
  • The charset will load the last page before quit Netscape.
  • The charset will be marked depends on the last page information.
1-6 Open a new browser window through a link:
<a href="xxxx" target="new">
1). When there is a web page that included a link such as <a href="xxxx" target="new">.

xxxx here is the link target page location.

2). Click the link in step 1).
Depends on the page charset information in step 1), the new Navigator window charset should be:
  • Charset will be marked as page xxxx charset if there is one in meta tag. E.g.:
    <a href="http://home.netscape.com" target="new">
    - the new page charset will be marked as ISO-8859-1 as matches it's meta charset.
  • If the target page xxxx doesn't has charset meta-tag, then the charset will be carried over from the previous page before click link. E.g.:
    If first load a page A which has a link:
    <a href="xxxx(w/o charset meta-tag)" target="new">, then the new page will be marked as charset in page A.

2. Charset priority

1. In order to better see the correct priority behavior, please run this test without frame(s).

2. The priority list here is for reference:
User Forced > HTTP Header > Byte Order Mark > Meta-charset > Auto-Detection > From Bookmark > (From Parent Frame) > From Cache > (From DocType Default) > From User Default

Test Case # Objective Steps To Perform Expected Results
2-1 User forced charset 1). Launch browser, load any page that does not have frames.
2). Manually override charset:
Select any charset from first tier or second tier | More charset menu.
  • In ANY CASE, the charset that the user manually set should be marked in current browser window.
  • The page should automatically reload after selecting the charset.
3). Click on other opened browser window(s) or open a new browser window. The user-forced charset in step 2-1 should not affect other browser window(s).
2-2 Pages with HTTP server charset info. Load page(s) with charset information in HTTP server or HTTP header...etc. e.g.:
http://www.yahoo.co.jp. (can find a saved yahoo-jp page with HTTP charset set as EUC-JP here: http://sakura.netscape.com/yahoo-jp.html)
It doesn't matter whether the page(s) have http document meta-charset or not.
Page(s) should always display properly, and the charset/encoding should be marked consistently (according to the HTTP server/header) no matter what auto-detect options are set.
2-3 Pages with BOM (Byte Order Mark) or XML...etc. Load a page(s) with BOM, XML...etc, an example for BOM:
This is an UTF-16BE.html page.
  • The charset of the example should be marked based on BOM (UTF-16BE if using example).
  • Any html charset on the page should be ignored by the browser.
Load a page(s) with BOM, also has charset meta-tag.

The charset gb2312 meta-tag will be ignored and marked as UTF-16LE.
2-4 Pages with charset meta-tag Visit some pages that HAVE charset meta-tag (there is a charset information in http page source Content-Type). e.g.:
http://home.netscape.com
The browser should mark the same Charset/Encoding as the one specified in http Page Source meta-charset.
2-5 Pages without charset meta-tag 1). Goto Edit | Preferences | Advanced | Cache and clear both memory and disk Cache.
2). Visit a page(s) that DO NOT HAVE charset meta-tag (there is no charset information in http page source Content-Type), also don't have charset information in page source DocType, e.g.:

The application default charset which was set in Edit | Preferences | Navigator | Languages | Default Character should be marked.

Note: Auto-Detect should be able to detect the proper page charset.

2-6 Pages from Bookmarks or Personal Toolbar 1). Pages in Bookmarks that do not have meta-charset:
  • Visit a page(s) that do not have meta-tag charset, e.g.:
  • Select Big5 charset or auto-detect so that the "Big5" charset is marked.
  • Select "Add Bookmark" through menu Bookmarks, or:
    Drag and drop the URL into a Personal Toolbar.
  • Set Auto-Detect to OFF.
  • Load any other page, then go to Edit | Preferences | Advanced | Cache and clear both memory and disk Cache.
  • Goto Bookmarks or Personal Toolbar and load the page that was saved in step 1c above.
The browser should mark the charset that was selected when the page was put into Bookmarks (Big5 in this example).

skipping step e should yield the same result.

2). Pages in Bookmarks that have meta-charset:
  • Open some pages that contain meta-tag charset, e.g.:
    http://home.netscape.com
    or a page(s) in here, e.g.:
  • Select "Add Boomark" through menu Bookmarks, or:
    Drag and drop the URL into a Personal Toolbar.
  • It doesn't matter which Auto-Detect option is selected, or whether cache was cleared or not
  • Go Bookmarks or Personal Toolbar and load the page that was saved in step 2b above.
The browser should mark the charset that was set by the meta-charset of the page in Bookmark/Personal Toolbar.

3. Charset and Cache

Test Case # Objective Steps To Perform Expected Results
3-1 Load pages with charsets 1). Launch browser, visit a page that HAVE meta-tag charset.
2). Go to Edit | Preferences | Advanced | Cache and clear both memory and disk Cache.
3). Load the page in step 1) again.
  • The Charset/Encoding in Browser should be set to the same one as the one specified in Page Source meta-charset.
  • The browser should display the page using the meta-charset.
4). Load some other pages that specify other meta-charsets or pages that have no meta-charset tags.
5). Change the Auto-Detect options a few times.
6). Do not clear the Cache.
7). Load the page in step 1) again.
The result should be the same as above.
3-2 Load pages without charsets by clear Cache 1). Launch browser, visit a page that DOES NOT HAVE meta-tag charset, e.g. http://geocities.co.jp or test page
2). The default charset that is set in Preferences will be marked. Set Auto-Detect to Japanese to detect this page as EUC-JP, or manually set the charset to EUC-JP.
3). Set Auto-Detect to OFF.
4). Goto Edit | Preferences | Advanced | Cache and clear both memory and disk Cache.
5). Load the page in step 1) again.
The charset which is set in Edit | Preferences | Navigator | Languages | Default Character should be marked.
3-3 Load pages without charsets but not clear Cache 1). Repeat step 3-2-1).
2). Repeat step 3-2-2).
3). Set Auto-Detect to some other option, e.g. Traditional Chinese for the example page above.
4). Load the page in step 1) again.
The charset which was detected or marked in step 3-3-2) would be marked.
3-4 Load Cached pages but without charsets 1). Repeat step 3-2-1).
2). Repeat step 3-2-2).
3). Repeat step 3-2-3).
4). Visit any other page(s), e.g. test page,
http://home.netscape.com, or http://www.yomiuri.co.jp.
It doesn't matter whether the page contains meta-charset or not. You can set any auto-detect option here.
5). Load the page in step 1) again.
  • The browser should mark the same charset as in step 3-4-2) because the loaded page is from the Cache.
  • If you clear Cache after step 3-4-4), then the default charset specified in the Preferences should be marked.
6). Load another page which does not have charset meta-tag, e.g.
test page, or http://www.yahoo.com
The browser should mark the same charset as in step 3-4-2). The Cached charset should carry over.
3-5 Load a page without charset which linked by parent page 1). Create a new profile or clear Cache in Preferences.
2). Load a page with or without charset meta-tag, e.g.
test page or http://www.yahoo.co.jp - This page doesn't have HTML meta-tag charset, but it has HTTP charset from server, so this page will display correctly by default.
3). Click a link here in this page, e.g. shopping to bring the page:
test page or http://shopping.yahoo.co.jp/ - this page doesn't has charset meta-tag, so it will display garbled by default.
4. Change the page charset by manually select correct charset (EUC-JP in this case) or select a auto-detection option.
- Then the page will display properly.
5. Click on any link in this page to bring up sub-page(s) that without charset meta-tag.
The charset in step 3-5-4) should be marked after step 3-5-5), and the page will be displayed properly.
6. Click on any link in step 3-5-5).
7. Repeat above again.
The charset in step 3-5-4) will be carry over.

4. Charset override with frame(s)

Note

  • In order to better see the correct behavior, test cases of pages that contain more than 2 child frames are not discussed here.
  • Use View | Page Source to find out about the page's meta-charset information.
  • Move the mouse pointer to the child frame position, right click, and choose "View Frame Source" or "View Page Source" to get both frame and page's charset information.
Test Case # Objective Steps To Perform Expected Results
4-1 Load pages without charsets in both main page and child frames 1). Launch browser, find a page with frame(s) that
DO NOT HAVE meta-tag charset in both main and child pages.
Click test page. There is no meta-charset info in both the main page and the 2 child pages, and the 2 frame pages are both encoded in EUC-JP.
2). Clear Cache, set Auto-Detect to OFF and open the page above in a new Navigator window.
The charset which is set in Edit | Preferences | Navigator | Languages | Default Character should be marked.
3). Select Auto-Detect, All, East Asian, Japanese, or:
4). Manually select EUC-JP charset.
The pages including child frame pages should be displayed properly, and the charset menu should be marked as EUC-JP.
4-2 Load pages without charsets in both main and child frame pages, and the 2 frames are in different encoding 1). Launch browser, find a page with frame(s) that
DO NOT HAVE meta-tag charset in both main and child pages, but the 2 frames are in DIFFERENT encoding.
Click test page. The left frame is encoded in EUC-JP, and the right frame is encoded in SHIFT-JIS.
2). Clear Cache, set Auto-Detect to OFF and open the page above in a new Navigator window.
The charset which is set in Edit | Preferences | Navigator | Languages | Default Character should be marked.
3). Manually select EUC-JP charset. The left frame should be displayed properly but the right frame should be garbled.
4). Manually select SHIFT-JIS charset. The right frame should be displayed properly but the left frame should be garbled.
5). Select Auto-Detect, All, East Asian, Japanese. Both left and right frame should be displayed properly.
4-3 Load pages with charset specified in main page and 2 child frames in same encoding but without meta-charset 1). Launch browser, find a page with frame(s) that
HAS meta-tag charset in main page, and the 2 frames DO NOT HAVE meta-charset but in same encoding.
Click test page. The main page has meta-charset SHIFT-JIS, the 2 frames are encoded in SHIFT-JIS but do not have meta-charset.
2). Clear Cache, set Auto-Detect to OFF and open the page above in a new Navigator window.
  • The main page's meta-charset should be marked.
  • Both left and right frame should be displayed properly.
3). Select Auto-Detect, All, East Asian, Japanese, or:
4). Manually select SHIFT-JIS charset.
The example page should be displayed properly, and the charset menu should mark the SHIFT-JIS charset.
4-4 Load pages with charset specified in main page and also in each child frames 1). Launch browser, find a page with frame(s) that
HAS meta-tag charset in main page as well as in each child frames.
Click test page. The main page has meta-charset ISO-2022-JP, meta-charset for left frame is SHIFT-JIS and for right frame is EUC-JP.
2). Clear Cache, set any Auto-Detect option and open the page above in a new Navigator window.
The example page should be displayed properly, and the charset menu should marked ISO-2022-JP as the charset.
3). Manually override charset by ISO-2022-JP. Both left and right frame should be garbled.
4). Manually override charset by SHIFT-JIS. The left frame should display properly but the right frame should be garbled.
5). Manually override charset by EUC-JP. The right frame should display properly but the left frame should be garbled.