• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use utf-8 fonts in url?

#1
I can't understand what goes wrong with utf-8 font in url :/ how did you solve this problem?
[Image: N8jPdBS.png] Thanks in advance
Reply

#2
Check your setting for $config['permitted_uri_chars']. The default only allows English letters, numbers and a few others.
https://github.com/bcit-ci/CodeIgniter/b...g.php#L156
Reply

#3
In that case it is not possible to add every single characters in that string. what could be another option? this way seems to be black-hat but can we apply a white-hat approach, i am not sure if i am speaking right about black hat or white hat Big Grin but i think you get the point
Reply

#4
You can always leave that config setting blank like the notes say, which will allow all chars. It does open more security risks though. But I believe the proper way would be to urlencode non-ascii chars in the url.
Reply

#5
i think urlencode will also not gonna work, cause latest browsers decode it right in the addressbar :[
Reply

#6
Yeah, but that's how it's supposed to work! The HTTP specs state that urls should only contain ascii characters, or url encoded chars. This isn't a CI limitation. CI is using the STANDARD. Browsers set to use that language will properly decode it in the url and show it properly - others will see the urlencoded string, which is proper.
Reply

#7
You might want to read up on the RFC standard here: https://tools.ietf.org/html/rfc3986#page-11
Reply

#8
The following page details some of the standards and proposals related to handling of multilingual URLs:
http://www.w3.org/International/articles...i/Overview

It also includes details about how some browsers will translate non-ASCII characters in different parts of the URL.

In the end, you may need to find a RegEx which permits the characters for your language in the permitted portions of the URL.
Reply

#9
try:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-\p{L}';

add:
\p{L}

at the end, for international characters
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.