Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6590831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:20:57+00:00 2026-05-25T17:20:57+00:00

I am having a strange problem with Internet Explorer and greek encoded get variables.

  • 0

I am having a strange problem with Internet Explorer and greek encoded get variables. I have a simple script (utf-8 encoded) in php that does the following:

$term = $_GET['term'];
// term processing
echo htmlspecialchars($term);
echo '<form method="GET" action="/script.php">';
echo '<input type="hidden" name="ref" value="'.$term.'">';
echo '<input type='submit' value="do submit()">';
echo '</form>';

I call the script the usual way: http://localhost/form.php?term=διαστημοπλοιο.
Now while in chrome, firefox (mac), safari (mac) the value gets ok (it will display %CE%B4%CE%B9%CE%B1%CF%83%CF%84%CE%B7%CE%BC%CE%BF%CF%80%CE%BB%CE%BF%CE%B9%CE%BF – percent utf-8 encoded), in Internet Explorer 8+ (windows) I get garbled text (empty squares). Is there something I should check? I used mb_detect_encoding and the string is UTF-8 encoded.

I’ve also used the following tests (php code below) and there are differences between browsers:

header("Content-type:text/html;charset=utf-8");
$term = $_GET['term'];
echo "<pre>";
echo "DECODED:".urldecode($term)."\n";
echo "TERM ENCODING (FROM BROWSER) [mb_detect_encoding]:".mb_detect_encoding($term)."\n";
echo "UTF-8:\n";
echo 'URLDECODE:'."\t".urlencode($term)."\n";
echo 'RAWURLDECODE:'."\t".rawurlencode($term)."\n";
echo 'URLDECODE:'."\t".urldecode(utf8_encode(urlencode($term)))."\n";
echo 'RAWURLDECODE:'."\t".rawurlencode($term)."\n";
echo "UTF-8->cp1253 iv:\n";
$zz = iconv('UTF-8','cp1253',$term);
echo 'URLDECODE:'."\t".urlencode(iconv('UTF-8','cp1253',$term))."\n";
echo "cp1253->UTF-8 iv:\n";
echo 'URLDECODE:'."\t".urlencode(iconv('cp1253','UTF-8',$zz))."\n";
echo "</pre>";

The results on mac/linux were:

DECODED:διαστημοπλοιο
TERM ENCODING (FROM BROWSER) [mb_detect_encoding]:UTF-8
UTF-8:
URLDECODE:  %CE%B4%CE%B9%CE%B1%CF%83%CF%84%CE%B7%CE%BC%CE%BF%CF%80%CE%BB%CE%BF%CE%B9%CE%BF
RAWURLDECODE:   %CE%B4%CE%B9%CE%B1%CF%83%CF%84%CE%B7%CE%BC%CE%BF%CF%80%CE%BB%CE%BF%CE%B9%CE%BF
URLDECODE:  διαστημοπλοιο
RAWURLDECODE:   %CE%B4%CE%B9%CE%B1%CF%83%CF%84%CE%B7%CE%BC%CE%BF%CF%80%CE%BB%CE%BF%CE%B9%CE%BF
UTF-8->cp1253 iv:
URLDECODE:  %E4%E9%E1%F3%F4%E7%EC%EF%F0%EB%EF%E9%EF
cp1253->UTF-8 iv:
URLDECODE:  %CE%B4%CE%B9%CE%B1%CF%83%CF%84%CE%B7%CE%BC%CE%BF%CF%80%CE%BB%CE%BF%CE%B9%CE%BF

The results on IE were:

DECODED:�������������
TERM ENCODING (FROM BROWSER) [mb_detect_encoding]:UTF-8
UTF-8:
URLDECODE:  %E4%E9%E1%F3%F4%E7%EC%EF%F0%EB%EF%E9%EF
RAWURLDECODE:   %E4%E9%E1%F3%F4%E7%EC%EF%F0%EB%EF%E9%EF
URLDECODE:  �������������
RAWURLDECODE:   %E4%E9%E1%F3%F4%E7%EC%EF%F0%EB%EF%E9%EF
UTF-8->cp1253 iv:

Notice:  iconv() [function.iconv]: Detected an illegal character in input string in /Users/xalapan/Sites/drupal/io.php on line 15

Notice:  iconv() [function.iconv]: Detected an illegal character in input string in /Users/xalapan/Sites/drupal/io.php on line 16
URLDECODE:  
cp1253->UTF-8 iv:
URLDECODE:
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:20:58+00:00Added an answer on May 25, 2026 at 5:20 pm

    You need htmlspecialchars(), not urlencode(). Not using htmlspecialchars leads to XSS vulnerabilities.

    echo '<input type="hidden" name="ref" value="'.htmlspecialchars($term).'">';
    

    Also, the values in $_GET are already decoded. You must not decode them again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a strange problem in that I have php inserting text into a
I'm having a strange problem here... I have an ASP.NET 3.5 application that has
Im having a very strange problem, i have a complicated view that returns incorrect
I am having a strange problem with Internet Explorer not accepting my cookies. This
I'm having a strange problem - I have about 14.5 million bitmap images, that
I'm having a strange problem with Android 1.6 I have an application that has
I've been having a strange problem that I've never seen before. Now I have
I'm having a strange problem with php PDO and mysql. I have the following
I'm having a strange problem. I have to use GetPostBackEventRefence to force a Postback,
i am having a strange problem, i have a static class like this public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.