set locales to utf-8
fixed encoding problem; better exception handling