Bug 202751 - [mail] Multi-lang text in Body is not printed
Summary: [mail] Multi-lang text in Body is not printed
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: evolution
Version: rawhide
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Matthew Barnes
QA Contact:
URL:
Whiteboard:
: 204451 (view as bug list)
Depends On:
Blocks: 208803
TreeView+ depends on / blocked
 
Reported: 2006-08-16 09:31 UTC by A S Alam
Modified: 2013-07-03 00:39 UTC (History)
3 users (show)

Fixed In Version: evolution-2.9.2-2.fc7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-11-13 15:41:13 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch to enable indic printing in ascii mails (4.36 KB, patch)
2006-09-13 12:16 UTC, Mayank Jain
no flags Details | Diff
Composer screenshot (60.28 KB, image/png)
2006-10-03 00:03 UTC, Matthew Barnes
no flags Details
Print Preview screenshot (29.19 KB, image/png)
2006-10-03 00:05 UTC, Matthew Barnes
no flags Details
wrong headers as created by this patch as compared to right headers (1.14 KB, text/plain)
2006-10-31 11:22 UTC, Mayank Jain
no flags Details
Modified patch (5.92 KB, patch)
2006-11-06 11:27 UTC, Mayank Jain
no flags Details | Diff
Updated patch, fixes memory leak of temp_composer and func declaration in header file. (7.03 KB, patch)
2006-11-07 06:54 UTC, Mayank Jain
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
GNOME Bugzilla 355766 0 None None None Never

Description A S Alam 2006-08-16 09:31:09 UTC
Description of problem:
when you wrote some other langauge (other than English) in message Body,
printout is empty, showing Nothing

Version-Release number of selected component (if applicable):
evolution-2.7.91-4

How reproducible:
Everytime, when you put multi-lang text in body

Steps to Reproduce:
1. Open Evolution ->Mail - New Mail
2. in body put some text from http://ja.wikipedia.org/ (copy and paste in
Subject/To Area)
3. Print the mail
  
Actual results:
Subject/To areas are printed properly, but Body is not printed

Expected results:
Mail body should print

Additional info:
tested with CJK/Indic languages

Comment 1 Mayank Jain 2006-09-02 13:06:49 UTC
Even the print preview does not works fine. It shows exactly the same output as
the printout.

Another anomaly I noticed in rawhide, that it was taking more than a minute to
generate the print preview.

Aman, can you please confirm this behaviour?

Thanks,
Mayank

Comment 2 Mayank Jain 2006-09-11 15:02:41 UTC
This is what i've found from my initial investigation

build_message from e-msg-composer.c is called to build the mail message which
can be printed.

For headers (to/bcc/from/subject), this build_message directly picks ups text
from the gtk widgets using...

return gtk_entry_get_text ((GtkEntry *) hdrs->priv->subject.entry);

However, it tries to find a charset & encoding combination based ont the
contents of text body through best_charset and best_encoding functions, which
goes haywire!

Comment 3 Mayank Jain 2006-09-12 07:20:50 UTC
*** Bug 204451 has been marked as a duplicate of this bug. ***

Comment 4 Mayank Jain 2006-09-12 07:22:04 UTC
Files/functions of interest...

$evo/plugins/print-message/print-message.c : org_gnome_print_message
 --> data->msg = e_msg_composer_get_message (composer, 1);

$evo/composer/e-msg-composer.c : e_msg_composer_get_message (EMsgComposer
*composer, gboolean save_html_object_data)
 --> return build_message (composer, save_html_object_data);

$evo/composer/e-msg-composer.c : build_message (EMsgComposer *composer, gboolean
save_html_object_data)
 --> if (p->mime_body) {

Comment 5 Mayank Jain 2006-09-13 12:16:43 UTC
Created attachment 136148 [details]
Patch to enable indic printing in ascii mails

Printing from HTML was getting done, So I formulated my solution on the same
approach.

Patch up for review :)

Comment 6 Mayank Jain 2006-09-13 12:38:47 UTC
Matthew, over to you... I've added the gnome bugzilla ID, lets see how the
review goes :)

Thanks,
Mayank

