Solved

IE encoding GET String false

Posted on 2013-01-25
4
138 Views
Last Modified: 2014-04-24
Hi Experts:

I am getting GET parameters from the URL. The customer then logs in and after that the redirection sends the customer to the place where they originally want to go.

URL: http://anywhere/index.php?search=rüssel

for ($_GET as $key => $value)
{
$location .= "&" . $key . "=" . $value;
}

echo $location;

Open in new window


In FF you get the expected output:
&search=rüssel

In IE I get this:
search=r¿ ssel

(the ¿ is actually a square just could not type it here)

Any ideas what is happening here? When I redirect to the next page with the location, I am getting the false character in the URL, thus the search is not working....
0
Comment
Question by:kracklt
  • 2
4 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 38820834
Are you using a defined character set on the page like 'utf-8' and using the same character set in PHP?

PS: I believe utf-8 is the default in Firefox and Windows-1252 is the English default in IE.
0
 

Author Comment

by:kracklt
ID: 38820858
Hi:

Yes. I am using UTF-8. I could not figure out a solution yet. All I can think of is to call the URL URL-encoded using UTF8 (never knew there was a switch for UTF8 urlencoding...)

Any other ideas?
Thomas
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 38820962
It would be in a 'meta' tag in the <head> section.  This page you are reading has:

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

And in PHP look here:
http://php.net/manual/en/control-structures.declare.php#control-structures.declare.encoding
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 total points
ID: 38821628
anything non-7-bit-US-ASCII will be transmitted URL-encoded, it's the browser's choice which character set is used and then being encoded

I'm not sure if the met buta tag will help, it may help, but I guess it will not always 'cause there is also the contenttype HTTP header which contains a charset and also the form tag which may contain a charset attribute
If any of these "definition places" differ from another one, all browsers switch to quirks mode and do something proprietary, means somthing except well known standard

I suggest that you properly encode your values in the page and don't rely on browser functionality
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now