CJ001 / google-shared-contacts-client

Automatically exported from code.google.com/p/google-shared-contacts-client
Apache License 2.0
0 stars 0 forks source link

UnicodeDecodeError #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Exported csv from Outlook 2007.
2. Tried to import into Shared Contacts.
3. Get unicode error:
<snipped other "File" lines>
  File "/path.../contacts/google-shared-contacts-client/atom/__init__.py",
line 185, in _AddMembersToElementTree
    tree.text = self.text.decode(MEMBER_STRING_ENCODING)
  File "encodings/utf_8.py", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode byte 0x91 in position 330:
unexpected code byte

What is the expected output? What do you see instead?
Successful import of contacts, but saw the error message instead.  No
contacts were imported.  Test import with sample .csv and it worked fine.     

What version of the product are you using? On what operating system?
1.0.1 on Ubuntu Gutsy 7.10.

Please provide any additional information below.
Thanks!
Pete

Original issue reported on code.google.com by pjala...@gmail.com on 22 Apr 2009 at 9:45

GoogleCodeExporter commented 8 years ago
I seem to have fixed the unicode problem by importing my outlook.csv file into
OpenOffice Calc, and then exporting again to a new file as utf8.  I then tried 
to use
the google-shared-contacts-client to import the new .csv file, and got this 
error:
<snipping preceding lines>
  File "/path.../google-shared-contacts-client/atom/__init__.py", line 97, in
CreateClassFromXMLString
    tree = ElementTree.fromstring(xml_string)
  File "<string>", line 85, in XML
SyntaxError: syntax error: line 1, column 0

About 95 contacts were apparently successfully imported (as defined by being 
able to
--export them back down) before this error was hit. I'm not smart enough to 
analyze
the contacts records to see anything wrong near the last imported record.  Any
suggestions on how to work through this block?  Thanks! Pete

Original comment by pjala...@gmail.com on 22 Apr 2009 at 10:32

GoogleCodeExporter commented 8 years ago
umlauts caused problems for me. By removing them (e.g. å,ä,ö) import worked
successfully. 

Original comment by kari.ran...@gmail.com on 25 Jun 2009 at 12:33

GoogleCodeExporter commented 8 years ago
After testing It seems to work correctly with a utf-8 CSV file. I will mark 
this as Working 
as intended for now.

If you are experiencing the issue again please attach a CSV file that provokes 
the issue 
so we can investigate further.

Original comment by api.nico...@gtempaccount.com on 20 Jan 2010 at 3:22

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I am experiencing again, I got the following error
-----------------------------------------------------------------
### Importing contacts/profiles CSV file: test.csv
    1) 娈垫檽闆?- xiaoxiong.duan@zztecs.com [add]
Skipping query pass: nothing to update or delete
Mutating 1 contact(s)...
Traceback (most recent call last):
  File "shared_contacts_profiles.py", line 1029, in <module>
  File "shared_contacts_profiles.py", line 1014, in main
  File "shared_contacts_profiles.py", line 461, in ImportMsOutlookCsv
  File "shared_contacts_profiles.py", line 281, in WriteCsvRow
  File "csv.pyc", line 124, in writerow
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: 
ordinal 
not in range(128)
---------------------------------------------------------------
Here is my utf-8 csv file. I put a Chinese name in this file with utf8 encoding

Original comment by macd...@gmail.com on 23 Mar 2010 at 8:13

Attachments: