Fix text encoding errors.

But only for UTF8 & windows-1252
Use the name of the project, not the name relative to root_path.
Merge pull request #2 from Qalthos/python-rewrite

Python rewrite, take 2