Composer declares wrong encoding

RESOLVED FIXED

Status

SeaMonkey
Composer
RESOLVED FIXED
10 years ago
7 years ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

({fixed-seamonkey1.1.7, fixed-seamonkey1.1.8, relnote})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 254061 [details] [diff] [review]
patch

(this was first reported in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=408220 )

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.
Attachment #254061 - Flags: review?(ajvincent)
Comment on attachment 254061 [details] [diff] [review]
patch

r=ajvincent (glazou has authorized me as module owner to be a peer for ui changes)
Attachment #254061 - Flags: superreview?(neil)
Attachment #254061 - Flags: review?(ajvincent)
Attachment #254061 - Flags: review+

Comment 2

10 years ago
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.
Neil, can you sr?
Assignee: daniel → mh+mozilla

Comment 4

10 years ago
Comment on attachment 254061 [details] [diff] [review]
patch

Things are worse still on trunk, because bug 331991 serialises the meta tag according to the actual character set, so it ignores the default.
Attachment #254061 - Flags: superreview?(neil) → superreview+
Mike, does this patch still apply to trunk?
(In reply to comment #5)
> Mike, does this patch still apply to trunk?

It looks like it does. http://mxr.mozilla.org/mozilla/source/editor/ui/composer/content/editor.js#2477

Updated

10 years ago
Blocks: 306312
Keywords: relnote
OS: Linux → All

Updated

10 years ago
Attachment #254061 - Flags: approval-seamonkey1.1.6?

Updated

10 years ago
Blocks: 306310
No longer blocks: 306312
Comment on attachment 254061 [details] [diff] [review]
patch

do I need approval for trunk, too?
Attachment #254061 - Flags: approval-seamonkey2.0a1?

Comment 8

10 years ago
Comment on attachment 254061 [details] [diff] [review]
patch

yes, let's do this, it sounds safe for branch. a=me
Attachment #254061 - Flags: approval-seamonkey1.1.6? → approval-seamonkey1.1.6+
Keywords: checkin-needed

Comment 9

10 years ago
Comment on attachment 254061 [details] [diff] [review]
patch

trunk SeaMonkey-specific code doesn't need approval at the moment, clearing 2.0a1 flag.
Attachment #254061 - Flags: approval-seamonkey2.0a1?
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
done

When I'm sure what branch I'm supposed to land this on, I'll do the branch check-in.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
MOZILLA_1_8_BRANCH:

Checking in editor/ui/composer/content/editor.js;
/cvsroot/mozilla/editor/ui/composer/content/editor.js,v  <--  editor.js
new revision: 1.235.2.4; previous revision: 1.235.2.3
done
Keywords: checkin-needed
Keywords: fixed-seamonkey1.1.6

Updated

10 years ago
Depends on: 400372

Updated

10 years ago
Duplicate of this bug: 317165

Updated

10 years ago
Duplicate of this bug: 384485

Updated

10 years ago
Component: General → Composer
Product: Composer → Mozilla Application Suite
Version: 1.0 → unspecified

Updated

10 years ago
Duplicate of this bug: 405526

Updated

8 years ago
Keywords: fixed-seamonkey1.1.8
You need to log in before you can comment on or make changes to this bug.