If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Changing Character set of existing meta-charset html puts wrong character set

VERIFIED FIXED

Status

()

Core
Internationalization
P3
major
VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: Teruko Kobayashi, Assigned: Frank Tang)

Tracking

({regression})

Trunk
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [nsbeta3-])

(Reporter)

Description

17 years ago
When you try to change the character coding of existing meta-charaset html
doc in composer, meta-charset will add instead of changing original 
meta-charset.

Steps of reproduce
1. Go to http://home.netscape.com/ja/
2. Select menu File|Save Page as.. to save in the local directory
3. Open Composer
4. Select menu File|Open File... to open the file you saved in step #2
5. Select menu View|Characer coding->More->East Asian->Japanese(EUC-JP)
6. Save the file

Look at the source code of the file.

Looks like this.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=x-sjis"><meta 
http-equiv="PICS-Label" content="(PICS-1.1 "><meta http-equiv="PICS-Label" 
content="(PICS-1.1 "><style>

.window( margin: 0px )

</style>
<title>Netscape {</title>
<script language="JavaScript"><!-- Hide from old browsers
// the
code redirects 2.x users to the download page. The FRAMESET tag hides the
rest of the page so it doesn't display.
if (parseFloat(navigator.appVersion)
<3) {
document.write('<FRAMESET>');
location.href="/ja/download/index.html";
}
else
if ((parseFloat(navigator.appVersion) 
<5)||((navigator.appName!="Netscape")&&(navigator.appName!="Mozilla")))

{ 
location.href="/ja/index.html"; 
} 
// Stop Hiding From Old Browsers
--></script><meta http-equiv="content-type" content="text/html; 
charset=ISO-8859-1">

-----------------------------------------------------------------------

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
is added.  It did not replace the original meta charset.

Also, the added charset is not one I selected.  I selected Japanese (EUC-JP),
not ISO-8859-1.

Tested 2000-09-15-09 Mac and Linux, and 2000-09-15-05 Win32 build.
(Reporter)

Comment 1

17 years ago
This is regression. I nominate this for beta3.
Keywords: nsbeta3, regression

Comment 2

17 years ago
Reassign to Frank.
Assignee: nhotta → ftang
(Assignee)

Comment 3

17 years ago
I remember cmanske mention that there are some issue about DOM in head section. 
Add harishd to the cc list.
Also, close 51432 since the origional display problem is gone. 

The problem also happen to page which have no meta tag. A wrong meta tag will be 
added to the page when we save.

bstell is looking at this one.
Whiteboard: nsbeta3+

Comment 4

17 years ago
(bstell speaking)
When loading a file in to a *pre-existing* compose window the function 
EditorSetDefaultPrefs() runs code that should only be run for a blank
page.

This sets an extra (incorrect) charset. It also runs a lot of code that 
is only intended for a blank page so it is likely there are other 
unexpected side effects.

The call 'document.getElementById("args")' holds the info from the
creation of the blank page not the page being loaded.

To reproduce:

 1) create a simple html file

      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
        <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
        <title>my file1</title>
      </head>
      <body>
      some text<br>
      </body>
      </html>

 2) on "Tasks"->"Composer" to get a blank page.

 3) Using the composer menus click on "File"->"Open File"
    The error occurs at this point.

 4) To see the incorrectly produced html save the file (or click on 
    "View"->"HTML Source" to see the html)

Assignee: ftang → sfraser

Comment 5

17 years ago
assign to sfraser

Comment 6

17 years ago
Charley: what's happening here is that the line:
  var url = document.getElementById("args").getAttribute("value");
in EditorSetDefaultPrefs is wrong.

args.value is only set when opneing new windows, not when loading files into an 
existing window. To get the correct URL, you need to look at the src attribute of 
the <editor> iframe.
Assignee: sfraser → cmanske

Comment 7

17 years ago
Fixed waiting for review
Status: NEW → ASSIGNED

Comment 8

17 years ago
Checked in 9/24
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 9

17 years ago
make that 9/21!
(Reporter)

Comment 10

17 years ago
I tested this in 2000-09-22-13 Win32, 9-25-08 Win32 and Linux build.
After I changed the character coding menu to something other than original meta
charset and save it, the meta charset info is not changed.  It remains as the
original meta charset.

To reproduce:

 1) create a simple html file

      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
      <html>
      <head>
        <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
        <title>my file1</title>
      </head>
      <body>
      some text<br>
      </body>
      </html>

 2) on "Tasks"->"Composer" to get a blank page.

 3) Using the composer menus click on "File"->"Open File" to open this file

 4) Select menu View|Character coding -> more->East Asian-> Japanese(Shift_JIS)

 5) Type something
 
 6) Select menu File|Save 

 7) Look at the file
    Meta charset info is still ISO-8859-1.
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">  
  
Need to be reopen.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Reporter)

Comment 11

17 years ago
Even though I selected menu File|Save as Charset to change the charset in
Save as charset dialog, the meta charset info did not changed.
(Reporter)

Comment 12

17 years ago
I tested this in 2000-09-25-12 Mac build.  I got the same result of Win32 and 
Linux build.

Also, if the original html file does not have any meta info and select one of
character set from character coding menu, it will not add meta charset when I 
saved this file.

Comment 13

17 years ago
Well it sounds to me like there were other problems besides what I fixed,
which was to not insert the "extra" charset when opening a blank page.
If the wrong charset is being inserted, then that problem belongs to implementor
of the charset changing and Save As Charset code, since I'm not expert with
what should happen.

Assignee: cmanske → ftang
Status: REOPENED → NEW

Comment 14

17 years ago
per PDT: P3-P5 priority bugs changed from nsbeta3+ to nsbeta3- since we have
more important work to do for Seamonkey. If you disagree, please state your case
in the bug report and nominate for rtm and adjust priority if this bug was
mis-prioritized. Thanks.

Whiteboard: nsbeta3+ → [nsbeta3-]
(Reporter)

Comment 15

17 years ago
OK, the original bug is fixed.  I will log the different bug about Save as, 
Save charset.
Status: NEW → RESOLVED
Last Resolved: 17 years ago17 years ago
Resolution: --- → FIXED

Comment 16

17 years ago
fixing my email address in the Cc: list
(Reporter)

Comment 17

17 years ago
Verified as fixed.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.