Requests_IDNAEncoder::digit_to_char() WordPress Method

This is the Requests_IDNAEncoder::digit_to_char() method. This method is used to convert a digit from its ASCII value to its Unicode value. This is used to convert IDNA-encoded domain names to their punycode representation.

Requests_IDNAEncoder::digit_to_char( int $digit ) #

Convert a digit to its respective character


Description

Top ↑

See also


Top ↑

Parameters

$digit

(int)(Required)Digit in the range 0-35


Top ↑

Return

(string) Single character corresponding to digit


Top ↑

Source

File: wp-includes/Requests/IDNAEncoder.php

	protected static function digit_to_char($digit) {
		// @codeCoverageIgnoreStart
		// As far as I know, this never happens, but still good to be sure.
		if ($digit < 0 || $digit > 35) {
			throw new Requests_Exception(sprintf('Invalid digit %d', $digit), 'idna.invalid_digit', $digit);
		}
		// @codeCoverageIgnoreEnd
		$digits = 'abcdefghijklmnopqrstuvwxyz0123456789';
		return substr($digits, $digit, 1);
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.