server: Improve error message

Inform about the charset when non-UTF-8.

(cherry picked from commit d74a7267dd9ad1b61da2ce7182584afe381009a1)