---
name: "IDNA::Punycode"
section: "3pm"
platform: "linux"
package: "libidna-punycode-perl"
version: "1.100+dfsg-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/IDNA::Punycode"
---

# IDNA::Punycode(3pm)

DEPRECATED module for IDNA and Punyode

## NAME

IDNA::Punycode - DEPRECATED module for IDNA and Punyode

## DESCRIPTION

This module is deprecated.

Please use Net::IDN::Encode to handle full domain names and Net::IDN::Punycode for raw *Punycode* encoding.

This module is provided for compatibility with earlier versions of `"IDNA::Punycode"`.

## FUNCTIONS

The following functions are imported by default. If you also `"use Net::IDN::Punycode"`, be sure to disable import from this module:

```
  use IDNA::Punycode();
```

- idn\_prefix($prefix)

  Sets `$IDNA::Punycode::PREFIX` to `$prefix`.

  **Do not use this function** in larger applications or environments in which multiple application share global variables (such as mod\_perl). Instead, set the variable locally:

  ```
    local $IDNA::Punycode::PREFIX = 'yo--';
  ```

- encode\_punycode($input)

  If `$IDNA::Punycode::PREFIX` is `''`, encodes `$input` with Punycode.

  If `$IDNA::Punycode::PREFIX` is not `''`, encodes `$input` with Punycode and adds the prefix if `$input` does contain non-base characters (i. e. characters above U+007F). If `$input` does not contain any non-base characters, it is returned as-is.

  This function does not do any string preparation as specified by *nameprep* or other *stringprep* profiles.  Use Net::IDN::Encode if you just want to convert a domain name.

  This function will croak on invalid input.

- decode\_punycode($input)

  If `$IDNA::Punycode::PREFIX` is `''`, decodes `$input` with Punycode.

  If `$IDNA::Punycode::PREFIX` is not `''`, checks whether `$input` starts with the prefix. If `$input` starts with the prefix, the prefix is removed and the remainder is decoded with Punycode. If `$input` does not start with the prefix, it is returned as-is.

  Of course, this function does not do any string preparation as specified by *nameprep* or other *stringprep* profiles (or some sort of de-preparation).

  This function will croak on invalid input.

## AUTHORS

Claus Faerber \<CFAERBER@cpan.org\>

Previous version written by Tatsuhiko Miyagawa \<miyagawa@bulknews.net\> and extended by Robert Urban \<urban@UNIX-Beratung.de\>.

## LICENSE

Copyright 2007-2010 Claus Faerber.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

## SEE ALSO

Encode, Net::IDN::Encode, Net::IDN::Punycode, RFC 3492 (\<http://www.ietf.org/rfc/rfc3492.txt\>)
