Codeigniter allows special characters (for example: ä, é, î, ø, ù) in uri

how to allow special characters (for example: ä, é, î, ø, ù) in uri in codeigniter

+3
source share
2 answers

You cannot use special characters directly in URLs.

RFC 1738 contains the following paragraph:

URLs are written only with graphics printed characters US-ASCII encoded character set.

The list of characters in the US-ASCII character set can be found at http://www.columbia.edu/kermit/ascii.html .

, , , "=" "&". . ( , US-ASCII) %, .

codeigniter urlencode(). , (urlencode (http://test.com/ä)), http://test.com/%E4, URL.

, urldecode(), :

echo 'The character is: ' . urldecode($this->uri->segment(2));

, .

Dan

+6

/ config.php:

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

+3