Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

return: integer
param: string $char

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

return: string
param: integer $code