codeigniter - Some problem with encoding $_GET variable from address bar -


my project based on codeigniter, guess question isn't @ all.

first, have enabled query strings , search function. search string passes “searchterm” variable , when pass through form, works fine , looks like:

http:// local/home/search/?searchterm=testtesttest

okay, when input cyrillic string in search form, works fine well, uri example:

http:// local/home/search/?searchterm=привет (in chrome) or http:// local/home/search/?searchterm=������ (in ie, opera etc.)

two above cases work fine, when enter cyrillic search string directly address bar (for example, in opera or ie) doesn’t wanna search anything. $_get[‘searchterm’] empty, , query_string, searchterm=������ (all data profiler).

i urldecode string controller, somehow doesn’t work. tried iconv() cases, i’ve googled, didn’t work.

so question why other browsers except chrome doesn’t retrieve cyrillic $_get variable address bar if entered there? passing through form works fine.

thanks in advance, guys. hope help.

p.s. i've found:

%d0%bd%d0%be%d1%87%d0%b0%d0%bb%d0%be

  • this passed form, accept-charset set utf-8. in case, said, works fine. and:

%ed%e0%f7%e0%eb%ee

  • this comes in address bar when typing string directly inside address bar. guess every browser changes cyrillic symbols strange... don't know :(

don't forget chrome works fine! maybe it's because default browser doesn't encode cyrillic symbols in wrong way other browsers.

i'm guessing part of issue here using utf-8 characters in url ... can setup php use utf-8 default within php.ini file or adding ini_set('default_charset', 'utf-8'); somewhere in application, (i add root index.php file within codeigniter if can't modify .ini file).

i tested both japanese , example in firefox , safari , both displayed correct strings. more information setting apache/php utf-8 can found in this excellent guide.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -