---
name: "Badger::Codec::URI"
section: "3pm"
platform: "linux"
package: "libbadger-perl"
version: "0.16-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Badger::Codec::URI"
---

# Badger::Codec::URI(3pm)

URI encode/decode

## NAME

Badger::Codec::URI - URI encode/decode

## SYNOPSIS

```
    use Badger::Codec::URI;
    my $codec   = Badger::Codec::URI->new();
    my $encoded = $codec->encode("Hello World!");
    my $decoded = $codec->decode($encoded);
```

## DESCRIPTION

This module implements a subclass of Badger::Codec for URI encoding and decoding.

## FUNCTIONS

### encode\_uri($data)

This function URI-encodes the `$data` passed as an argument.

### decode\_uri($data)

This function URI-decodes the `$data` passed as an argument.

## METHODS

### encode($data)

This method URI-encodes the data referenced by the first argument. It delegates to the **encode\_uri()** function.

```
    $encoded = Badger::Codec::URI->encode($data);
```

### decode($data)

This method decodes the encoded data passed as the first argument. It delegates to the **decode\_uri()** function.

```
    $decoded = Badger::Codec::URI->decode($encoded);
```

### encoder()

This method returns a reference to the **encode\_uri()** function.

### decoder()

This method returns a reference to the **decode\_uri()** function.

## AUTHOR

Andy Wardley \<http://wardley.org/\>

## COPYRIGHT

Copyright (C) 2008-2009 Andy Wardley. All rights reserved.

## SEE ALSO

Badger::Codecs, Badger::Codec
