glwu / android-sms

Automatically exported from code.google.com/p/android-sms
0 stars 0 forks source link

non-English contact name is not encoded correctly in from or to field #41

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. send or receive sms from a friend whose name is Chinese in Google contact
2. backup sms
3. check gmail

What is the expected output? What do you see instead?
  I expect the Chinese name of this friend is shown as sender or reciver.
However, it's empty string. See attached screenshot.

What version of the product are you using? On what operating system?
  This bug is newly introduced in version 1.1.0, previous version works fine.

Please provide any additional information below.
  Using attached screenshot as example. I use the "Show original" function
to find out the source.
  The sender field is displayed as following in version 1.0:
        From: 宋涛 <blahblahblah@gmail.com>
  It becomes following string in version 1.1.0
        From: =?UTF-8?B?IuWui+a2myIgPG5pY2V0b3dlckBnbWFpbC5jb20+?=
  I did not check the encoding, but I think only name 宋涛 should be
encoded, instead whole from field.

I hope this information is helpful, please let me know if you want more
details.

Original issue reported on code.google.com by carlos.z...@gmail.com on 25 Aug 2009 at 10:52

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by chstu...@gmail.com on 26 Aug 2009 at 10:57

GoogleCodeExporter commented 9 years ago
This problems also occurs if the contact's name contains accented characters 
like é. 

Original comment by johan.ap...@gmail.com on 26 Aug 2009 at 11:22

GoogleCodeExporter commented 9 years ago
Issue 44 has been merged into this issue.

Original comment by chstu...@gmail.com on 9 Sep 2009 at 10:32

GoogleCodeExporter commented 9 years ago
same issue with contacts containing the danish chars æ,ø,å (Å,Ø,Æ)

these sms'es show up as unknow in gmail :)

Original comment by xano...@gmail.com on 17 Sep 2009 at 9:59

GoogleCodeExporter commented 9 years ago
I also have the same problem...
In Portuguese many contact names have special characters and they appears as 
unknown
in gmail.

Original comment by be...@catus.net on 22 Sep 2009 at 2:22

GoogleCodeExporter commented 9 years ago

Original comment by chstu...@gmail.com on 17 Nov 2009 at 1:07

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi! Any update on this fix?
Would really be great to have this working! :-)

Original comment by pssss...@gmail.com on 25 Jan 2010 at 9:12

GoogleCodeExporter commented 9 years ago
Hi, any updates?

I just built an apk with a hack fix on this issue: Encode the name before 
constructing the 
Address object. I also added one more option in advance setting to display user 
name. It 
works well for me!

I attached it here for any one who couldn't wait for a real fix, but I don't 
undertake any 
potential issues due to this apk file. Looking forward to the real fix :-)

Original comment by zhouguih...@gmail.com on 14 Feb 2010 at 7:13

Attachments:

GoogleCodeExporter commented 9 years ago
@zhouguih...

Hi, could you submit your code changes to the repository?

Original comment by XuJiy...@gmail.com on 22 Feb 2010 at 7:52

GoogleCodeExporter commented 9 years ago
I don't have submit permission for this project. @chstude, my workaound is just 
one-
line code change, could you apply this fix first? Or do you have plan to fix 
the 
MimeMessage class?

Original comment by zhouguih...@gmail.com on 22 Feb 2010 at 8:24

GoogleCodeExporter commented 9 years ago
@zhouguih..., thanks for the tips. I made following changes to the code, and it 
works 
for me so far.

Index: android-client/src/tv/studer/smssync/CursorToMessage.java
===================================================================
--- android-client/src/tv/studer/smssync/CursorToMessage.java   (revision 65)
+++ android-client/src/tv/studer/smssync/CursorToMessage.java   (working copy)
@@ -36,6 +36,7 @@
 import com.android.email.mail.Message.RecipientType;
 import com.android.email.mail.internet.MimeMessage;
 import com.android.email.mail.internet.TextBody;
+import org.apache.james.mime4j.codec.EncoderUtil;

 public class CursorToMessage {

@@ -193,7 +194,7 @@
                 PersonRecord record = new PersonRecord();
                 record._id = String.valueOf(personId);
                 record.name = name;
-                record.address = new Address(primaryEmail, name);
+                record.address = new Address(primaryEmail, 
EncoderUtil.encodeAddressDisplayName(name));

                 mPeopleCache.put(address, record);
             } else {

Original comment by XuJiy...@gmail.com on 24 Feb 2010 at 2:42

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi XuJiyong

Thanks for your patch. I'll add it to the next release assuming you're fine 
with releasing 
it under the Apache 2 license.

Original comment by chstu...@gmail.com on 20 Mar 2010 at 1:34

GoogleCodeExporter commented 9 years ago
I'm fine with it. :) 

Original comment by XuJiy...@gmail.com on 20 Mar 2010 at 2:32

GoogleCodeExporter commented 9 years ago
Hi! Any plan with the new release?
Would be great to get this fixed.
Thanks!

Original comment by pssss...@gmail.com on 27 Apr 2010 at 7:06

GoogleCodeExporter commented 9 years ago
please release the fix!

Original comment by dablan...@gmail.com on 21 May 2010 at 8:26

GoogleCodeExporter commented 9 years ago
I have the same problem. Any contact containing non-ASCII character is 
displayed as (unknown) on gmail mailbox. Solution can be using sender/reciever 
as UTF-8 encoded strings. Hope to Android has some inbuild support for unicode 
strings.

Original comment by p...@kristof.cz on 21 Dec 2010 at 9:50

GoogleCodeExporter commented 9 years ago
SMS Backup + (https://github.com/jberkel/sms-backup-plus/#readme) is a good 
alternative. It does non-ASCII just fine. It is a fork of the original SMS 
Backup application.

Original comment by wou...@horre.be on 21 Dec 2010 at 9:57

GoogleCodeExporter commented 9 years ago
I've switched to SMS Backup + for this one reason.

Original comment by reukiodo on 21 Dec 2010 at 8:49