Welcome Guest, Not a member yet? Register   Sign In
problem with "permitted_uri_chars" + "url_title" because of "arabic" + "utf-8"
#1

[eluser]DeaD SouL[/eluser]
Hello,

I tried to add the arabic language to url_title() by editing
Code:
'[^a-z0-9\-\._]'        => '',
and changed it to this
Code:
'[^ء-يa-z0-9\-\._]'        => '',
but it didn't work 100% good, some characters were being replaced with �
like this
Quote:�جرد-تجربة-با�عربية
so i decided to use unicode characters blocks instead of the characters
according to Unicode Block 'Arabic'
Code:
ء = U+0621
ي = U+064a
so i've changed it to this
Code:
'[^[U+0621]-[U+064a]a-z0-9\-\._]'        => '',

and it worked just fine Big Grin

so i tried to do the same to
Code:
$config['permitted_uri_chars']

so i added this
Code:
$config['permitted_uri_chars']  = 'a-z 0-9~%.:_\-'; // DEFAULT
$config['permitted_uri_chars']  .= "[U+0621]-[U+064a]"; // INCLUDE ARABIC

it gave me this error
Quote:A PHP Error was encountered

Severity: Warning

Message: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 20

Filename: libraries/URI.php

Line Number: 189

even if i go with this
Code:
$config['permitted_uri_chars']  = 'a-z 0-9~%.:_\-'; // DEFAULT
$config['permitted_uri_chars']  .= 'ء-ي'; // INCLUDE ARABIC

i get this error
Quote:The URI you submitted has disallowed characters.

any idea or help would be greatly appreciated

thanks


Messages In This Thread
problem with "permitted_uri_chars" + "url_title" because of "arabic" + "utf-8" - by El Forum - 10-31-2009, 04:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB