Second update

Changed the written check it submission.id instead of the permalink due to encoding problems. Another way do solving this would be to write- link_en = link.encode('ascii', 'replace').
Whoops
Updated to fix encoding problems.

It now does the check on submission.id instead of the permalink. The id cannot contain any non-ASCII characters.
Merge pull request #2 from Healdb/master

Updated to fix encoding problems.