karimsacre / 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

can not imoprt csv containing Chinese name #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I got the following error
-----------------------------------------------------------------
Outlook CSV file to import: test.csv
Export as CSV to: test-out.csv
Domain: zznode.com
Administrator: xiaoxiong.duan@zznode.com
Password of xiaoxiong.duan@zznode.com: 

### 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)...
    1) 288a69560d1c2ac0 - 段晓雄 - xiaoxiong.duan@zztecs.com [add] OK 201: Created 
added as: 288a69560d1c2ac0
Skipping Profiles mutate pass: no Profiles to mutate
Contacts/Profiles added: 1/1 - updated: 0/0 - deleted: 0/0 - errors: 0
### Total contacts/profiles added: 1/1 - updated: 0/0 - deleted: 0/0 - errors: 
0 - 
ignored: 0
### Exporting contacts/profiles to CSV file: test-out.csv
Retrieving contacts... (0 retrieved so far)
All contacts retrieved: 18 total
Traceback (most recent call last):
  File "./shared_contacts_profiles.py", line 1029, in <module>
    main()
  File "./shared_contacts_profiles.py", line 1024, in main
    contacts_manager.ExportMsOutlookCsv(contact_entries, profile_entries, 
export_csv_file)
  File "./shared_contacts_profiles.py", line 502, in ExportMsOutlookCsv
    contact_entries))
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/csv.py",

line 150, in writerows
    return self.writer.writerows(rows)
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

Evironment:
Mac OSX 10.6.2
Python 2.6

Original issue reported on code.google.com by macd...@gmail.com on 26 Mar 2010 at 1:38

Attachments:

GoogleCodeExporter commented 8 years ago
Hi  macdoor,

We just released v1.1.2 which should take care of much encoding/decoding 
errors. It seems to work fine with the 
file you provided. Can you try it on large files and let us know?

Original comment by api.nico...@gtempaccount.com on 19 Apr 2010 at 3:47

GoogleCodeExporter commented 8 years ago
verified. it is okay now

Original comment by macd...@gmail.com on 20 Apr 2010 at 2:05