1

I am building a web site with database in Hebrew (using php and mysql). on general I use chrome to test my job... today I tried explorer :-0 (yeh... you must be thinking "why the f*** would he do it... ;) ). I found out that all the data that is sent from explorer is stored in ????? and cannot be used.

I use <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> on the main page

and header('Content-Type: text/xml charset=utf-8'); on the php page that sends the xml files (after he receives get request)

on my connect.ini.php I included the following code:

mysql_query("SET NAMES 'utf8'",mysql_connect($host, $user, $password));

my ajax javascript is:

if(xmlHttp.readyState==4||xmlHttp.readyState==0){
   gender=document.getElementById("gender").value;                                                                                       
   xmlHttp.open("GET","file.php?gender="+gender , true);                                                                                    
   xmlHttp.send(null);
   }else{
        setTimeout('submit_quick_start_form()',1000);   
   }

as i said before in chrome everything is fine...

Please help guys...

9
  • can you clarify this ... so User A sends data to your web server in Chrome you receive this data save it to MySQL, User B sends data to your web server in IE you receive this data save it to MySQL, User C goes to your site in Any Browser and you output User A input and User B input and User B input is ????? instead of the correct characters? Commented Jun 2, 2015 at 20:17
  • yep only I not output it... I look in php-my-admin and see the disaster... I guess if I output it chrome wont understand the ???? Commented Jun 2, 2015 at 20:25
  • possible duplicate of Setting the character encoding in form submit for Internet Explorer Commented Jun 2, 2015 at 20:25
  • @misha312 have a look at the link I posted, it may have your solution (IE Hack) Commented Jun 2, 2015 at 20:26
  • @misha312 how are you submitting the form data? ajax? or is it a straight post? Commented Jun 2, 2015 at 20:32

1 Answer 1

1


(click for full size)

Shown in the first 3 GETs, in order, I found that Chrome, Firefox, and IE all produce different results. But I guess theoretically, Firefox does it right. In any case, they all give the same result (next 3 GETs in order), if we encodeURIComponent() the input.value. Like such:

xhr.open('GET', location.href+"?"+encodeURIComponent(test.value), true)
......
<input type=text id=test name=test value="שלום מישה">

Sign up to request clarification or add additional context in comments.

1 Comment

So let me understand I need to insert encodeuricomponent to my javascript in order to solve this problem??

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.