cli: print_api_result: add/use new encoding option