Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Copyright 2014 TrueServer B.V. Copyright 2015-2017 Horde LLC (http://www.horde.org/) See the enclosed file LICENSE for license information (BSD). If you did not receive this file, see http://www.horde.org/licenses/bsd.

Author: Renan Gonçalves <renan.saddam@gmail.com>
Author: Michael Slusarz <slusarz@horde.org>
License: http://www.horde.org/licenses/bsd BSD
File Size: 354 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Horde_Idna_Punycode:: (9 methods):
  encode()
  _encodePart()
  decode()
  _decodePart()
  _calculateThreshold()
  _adapt()
  _codePoints()
  _charToCodePoint()
  _codePointToChar()


Class: Horde_Idna_Punycode  - X-Ref

Punycode implementation as described in RFC 3492.

Original code (v1.0.1; released under the MIT License):
https://github.com/true/php-punycode/

encode($input)   X-Ref
Encode a domain to its Punycode version.

param: string $input  Domain name in Unicde to be encoded.
return: string  Punycode representation in ASCII.

_encodePart($input)   X-Ref
Encode a part of a domain name, such as tld, to its Punycode version.

param: string $input  Part of a domain name.
return: string  Punycode representation of a domain part.

decode($input)   X-Ref
Decode a Punycode domain name to its Unicode counterpart.

param: string $input  Domain name in Punycode
return: string  Unicode domain name.

_decodePart($input)   X-Ref
Decode a part of domain name, such as tld.

param: string $input  Part of a domain name.
return: string  Unicode domain part.

_calculateThreshold($k, $bias)   X-Ref
Calculate the bias threshold to fall between TMIN and TMAX.

param: integer $k
param: integer $bias
return: integer

_adapt($delta, $numPoints, $firstTime)   X-Ref
Bias adaptation.

param: integer $delta
param: integer $numPoints
param: boolean $firstTime
return: integer

_codePoints($input)   X-Ref
List code points for a given input.

param: string $input
return: array  Multi-dimension array with basic, non-basic and

_charToCodePoint($char)   X-Ref
Convert a single or multi-byte character to its code point.

param: string $char
return: integer

_codePointToChar($code)   X-Ref
Convert a code point to its single or multi-byte character

param: integer $code
return: string