Use ENCODING 'UNICODE' when creating the database

Fix some weird exceptions
Use UNICODE in template1