Bug 203058 - Non-ascii characters generate trash in address lists
Summary: Non-ascii characters generate trash in address lists
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: evolution-data-server
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Matthew Barnes
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 208805
TreeView+ depends on / blocked
 
Reported: 2006-08-18 04:09 UTC by Jong Bae KO
Modified: 2007-11-30 22:11 UTC (History)
3 users (show)

Fixed In Version: evolution-data-server-1.9.2-2.fc7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-11-08 17:39:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
before add to TO (91.80 KB, image/png)
2006-08-18 04:09 UTC, Jong Bae KO
no flags Details
after click Add button (88.76 KB, image/png)
2006-08-18 04:10 UTC, Jong Bae KO
no flags Details
Patch for solving problem related to i18n text in contacts (2.07 KB, patch)
2006-09-25 15:32 UTC, Mayank Jain
no flags Details | Diff
Patch for list preview (5.93 KB, patch)
2006-10-03 11:36 UTC, Mayank Jain
no flags Details | Diff
patch for enabling display of i18n mail ID's in the addressbook (11.17 KB, patch)
2006-10-06 07:53 UTC, Mayank Jain
no flags Details | Diff
new patch as per guidelines - for evo (11.18 KB, patch)
2006-10-06 08:47 UTC, Mayank Jain
no flags Details | Diff
Updated patch (11.13 KB, patch)
2006-10-09 06:33 UTC, Mayank Jain
no flags Details | Diff


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

Description Jong Bae KO 2006-08-18 04:09:45 UTC
Description of problem:
I can see the korean in the contact text box.
but when I add korean into TO, it shows Wrong words.

Version-Release number of selected component (if applicable):
evolution-2.7.4-4
scim-1.4.4-29.fc6
scim-hangul-0.2.2-6.fc6

How reproducible:
allways

Steps to Reproduce:
1. Make New mail and Click TO button
2. make korean contact like ê³ ì¢ë°°<jko>
3. click Add button
  
Actual results:
?UTF-8?Q?=EA=B3=A...

Expected results:
ê³ ì¢ë°° or ê³ ì¢ë°°<jko>

Additional info:

Comment 1 Jong Bae KO 2006-08-18 04:09:45 UTC
Created attachment 134422 [details]
before add to TO

Comment 2 Jong Bae KO 2006-08-18 04:10:28 UTC
Created attachment 134423 [details]
after click Add button

Comment 3 Mayank Jain 2006-09-14 09:43:48 UTC
> Steps to Reproduce:
> 1. Make New mail and Click TO button
> 2. make korean contact like ê³ ì¢ë°°<jko>
> 3. click Add button

Hi,

Is it reproducible with any korean input? I'm asking because I'm not able to add
your address as i dont have LDAP setup. Is there any other way to reproduce this
bug?

Thanks,
Mayank

Comment 4 Mayank Jain 2006-09-14 09:45:39 UTC
Can you please recheck this bug with evolution-2.8.0-1.fc6 or above versions &
report the findings?

Thanks,
Mayank

Comment 5 Mayank Jain 2006-09-14 10:04:07 UTC
Ok, verified, this bug is still there in evolution-2.8.0-1.fc6. Removing the
NEEDINFO flag. Re-assigning the bug to myself.

Comment 6 Mayank Jain 2006-09-14 10:05:43 UTC
Changing version to devel.

Comment 7 Jong Bae KO 2006-09-15 00:05:49 UTC
This bug is included CJK. I test with Korean, Chinese and Japanese on
evolution-2.8.0-1.fc6

Comment 8 Mayank Jain 2006-09-18 13:28:14 UTC
From initial investigation...

this is how the control moves
e-d-s -> add_destination (EDestinationStore *destination_store, EContact
*contact, gint email_n)

Comment 9 Mayank Jain 2006-09-19 05:25:17 UTC
Confirmed, this happens with indic contacts also.
Checked with a contact in hi_IN language.

Comment 10 Mayank Jain 2006-09-25 10:46:40 UTC
$e-d-s/libedataserverui/e-name-selector-dialog.c:transfer_button_clicked is used
to transfer contacts from source to destination

Comment 11 Mayank Jain 2006-09-25 11:29:07 UTC
$e-d-s/libedataserverui/e-name-selector-dialog.c:destination_column_formatter
might be one function to concentrate on.

Comment 12 Mayank Jain 2006-09-25 12:18:38 UTC
Exact reason of bug...

contact_column_formatter - does correct rendering because it generates the names
which are added to the GtkTreeView by using g_strdup_printf

destination_column_formatter - does NOT works because it generates the names
(which are added to destination GtkTreeView) bu using e_destination_get_address
function, which in turn uses camel_address_encode (or internet_encode) to mess
up the encoding of names.

Hence, IMHO this bug can be fixed from two viewpoints...

1) Either continue the method used in contact_column_formatter - ie, use
g_strdup_printf to create the addresses.
2) or modify Camel's internet_encode function to return with proper encoding &
hence a viable address which can be added to the destination box.

But since camel_address_encode looks like an overloaded function, i'd suggest
that following (1) would be a better option as just fixing internet_encode wont
help. All the overloader functions need to be fixed.

Besides, Camel is not in the scope of this bug.

**Changing component to evolution-data-server.

