Encoding problems after switching the layout

Bug #397574 reported by scamp
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Thunderbird
Fix Released
Low
thunderbird (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: thunderbird

steps to reproduce:
- View -> Layout -> Classic View
- View -> Layout -> enable Message Pane
- select a message in which you can see special characters (e.g. ö,ä,ü...)
- switch the layout, e.g. View -> Layout -> Wide View

now you can see, that the special characters are displayed wrong (e.g. ö instead of ö)

If you select another mail and select this mail again, the characters are displayed without problems!

I think there is a problem with the encoding after switching the layout

Regards
scamp

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
Package: mozilla-thunderbird 2.0.0.21+nobinonly-0ubuntu1.9.04.1
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: thunderbird
Uname: Linux 2.6.28-11-generic x86_64

Revision history for this message
In , Mcow (mcow) wrote :

Selecting a different message and reselecting should also work to reset the
encoding, unless you had to manually set the encoding originally.

See bug 236872 for a similar symptom.

Revision history for this message
In , Mcow (mcow) wrote :

*** Bug 273386 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Mcow (mcow) wrote :

Interestingly, for Thunderbird (0.9+1201, Win2K) this is only a problem when
switching to or from the second, "wide" layout -- switching between standard
layout and 3-column layout doesn't appear to affect the encoding.

Moz 1.8a6 loses the encoding for every layout switch.

Revision history for this message
In , Neil-httl (neil-httl) wrote :

Switching layout should only call ReloadMessage (unless that's faulty...)

Revision history for this message
In , Mcow (mcow) wrote :

*** Bug 242918 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Mcow (mcow) wrote :

Updating platform/os per dupe (reported under Linux)

Revision history for this message
In , Tlis (tlis) wrote :

I just want to confirm, that this bug is still present in Thunderbird 1.0 final
(20041206)

Revision history for this message
In , Mcow (mcow) wrote :

*** Bug 280741 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Mcow (mcow) wrote :

*** Bug 284983 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Mcow (mcow) wrote :

*** Bug 294321 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Elmar-ludwig (elmar-ludwig) wrote :

*** Bug 314394 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Elmar-ludwig (elmar-ludwig) wrote :

*** Bug 319995 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Ian-themodernlife (ian-themodernlife) wrote :

This might be similar to bug 296422. When we switch to wide view, some widgets get reparented, you have to reload the docshell, and the call to ReloadMessages raises an exception. This happens in thunderbird 1.5 on windows as well.

Revision history for this message
In , Mcow (mcow) wrote :

(In reply to comment #13)
> This might be similar to bug 296422.

That's just been fixed...

> This happens in thunderbird 1.5 on windows as well.

Does it? I can't reproduce this bug's symptom in TB 1.5 or Seamonkey 1.0, whereas it's simple to reproduce it in TB 1.0. (With Moz 1.7, you can't
change the layout immediately.)

Revision history for this message
In , Bugzilla-ett-idesystem (bugzilla-ett-idesystem) wrote :

(In reply to comment #14)
This still happens with encoding iso-8859-1 in TB version 1.5 (20051201)

There are other times than when layout is switched that the encoding gets messed up. I cannot reproduce it reliably enough though. It happens when switching back and forth between certain folders, but not always.

Revision history for this message
In , Mcow (mcow) wrote :

(In reply to comment #15)
> (In reply to comment #14)
> This still happens with encoding iso-8859-1 in TB version 1.5 (20051201)
>
> There are other times than when layout is switched that the encoding gets
> messed up. I cannot reproduce it reliably enough though. It happens when
> switching back and forth between certain folders, but not always.

What, exactly, are you saying "still happens" -- that the message encoding is lost for the displayed message when the layout is changed, or that the message encoding is lost for some other situation such as "switching back and forth between certain folders"?

It appears you mean the latter. That is NOT THIS BUG, and so it is NOT "still happening."

You might be encountering the problem described at bug 315957.

Revision history for this message
In , Bugzilla-ett-idesystem (bugzilla-ett-idesystem) wrote :

(In reply to comment #16)
> (In reply to comment #15)
> > (In reply to comment #14)
> > This still happens with encoding iso-8859-1 in TB version 1.5 (20051201)
> >
> > There are other times than when layout is switched that the encoding gets
> > messed up. I cannot reproduce it reliably enough though. It happens when
> > switching back and forth between certain folders, but not always.
>
> What, exactly, are you saying "still happens" -- that the message encoding is
> lost for the displayed message when the layout is changed, or that the message
> encoding is lost for some other situation such as "switching back and forth
> between certain folders"?
>
> It appears you mean the latter. That is NOT THIS BUG, and so it is NOT "still
> happening."
>
> You might be encountering the problem described at bug 315957.
>

Mike,
When I say this "still happens", I mean if I follow the instructions in the original bug description, I can reproduce the "actual result".

In addition to what the original poster describes, it also happens when switching between folders, but only sometimes. Yes, this may be bug 315957 but I didn't know that bug existed and thought it might be relevant to this bug at the time of posting comment #15.

Win XP, TB version 1.5.0.2 (20060308)

Revision history for this message
In , Tomer Shalev (tomers) wrote :

Happens also on the following configuration:
OS: Windows XP
Mozilla Thunderbird version 1.5.0.5 (20060719)

It seems like the problem is only with the "Wide view" layout.

Message initially appears correctly using Classic layout using Hebrew (Windows-1255) encoding.
Switching to Vertical view preserves the message's encoding.
Switching to Wide view does not preserves the message's encoding. The Encoding menu still shows the correct (Windows-1255) encoding, but selecting this encoding again redraws the message correctly. Switching back to any other layout shows the message correctly.

Revision history for this message
In , Tomer Shalev (tomers) wrote :

Fix:
In regard to the previous comment, after switching to "Wide View" layout and losing the message's encoding, when switching back to any other view layout the message still appears incorrectly and the initial correct encoding is not preserved.

Revision history for this message
In , Mcow (mcow) wrote :

(In reply to comment #19)
> Fix:
> In regard to the previous comment, after switching to "Wide View" layout and
> losing the message's encoding, when switching back to any other view layout
> the message still appears incorrectly and the initial correct encoding is not
> preserved.

Why did you label that sentence "Fix:"?

Did you try simply selecting a different message and then reselecting the problem one, without changing layout? That is the simple way to re-view the message correctly.

I need to retract my comment 14 & 16. I'm not completely sure of the sequence of events, but I'm now seeing this symptom occurring in 1.5.0.5 and 2a1-0912, Win2K.

When I started retesting this today, I couldn't reproduce it. I checked the setting for
  View | Encoding | Autodetect
-- which, to my mild surprise, was set to Universal. When I reset this to Off, the problem started occurring.

Normally, I run with Autodetect off, but I remember turning it on a few days ago to test something else. I must have been in a similar situation when I was testing back in May.

Note that changing the Autodetect setting while viewing a message messes up the message appearance, but in a different way than this bug -- this symptom is bug 236872.

Revision history for this message
In , Mcow (mcow) wrote :

*** Bug 358253 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Benjavalero-yahoo (benjavalero-yahoo) wrote :

I have reproduced this bug with Thunnderbird 2.0 beta 2, with the encodings ISO-8859-1 and Windows-1252 on Linux-i386.

Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

*** Bug 377183 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

*** Bug 392643 has been marked as a duplicate of this bug. ***

Revision history for this message
In , David-ascher (david-ascher) wrote :

Assuming it still occurs, it should get fixed, but it doesn't sound like a blocker.

Revision history for this message
In , Davian818 (davian818) wrote :

Still exists in:

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b5pre) Gecko/20090503 Shredder/3.0b3pre

Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

*** Bug 494264 has been marked as a duplicate of this bug. ***

Revision history for this message
scamp (telbert) wrote :

Binary package hint: thunderbird

steps to reproduce:
- View -> Layout -> Classic View
- View -> Layout -> enable Message Pane
- select a message in which you can see special characters (e.g. ö,ä,ü...)
- switch the layout, e.g. View -> Layout -> Wide View

now you can see, that the special characters are displayed wrong (e.g. ö instead of ö)

If you select another mail and select this mail again, the characters are displayed without problems!

I think there is a problem with the encoding after switching the layout

Regards
scamp

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
Package: mozilla-thunderbird 2.0.0.21+nobinonly-0ubuntu1.9.04.1
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: thunderbird
Uname: Linux 2.6.28-11-generic x86_64

Revision history for this message
scamp (telbert) wrote :
Revision history for this message
Christian Aasan (christian-aasan) wrote :

Hi!

I can confirm this bug, and I also found an upstream bug report for it.

Regards
Chris

Changed in thunderbird (Ubuntu):
status: New → Confirmed
Changed in thunderbird:
status: Unknown → Confirmed
Revision history for this message
In , Ulysse (ulysse) wrote :

*** Bug 569233 has been marked as a duplicate of this bug. ***

Changed in thunderbird:
importance: Unknown → Low
Revision history for this message
In , TienFu Chen (ctf) wrote :

Still exists in:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7
(in ubuntu 10.10)

Revision history for this message
In , Sergiy-bogdancev (sergiy-bogdancev) wrote :

User OKyJIucT reports that this bug still exists in:
Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

Revision history for this message
In , Ulysse (ulysse) wrote :

*** Bug 654406 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Jes-carlskov (jes-carlskov) wrote :

Still exists in Thunderbird 14 beta (downloaded 2012-06-21).

The bug occurs both when switch from classic to vertical layout and vice versa.

Revision history for this message
In , Bugzilla2007 (bugzilla2007) wrote :

*** Bug 520953 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Bugzilla2007 (bugzilla2007) wrote :

*** Bug 767031 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Bugzilla2007 (bugzilla2007) wrote :

Search for related bugs or duplicates (bravely assuming they mention "Layout" in bug summary):

:thun,mail [layout
https://bugzilla.mozilla.org/buglist.cgi?quicksearch=%3Athun%2Cmail%20[layout

Revision history for this message
In , Bugzilla2007 (bugzilla2007) wrote :

See also:

Bug 718306 - Changing layout breaks with Mail Summaries and/or Conversations
Bug 531397 - switching Layout modes breaks feed content display entirely until restart

Revision history for this message
In , Bugzilla2007 (bugzilla2007) wrote :

Alta88 claims in Bug 531397 Comment 12 that his MoreLayoutsforThunderbird addon (1)
fixes many bugs that occur when changing View > Layout.

Maybe he can help to fix this longstanding bug (15 duplicates since 2004), or somebody can get some coding inspiration from his addon.

(1) https://addons.mozilla.org/de/thunderbird/addon/morelayouts/

Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

*** Bug 1120597 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

*** Bug 1128148 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Alta88-t (alta88-t) wrote :

*** Bug 876532 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Alta88-t (alta88-t) wrote :

in the course of updating MoreLayouts, this (and some other layout bugs) has been fixed there:
http://morelayoutsforthunderbird.mozdev.org/

the solution is quite simple; a 0 setTimeout on the reloadMessage() call in updateMailPaneConfig will do it.

Revision history for this message
In , Infofrommozilla (infofrommozilla) wrote :

(In reply to alta88 from comment #41)

> the solution is quite simple; a 0 setTimeout on the reloadMessage() call in
> updateMailPaneConfig will do it.

I can confirm that it works.

Is there a reason not to do it that way?
Or why is there no patch yet?
Should I upload a one?

Revision history for this message
In , Jorgk-bmo (jorgk-bmo) wrote :

(In reply to Alfred Peters III from comment #42)
> I can confirm that it works.
Then you must have a patch ;-)

> Should I upload a one?
Please do, r?alta88, then see what happens ;-)

Revision history for this message
In , Infofrommozilla (infofrommozilla) wrote :

Created attachment 9004091
When changing layout, display the message asynchronously.

Revision history for this message
In , Mkmelin+mozilla (mkmelin+mozilla) wrote :

Comment on attachment 9004091
When changing layout, display the message asynchronously.

Review of attachment 9004091:
-----------------------------------------------------------------

::: mail/base/content/msgMail3PaneWindow.js
@@ +240,5 @@
> messenger.setWindow(null, null);
> messenger.setWindow(window, msgWindow);
> + setTimeout(function DelayReloadMessage() {
> + ReloadMessage();
> + }, 0);

nit: no need to name the function. Also, 0 is the default so not needed.

Anyway, it may or may not fix the issue depending on your system. So a bit of a hack papering over the real problem.
If we do take it, add a comment to explain why it's there.

Revision history for this message
In , Alta88-t (alta88-t) wrote :

(In reply to Alfred Peters III from comment #42)
> (In reply to alta88 from comment #41)
>
> Is there a reason not to do it that way?

everyone should use the extension, how is Tb usable without wide thread view ;) which was attempted and abandoned in bug 215661.

back to the issue: although the setTimeout on ReloadMessage() works, it's not the best way and not how i do it any longer in the extension. the document in messagepane is not destroyed and therefore does not need to be reloaded/reread. if you install the extension in Tb52 you will note how smooth and jank free the layout changes are.

to do this correctly here, try this in place of the ReloadMessage() line and make sure to test both single and multimessage (conversations):

// For some layout changes, the doc in messagepane or multimessage is
// not destroyed, so don't create it again.
let browser = getBrowser();
if (browser && browser.contentDocument &&
    browser.contentDocument.URL == "about:blank") {
  if (!gMessageDisplay.singleMessageDisplay)
    gSummaryFrameManager.pendingOrLoadedUrl = "about:blank";

  gMessageDisplay.makeInactive();
  setTimeout(() => {gFolderDisplay.makeActive();});
}

Revision history for this message
In , B-schwarze (b-schwarze) wrote :

*** This bug has been marked as a duplicate of bug 1287336 ***

Revision history for this message
In , Alta88-t (alta88-t) wrote :

*** Bug 1509812 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Jorgk-bmo (jorgk-bmo) wrote :

This is not a duplicate of bug 1287336 as far as I can see. Unlike bug 1287336, this is 100% reproducible switching to another layout when a UTF-8 message is on the screen.

Revision history for this message
In , Jorgk-bmo (jorgk-bmo) wrote :

Created attachment 9118286
Bug265393.patch

Let's take this now to fix this annoying bug that's been around for 15 years :-( - Rebased and with comments addressed. Checked linting to avoid surprises.

Revision history for this message
In , Pulsebot (pulsebot) wrote :

Pushed by <email address hidden>:
https://hg.mozilla.org/comm-central/rev/11ff429ff9d1
When changing layout, reload the message via setTimeout(). r=jorgk DONTBUILD

Revision history for this message
In , Jorgk-bmo (jorgk-bmo) wrote :

Comment on attachment 9118286
Bug265393.patch

Will there be a TB 72 beta 3?

Revision history for this message
In , 1-geoff (1-geoff) wrote :
Changed in thunderbird:
status: Confirmed → Fix Released
Revision history for this message
In , 1-geoff (1-geoff) wrote :
Revision history for this message
In , Vseerror (vseerror) wrote :

*** Bug 1485469 has been marked as a duplicate of this bug. ***

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.