public static function normalizePercentReal($hexchr)
    {
        // 6.2.2.1.  Case Normalization
        // Percent-encoded characters must use uppercase letters.
        // 6.2.2.2.  Percent-Encoding Normalization
        $unreserved =   'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
                        'abcdefghijklmnopqrstuvwxyz'.
                        '-._~';

        $chr = chr(hexdec($hexchr[1]));
        if (strpos($unreserved, $chr) !== false) {
            return $chr;
        }
        return '%' . strtoupper($hexchr[1]);
    }