Last Comment Bug 369392 - Composer declares wrong encoding
: Composer declares wrong encoding
: fixed-seamonkey1.1.7, fixed-seamonkey1.1.8, relnote
Product: SeaMonkey
Classification: Client Software
Component: Composer (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Mike Hommey [:glandium]
: 317165 384485 405526 (view as bug list)
Depends on: 400372
Blocks: 306310
  Show dependency treegraph
Reported: 2007-02-05 13:19 PST by Mike Hommey [:glandium]
Modified: 2010-02-12 18:17 PST (History)
10 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

patch (420 bytes, patch)
2007-02-05 13:19 PST, Mike Hommey [:glandium]
ajvincent: review+
neil: superreview+
kairo: approval‑seamonkey1.1.8+
Details | Diff | Splinter Review

Description Mike Hommey [:glandium] 2007-02-05 13:19:26 PST
Created attachment 254061 [details] [diff] [review]

(this was first reported in )

If you create a new document and look at the source code, you see in the meta tag that the content is supposed to be iso-8859-1. Take a look in the View -> Character Encoding menu and you'll see UTF-8 is selected.
Add some non latin characters (like €), and save the document, when you save the document without changing the output encoding (default being UTF-8), it will correctly save an UTF-8 file (which you can check with something like isutf8), but it will still contain the iso-8859-1 indicating meta tag.
Now try to save again in UTF-8 but after choosing another encoding, and the meta tag will be updated.

The fact is the encoding for the meta tag is decided from the  intl.charset.default (which is l10n dependant). OTOH, the document encoding is always UTF-8. The document encoding needs to be changed at creation time to fit that of the intl.charset.default pref.

See the attached patch.
Comment 1 Alex Vincent [:WeirdAl] 2007-02-05 13:48:19 PST
Comment on attachment 254061 [details] [diff] [review]

r=ajvincent (glazou has authorized me as module owner to be a peer for ui changes)
Comment 2 Benjamin Levy 2007-02-22 12:39:56 PST
I don't know if this is related, but if I copy text from another file (e.g., MS Word) into the Composer it'll correctly display m-dashes, left and right quotes (single and double), ....  But if you close the HTML file, and reopen it, it will now display those characters as gibberish.
Comment 3 Reed Loden [:reed] (use needinfo?) 2007-10-11 23:34:50 PDT
Neil, can you sr?
Comment 4 2007-10-12 04:58:41 PDT
Comment on attachment 254061 [details] [diff] [review]

Things are worse still on trunk, because bug 331991 serialises the meta tag according to the actual character set, so it ignores the default.
Comment 5 Alex Vincent [:WeirdAl] 2007-10-12 09:38:35 PDT
Mike, does this patch still apply to trunk?
Comment 6 Reed Loden [:reed] (use needinfo?) 2007-10-12 09:42:52 PDT
(In reply to comment #5)
> Mike, does this patch still apply to trunk?

It looks like it does.
Comment 7 Reed Loden [:reed] (use needinfo?) 2007-10-14 12:18:32 PDT
Comment on attachment 254061 [details] [diff] [review]

do I need approval for trunk, too?
Comment 8 Robert Kaiser 2007-10-14 12:28:47 PDT
Comment on attachment 254061 [details] [diff] [review]

yes, let's do this, it sounds safe for branch. a=me
Comment 9 Robert Kaiser 2007-10-14 12:32:29 PDT
Comment on attachment 254061 [details] [diff] [review]

trunk SeaMonkey-specific code doesn't need approval at the moment, clearing 2.0a1 flag.
Comment 10 Reed Loden [:reed] (use needinfo?) 2007-10-14 20:14:58 PDT
Checking in editor/ui/composer/content/editor.js;
/cvsroot/mozilla/editor/ui/composer/content/editor.js,v  <--  editor.js
new revision: 1.247; previous revision: 1.246

When I'm sure what branch I'm supposed to land this on, I'll do the branch check-in.
Comment 11 Reed Loden [:reed] (use needinfo?) 2007-10-14 20:54:11 PDT

Checking in editor/ui/composer/content/editor.js;
/cvsroot/mozilla/editor/ui/composer/content/editor.js,v  <--  editor.js
new revision:; previous revision:
Comment 12 2007-11-03 04:28:51 PDT
*** Bug 317165 has been marked as a duplicate of this bug. ***
Comment 13 2007-11-03 04:33:11 PDT
*** Bug 384485 has been marked as a duplicate of this bug. ***
Comment 14 Johannes Leushuis 2007-11-30 17:42:15 PST
*** Bug 405526 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.