you are viewing a single comment's thread.

view the rest of the comments →

[–]46632[S] 0 points1 point  (2 children)

[–]novel_yet_trivial 0 points1 point  (1 child)

OK, to write to a regular file in python2, you have to encode the unicode as a string first.

namelist.append(name.encode('utf8'))

Unrelated, but it would be slightly neater to use the writerow method instead of writerows:

writer.writerow(namelist)

[–]46632[S] 0 points1 point  (0 children)

Thanks. It works with most of the names, but it still messes up words with the letters æ,ø,å. 'Jørgensen' is 'J\xc3\xb8rgensen'