Open Bug 477442 Opened 16 years ago Updated 7 years ago

"Edit as comment" mangles charset

Categories

(Bugzilla :: Attachments & Requests, defect)

3.2.2
defect
Not set
normal

Tracking

()

People

(Reporter: philor, Unassigned)

References

()

Details

STR: 1. Add an attachment with a non-ISO-8859-1 character, like a Mozilla DTD with a UTF-8 ellipsis character 2. Go to the &action=edit URL 3. Note that the character is properly displayed 4. "Edit as comment" 5. Note that if your install is using MySQL, the character is mangled into the "â¦" that's the result of treating UTF-8 as ISO-8859-1 After seeing one on bmo, I added one to landfill's bugzilla-tip and bugzilla-3.2-branch, both of which failed, and added one to bugzilla-tip-pg which did not fail (the one I added to bugzilla-tip-oracle is, sadly, too unsafe to be viewed by ordinary mortals, so I don't know whether it worked).
Flags: blocking3.2.3?
... is also mangled in bugzilla-tip-oracle. I just turned on allow_attachment_display there.
Actually, all DBs should be doing this. If they're not, it's a sign that they're treating the raw bytes of attachments as always being utf8, which is not good. The problem here is that we no longer get the advantage of the browser's charset detector, since we no longer use XMLSerializer to display the attachment. We actually have no idea what character set the attachment is in, though we could use Encode::Guess (which isn't that reliable) on it and convert to utf8 on display for "edit attachment as comment", if the utf8 bit is on, for text/* attachments. I'm going to leave the blocking flag as "?" until somebody does more investigation into a good way to fix this and we see how invasive it would be.
Target Milestone: --- → Bugzilla 3.2
The symptom is probably introduced by attachment 286357 [details] [diff] [review]
(In reply to comment #3) > The symptom is probably introduced by attachment 286357 [details] [diff] [review] Sort of. That plus a combination of bug 38862 (more bug 38862 than the utf8 bug).
I can't make this a blocker, because I don't even know if it's actually even *fixable* in any reasonable way.
Flags: blocking3.2.3? → blocking3.2.3-
Bugzilla 3.2 is restricted to security bugs only. Mass-retargetting to 3.6.
Target Milestone: Bugzilla 3.2 → Bugzilla 3.6
Blocks: 365926
No longer blocks: 365926
Target Milestone: Bugzilla 3.6 → Bugzilla 4.0
This is not limited to MySQL. The problem is reproducible with PostgreSQL.
This is not limited to MySQL. The problem is reproducible with PostgreSQL.
Summary: "Edit as comment" mangles charset when using MySQL → "Edit as comment" mangles charset
Bugzilla 4.0 is restricted to security fixes only.
Target Milestone: Bugzilla 4.0 → ---
i couldn't search in regular attachment mode so in order to do so, I switched to edit as comment mode.
You need to log in before you can comment on or make changes to this bug.