Comment 7 Mayank Jain 2006-09-25 09:03:42 UTC
Got the patch approved upstream :)
Thanks Srag!

Comment 8 Mayank Jain 2006-09-27 06:58:05 UTC
[from gnome bz]
 Comment #8 from Matthew Barnes    (points: 13)
2006-09-25 16:36 UTC [reply]

e_msg_composer_get_message_print() needs to be declared in e-msg-composer.h
since it's called from another module, otherwise it's going to fail my
-Werror-implicit-function-declaration test.  I'll take care of it.


Comment #9 from Matthew Barnes (points: 13)
2006-09-25 16:50 UTC [reply]

Mayank,

e_msg_composer_get_message_print() takes a boolean argument named
"save_html_object_data" but doesn't do anything with it.

But it calls:

   msg = build_message (composer, TRUE);

where the second argument of build_message() is also a boolean argument named
"save_html_object_data".  Should it be passing the flag along?  If not, can we
drop the unnecessary boolean argument?

[/from gnome bz]



Hi Matthew,

I agree that what you are saying is true. I might have kept
"save_html_object_data" just to keep the new call consistant with the old one.
If removing this bool variable has no effect, please go ahead.

Thanks for pointing out this mistake, i'll be more carefull the next time.

Please upload the new patch too.

:)
Mayank

Comment 9 Matthew Barnes 2006-10-02 23:59:30 UTC
Mayank, I think I'm still seeing the problem even with your patch applied, but
I'm not sure I'm testing this correctly.  I also seem to be missing some fonts.
 Here's some screenshots of what I'm getting.

Comment 10 Matthew Barnes 2006-10-03 00:03:33 UTC
Created attachment 137611 [details]
Composer screenshot

Comment 11 Matthew Barnes 2006-10-03 00:05:00 UTC
Created attachment 137612 [details]
Print Preview screenshot

Comment 12 Mayank Jain 2006-10-03 05:38:07 UTC
Hi Matthew,

#10 is because of fonts & #11 *might* be because of fonts as well. 
Okay, follow this test case...

1) yum install fonts-hindi
2) Copy & paste some hindi text from http://hi.wikipedia.com
3) Test print/print-preview functionality.

Thanks,
Mayank

Comment 13 Leon Ho 2006-10-05 07:26:41 UTC
Re: Comment #5 
Mayank, This bug is on multi-lang text printing, is the patch applicable for
this problem?

Comment 14 Mayank Jain 2006-10-05 07:31:29 UTC
Yup, I yet again tested the patch with hindi+japanese text.
Print & print-preview both work.

Comment 15 Matthew Barnes 2006-10-10 17:21:38 UTC
Mayank, please have a look at my revised patch in the upstream bug.
Your solution seems to be working for me now.

Comment 16 Mayank Jain 2006-10-31 11:21:09 UTC
From Matthew Barnes (mbarnes) 

The patch does fix the reported problem, but it also causes Evolution to send
all email with both text/plain and text/html content, regardless of whether HTML
has been selected in the composer.



Comment 17 Mayank Jain 2006-10-31 11:22:12 UTC
Created attachment 139833 [details]
wrong headers as created by this patch as compared to right headers

Comment 18 Mayank Jain 2006-11-06 11:27:08 UTC
Created attachment 140449 [details]
Modified patch

Comment 19 Mayank Jain 2006-11-07 06:54:54 UTC
Created attachment 140540 [details]
Updated patch, fixes memory leak of temp_composer and func declaration in header file.

Comment 20 Matthew Barnes 2006-11-07 20:04:47 UTC
Thanks, Mayank.

I tidied up the logic a bit and verified that the reported problem as well as
the previous side-effects are fixed.  I'll submit a new patch upstream.

Fixed in evolution-2.9.2-2.fc7.

Comment 21 Mayank Jain 2006-11-08 07:22:54 UTC
Thanks Matthew :)

Comment 22 Matthew Barnes 2006-11-13 15:41:13 UTC
Bug #208803 (for RHEL-5) was verified and resolved with the same patch, so I'm
resolving this bug as well.  Feel free to re-open it if you still encounter the
problem or any of the documented side-effects from previous attempts.


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