Set default encoding to UTF-8

Although everything would still default to UTF-8, the initial title of the pop-up in Preferences would show a wrong value.

Fixes #889.
Fix exception when renaming to empty string

Fixes #887.