Query from command line now decoded before used.
Add option to set output encoding, default to UTF-8