Solved

IE encoding GET String false

Posted on 2013-01-25
4
145 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
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…

860 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