escape database name when converting to UTF-8 as it may contain a dash or similar character that needs escaping, fixes #1172

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>