Solved

IE encoding GET String false

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

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 82

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Several part series to implement Internet Explorer 11 Enterprise Mode
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.
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 +…

762 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

19 Experts available now in Live!

Get 1:1 Help Now