Solved

IE encoding GET String false

Posted on 2013-01-25
4
149 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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…
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

738 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