private void TryDecoder() { if (_encodingService.TryDecodeSafe(_args.Value, _args.Encoding, out var decodedValue)) { Write(_args.Encoding, _args.Value, decodedValue, "Decoded"); } else { Write(_args.Encoding, _args.Value, 0, "Decoding (failed)"); } }
private void TryDecoder(EncodingType encodingType) { if (!_encodingPairingService.TryGetPartner(encodingType, out var pairedEncoding)) { return; } if (!_encodingService.TryDecodeSafe(_args.Value, encodingType, out var decodedValue)) { return; } var pairedEncodedValue = _encodingService.EncodeSafe(decodedValue, pairedEncoding); _console.Write($"{_args.Value} ({encodingType}) -> {decodedValue} (decoded) -> {pairedEncodedValue} ({pairedEncoding})"); }