Runs URL decode function with arguments.
@return
508564
public static String urlDecode(String content, Charset charset, TestContext context) {
        return new UrlDecodeFunction().execute(Arrays.asList(content, charset.displayName()), context);
    }
609024
@SuppressWarnings("checkstyle:abbreviationaswordinname")
    public URL constructURL() {
        String params = encodeQueryParams();
        String stringUri = url;

        if (params.length() > 0) {
            stringUri += "?" + params;
        }

        try {
            URI uri = new URI(stringUri);
            return uri.toURL();
        } catch (final URISyntaxException e) {
            throw new ApiException("Bad URI: " + stringUri, e);
        } catch (final MalformedURLException e) {
            throw new ApiException("Bad URL: " + stringUri, e);
        }
    }
1292539
public static String decode(String str) {
    if (str != null) {
      try {
        return URLDecoder.decode(str, UTF_8.name());
      } catch (UnsupportedEncodingException e) {
        throw new RuntimeException("JVM must support UTF-8", e);
      }
    }
    return null;
  }
441034
public static String decode(final String encoded, final String charset) 
        throws UnsupportedEncodingException {
        try {
            return s_codec.decode(encoded, charset);
        } catch (DecoderException e) {
            throw new IllegalStateException(Bundle.getErrorString("URLCodec_decodeException", new String[] {e.getMessage()}), e);
        }
    }
