punycode_to_string()

Decodes input string from punycode form. The string shouldn't contain the initial xn--, and must contain only ASCII characters.

Syntax

punycode_to_string('input_string')

Learn more about syntax conventions.

Parameters

Name Type Required Description
input_string string ✔️ A string to be decoded from punycode form. The function accepts one string argument.

Returns

  • Returns a string that represents the original, decoded string.
  • Returns an empty result if decoding failed.

Example

 print decoded = punycode_to_string('acadmie-franaise-npb1a')
decoded
académie-française