Welcome Guest, Not a member yet? Register   Sign In
Why ci url does not support Chinese
#1

[eluser]chaochao[/eluser]
Why ci url does not support Chinese?????
#2

[eluser]richthegeek[/eluser]
All URLs do not support Chinese characters, its not just CI. Your best option is to use Chinese in the western alphabet.
#3

[eluser]chaochao[/eluser]
My client is Chinese, url will appear on Chinese, how should I do?
#4

[eluser]richthegeek[/eluser]
To be as clear as possible: there is no support whatsoever, in any international standard for the use of Chinese characters in URLs.

The characters available to you are the ASCII letters 'a' through 'z' (case-insensitive), the digits '0' through '9', the underscore, and the hyphen. There are also control characters (/Angry& etc).

URL *cannot* appear in Chinese. Client will have to live with the fact that Westerners invented the internet and most of its content, so they set the rules.
#5

[eluser]chaochao[/eluser]
can i put $config['permitted_uri_chars'] = null?????
#6

[eluser]richthegeek[/eluser]
No. I'll put it in big letters.

You cannot use chinese characters in your URLs
#7

[eluser]chaochao[/eluser]
what about this
function _clean_input_keys($str)
{
$config = &get;_config('config');
if ( ! preg_match("/^[".$config['permitted_uri_chars']."]+$/i", rawurlencode($str)))
{
exit('Disallowed Key Characters.');
}
return $str;
}
#8

[eluser]richthegeek[/eluser]
Am I missing something here?

Is your question "How can I stop users entering Chinese characters into fields that will appear in URLs?".

If so, a preg match on /[A-Z0-9_\.\-]/i will do it.
#9

[eluser]chaochao[/eluser]
thank you
#10

[eluser]yinzhili[/eluser]
So far as I know, you can't use Chinese characters in any URLs.Such as:
Code:
http://example.com/login/username/张三
It won't work. You can use:
Code:
http://example.com/login/username/<?php echo urlencode('张三');?>
And in login.php you could use this to get the value of the parament:
Code:
<?php
$username=$this->uri->segment(3);
$username=urldecode($username);
?>
Try this.




Theme © iAndrew 2016 - Forum software by © MyBB