Write in a file with Python 3 & unicode

Your symptoms look like regular a "UTF-8 as latin-1" problem.

Have you checked what encoding is used on the software that you are using to view that file? I'd say that the problem is not necessarily in your python code but in the viewer.

If you create a file with your example text Une déclaration à faire... using UTF-8 encoding and then read that file interpreting the contents using encoding ISO-8859-1 or windows-1252, then the result is shown as the output you described: Une déclaration à faire....

Also, in python 3 the default source encoding is UTF-8. http://www.python.org/dev/peps/pep-3120/