bugfix: special characters not transmitted

Whitespace and enter character require some special handling which
was defective in some cases. Better string enclosing seems to fix
the problem.