Comment 13 Mayank Jain 2006-09-25 12:27:55 UTC
The function that does the final blow... camel_header_encode_phrase

Comment 14 Mayank Jain 2006-09-25 15:32:11 UTC
Created attachment 137058 [details]
Patch for solving problem related to i18n text in contacts

I modelled destination_column_formatter on the basis of how
contact_column_formatter is implemented.

Comment 15 Mayank Jain 2006-09-25 15:34:04 UTC
Matthew, before actually building this patch into rawhide, can you please give
it a quick check... specially with actually sending an email on live internet.

Thanks,
Mayank

Comment 16 Mayank Jain 2006-09-25 15:35:38 UTC
Changed bug description to a more meaningfull heading.

Comment 17 Mayank Jain 2006-09-27 14:11:51 UTC
One straight forward way to solve this bug would have been to implement 

case EVC_ENCODING_QP:
			g_warning ("need to implement quoted printable decoding");
			break;

in function 
GList*
e_vcard_attribute_get_values_decoded (EVCardAttribute *attr)

Comment 18 Matthew Barnes 2006-09-27 17:32:29 UTC
Mayank, the patch produces this block of logic:

    if (e_destination_list_show_addresses (destination)) {
            const gchar *name;

            name      = e_destination_get_name (destination);

            string = g_strdup_printf ("%s", name ? name : "?");
    } else {
            string = g_strdup (e_destination_get_name (destination));
    }

Can this be simplified?  How important is the question mark when name is NULL?

Maybe something like:

    name = e_destination_get_name (destination);
    if (name == NULL && e_destination_list_show_addresses (destination))
            name = "?";
    string = g_strdup (name);


Comment 19 Mayank Jain 2006-09-28 07:56:18 UTC
Hi Matthew,

I just replicated the functionality of source_column_formatter (the function
above destination_column_formatter). 

I have no issues with either of them... but for the sake of consistancy, i'd
suggest that either both functions should be changed or both should be kept
same... or the different logic might confuse other developers.

Your pick Matthew... i'm just concerned with getting the bug fixed. :)
You are the maintainer... choose the best way :)

BTW... I think both code segments act seemingly in the same way. :) Nice finding!

Comment 20 Mayank Jain 2006-10-03 11:09:53 UTC
Matthew, this bug is related to different components.

The patch #14 is fro e-d-s
The next patch in #20 will be for evo
Then another one will be for evo.

Should we file new bugs for evo components?

As seen here... http://bugzilla.gnome.org/attachment.cgi?id=67834&action=view
The bug in "contact list selector" dialog box is from e-d-s
The bug in "List Preview" is for evo

Matthew... what say?

Comment 21 Mayank Jain 2006-10-03 11:36:13 UTC
Created attachment 137639 [details]
Patch for list preview

Patch as mentioned in #19, patch is for Evo

Comment 22 Mayank Jain 2006-10-03 11:52:28 UTC
> Patch as mentioned in #19, patch is for Evo

This line should be read as...

Patch as mentioned in #20, patch is for Evo


Comment 23 Mayank Jain 2006-10-06 07:53:44 UTC
Created attachment 137901 [details]
patch for enabling display of i18n mail ID's in the addressbook

This patch completely solves this bug.

Comment 24 Mayank Jain 2006-10-06 07:55:53 UTC
Over to you Matthew :)

Comment 25 Mayank Jain 2006-10-06 08:47:30 UTC
Created attachment 137905 [details]
new patch as per guidelines - for evo

patch for enabling display of i18n mail ID's in the addressbook

Comment 26 Mayank Jain 2006-10-09 06:33:14 UTC
Created attachment 138026 [details]
Updated patch

Comment 27 Matthew Barnes 2006-10-12 19:08:49 UTC
(In reply to comment #20)
> Should we file new bugs for evo components?

Yes, please move the Evolution patch to a new bug.  That way we can track it
easier for RHEL5.  Bug #208805 doesn't include the Evolution stuff.


Comment 28 Mayank Jain 2006-10-13 07:18:58 UTC
Bug 210606 - filed for evo.

Comment 29 Matthew Barnes 2006-10-13 11:57:22 UTC
Thanks Mayank.

Comment 30 Mayank Jain 2006-10-16 10:19:01 UTC
You are welcome Matthew :)

Comment 31 Matthew Barnes 2006-11-06 19:58:33 UTC
Mayank,

While looking over your patch some more, I noticed that e-vcard.c in
evolution-data-server might be a more appropriate place for your quoted
printable string decoder.

There's even some placeholders in the code to guide you:

        case EVC_ENCODING_QP:
                g_warning ("need to implement quoted printable decoding");
                break;


Comment 32 Mayank Jain 2006-11-07 10:22:31 UTC
Hi Matthew,

The patch in #14 solves this bug. I think this can be closed & that related to
evo can be continued in bug 210606.

Thanks,
Mayank


Comment 33 Matthew Barnes 2006-11-08 17:39:11 UTC
Right, I posted comment #31 to the wrong bug.  Actually I just noticed that you
had the same observation in comment #17.  D'oh!

Fixed in evolution-data-server-1.9.2-2.fc7.

Comment 34 Mayank Jain 2006-11-09 08:19:50 UTC
Thanks :)


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