643250
def run_rules(url, rules)
      str = url.to_s
      return str if rules.nil?
      rules.each do |rule|
        case rule
        when 'noproto'
          str = str.gsub(%r{^https?://}, '')
        when 'nossl', 'http'
          str = str.gsub(%r{^https://}, 'http://')
        when 'ssl', 'https'
          str = str.gsub(%r{^http://}, 'https://')
        when 'base32'
          str = Base32.encode(str).to_s
        when 'base64'
          str = Base64.encode64(str).delete("\n")
        when 'md4'
          str = OpenSSL::Digest::MD4.hexdigest(str)
        when 'md5'
          md5 = Digest::MD5.new
          md5.update str
          str = md5.hexdigest
        when 'sha1'
          str = Digest::SHA1.hexdigest(str)
        when 'reverse'
          str = str.reverse
        when 'upcase'
          str = str.upcase
        when 'downcase'
          str = str.downcase
        when 'rot13'
          str = str.tr('A-Za-z', 'N-ZA-Mn-za-m')
        when 'urlencode'
          str = CGI.escape(str).gsub(/\+/, '%20')
        when 'urldecode'
          str = CGI.unescape(str)
        when 'append-hash'
          str = "#{str}##{rand(36**6).to_s(36)}"
        when 'append-method-get'
          separator = str.include?('?') ? '&' : '?'
          str = "#{str}#{separator}method=get&_method=get"
        else
          logger.warn("Unknown rule: #{rule}")
        end
      end
      str
    end
905991
private String generateReqParams() throws UnsupportedEncodingException {

        String params = "";
        if ((m_parameterMap != null) && !m_parameterMap.isEmpty()) {
            for (Entry<String, String[]> paramEntry : m_parameterMap.entrySet()) {
                if (paramEntry.getValue() != null) {
                    for (int i = 0; i < paramEntry.getValue().length; i++) {
                        params += "&"
                            + paramEntry.getKey()
                            + "="
                            + URLEncoder.encode(paramEntry.getValue()[i], "UTF-8");
                    }
                }
            }
            params = "?" + params.substring(1);
        }
        return params;
    }
1351968
public static String urlEncode(String str) throws UnsupportedEncodingException {
    // Preserve original behavior that passing null for an object id will lead
    // to us actually making a request to /v1/foo/null
    if (str == null) {
      return null;
    } else {
      // Don't use strict form encoding by changing the square bracket control
      // characters back to their literals. This is fine by the server, and
      // makes these parameter strings easier to read.
      return URLEncoder.encode(str, CHARSET)
        .replaceAll("%5B", "[")
        .replaceAll("%5D", "]");
    }
  }
219646
public static String decode(String encoded) {
    try {
      return URLDecoder.decode(encoded, ENCODING_FOR_URL);
    } catch (UnsupportedEncodingException e) {
      throw new IllegalStateException(
          "Unable to decode URL entry via " + ENCODING_FOR_URL + ". This should not happen", e);
    }
  }
153468
static String urlencode(final String s) {
		try {
			return URLEncoder.encode(s, CHARSET_NAME);
		} catch (UnsupportedEncodingException e) {
			throw new RuntimeException(e);
		}
	}
938545
public static String urlEncode(String url, Pattern unsafe, Charset charset) {
        StringBuffer sb = new StringBuffer(url.length());
        Matcher matcher = unsafe.matcher(url);
        while (matcher.find()) {
            String str = matcher.group(0);
            byte[] bytes = str.getBytes(charset);
            StringBuilder escaped = new StringBuilder(str.length() * 3);

            for (byte aByte : bytes) {
                escaped.append('%');
                char ch = Character.forDigit((aByte >> 4) & 0xF, 16);
                escaped.append(ch);
                ch = Character.forDigit(aByte & 0xF, 16);
                escaped.append(ch);
            }

            matcher.appendReplacement(sb, Matcher.quoteReplacement(escaped.toString().toLowerCase()));
        }

        matcher.appendTail(sb);
        return sb.toString();
    }
780468
private function decodeRequestUri()
    {
		foreach ($this->routes['general'] as $p => $callable)
		{
			if (preg_match('|^'.$p.'|', $_SERVER['REQUEST_URI'], $matches)) {
				list($url) = explode('?',$_SERVER['REQUEST_URI']);
				$this->_unparsedUrl = trim(str_replace($matches[0], '', $url),'/');
				$res = $callable($matches);
				if ($res) die();
			}
			/*
			if (substr($_SERVER['REQUEST_URI'],0,strlen($p)) == $p )
			{
				list($url) = explode('?',$_SERVER['REQUEST_URI']);
				$this->_unparsedUrl = trim(str_replace($p, '', $url),'/');
				$res = $callable();
				if ($res) die();
			}
			*/
		}		
		
		$this->_unparsedUrl = null;
		
        $this->_catalog = $this->getServer();
        $this->_urlPath[] = $this->_catalog;
        if (!$this->_catalog) return;
        list($url) = explode('?',$_SERVER['REQUEST_URI']);
        $url = trim($url, '/');
    	$dir = explode("/", $url);
    	
		/*
    	if (sizeof($dir) && $dir[0] == PREVIEW_PREFIX) {
            array_shift($dir);
            $this->_previewMode = true;
        }
		*/

    	  while ($alias = array_shift($dir)) {
    	    try {
                $c = $this->_catalog->prototype->getChildByAlias($alias);
                $this->_catalog = $c;
                $this->_urlPath[] = $this->_catalog;
                $this->debug(DEBUG_COMMON, 'Catalog: '.$alias.'('.$c->id.')');
            } catch (\Exception $e) {
                array_unshift($dir, $alias);
                break;
            }
        }
        
        $this->_unparsedUrl = implode('/', $dir);
    }
795729
public static String urlDecode(final String value) {
        if (value == null) {
            return null;
        }

        try {
            return URLDecoder.decode(value, DEFAULT_ENCODING);

        } catch (UnsupportedEncodingException ex) {
            throw new RuntimeException(ex);
        }
    }
879526
public Object decode(Object o) {
        if (o == null) {
            return null;
        }
        return HtmlUtils.htmlUnescape(String.valueOf(o));
    }
863324
public Object parse(URL url, String charset) {
        return parseURL(url, null, charset);
    }
613578
public Object parse(URL url, Map params, String charset) {
        return parseURL(url, params, charset);
    }
1215962
public Map<String, List<String>> parameters() {
        if (params == null) {
            params = decodeParams(uri, pathEndIdx(), charset, maxParams);
        }
        return params;
    }
461788
private static String decodeHTMLEntities(String string) {
		if (string == null) {
			return null;
		}
		try {
			return URLDecoder.decode(string, Charset.defaultCharset().displayName());
		} catch (UnsupportedEncodingException exception) {
			return string;
		}
	}