Sample code for 30+ languages & platforms
Dart

URL Encoding and Decoding

Demonstrates URL encoding/decoding using the HTTP convenience methods.

Chilkat Dart Downloads

Dart
import 'package:chilkat/chilkat.dart';

void main() {
  final http = CkHttp();

  final s = 'Hello World! 100% sure.';

  final encoded = http.urlEncode(s);
  print('URL encoded: $encoded');

  // Space → %20
  // ! → %21
  // % → %25

  final decoded = http.urlDecode(encoded);
  print('URL decoded: $decoded');

  // Output:

  // URL encoded: Hello%20World%21%20100%25%20sure.
  // URL decoded: Hello World! 100% sure.
}