Back to PunycodeHelper class

Method toPunycode

public static string
toPunycode
(mixed $utfString)
Transforms a UTF-8 string to a Punycode string
Parameters
  • string $utfString The UTF-8 string to transform
Returns
  • string The punycode string
Since
  • 3.1.2

Method toPunycode - Source code

/**
 * Transforms a UTF-8 string to a Punycode string
 *
 * @param   string  $utfString  The UTF-8 string to transform
 *
 * @return  string  The punycode string
 *
 * @since   3.1.2
 */
public static function toPunycode($utfString)
{
    return (new ToIdn())->convert($utfString);
}