Fix an unicode issue while syncing document filename and title.

Fixes #584.