encode one way for CLI, encode another for GUI (#141)