Hello, I have watched backend log of requests with fiddler. For input request I get this:
GET /PHP/data.php?sid=0.179863580913668&q= %C4%8Duk&limit=10×tamp=1239779442412 HTTP/1.1 x-requested-with: XMLHttpRequest Accept-Language: sl Referer: http://172.21.6.1/PHP/data.php Accept: */* UA-CPU: x86 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Host: 172.21.6.1 Connection: Keep-Alive Cookie: PHPSESSID=tmsfhiblj5it0a46m8fo62laf5 My input was "čuk" but like it's seen from GET params, q param has strange chars. But in QueryString it is ok. But when I check param q at the end of request (when it passes value to sql) I get value "äťk". For now I have replace characters "äť" with "č" and is ok. But that is not the solution. I have set all the header for character set to windows-1250. I think that the problem is with ajax request in your script. But I might be wrong. Does this help you any more? Thanks On Apr 14, 6:37 pm, Tom Worster <f...@thefsb.org> wrote: > On 4/14/09 11:54 AM, "borutt" <borut.toma...@gmail.com> wrote: > > > > >> was the page with the form containing the input element explicitly served > >> with header "Content-Type: text/html; charset=Windows-1250"? (i check > >> headers sent in WebKit Inspector, i'm sure there are other ways.) > > > I have included in the html header this line: > > <meta HTTP-EQUIV='Content-Type' Content='text-html; > > charset=windows-1250'> > > that's not necessarily sufficient. if the the server sends, for example, > charset=ISO-8859-1 in the headers then the user agent should ignore the meta > HTTP-EQUIV. read this: > > http://www.w3.org/TR/1999/REC-html401-19991224/charset.html#h-5.2.2 > > >> have you set the accept-charset attribute in the form? > > > I have not I never did. Will try this tomorrow. > > this has even lower priority than the meta HTTP-EQUIV. if the http header > explicitly sets anything other than windows-1250 then that's what will take > effect in the user agent. > > > A assumed that goes something wrong with value after it is submited by > > ajax. > > Because when I receive value from "q" argument it's already scrambled. > > > Have any idea? > > make sure the header of the form page specifies windows-1250. > > check in your server logs to see exactly what the query string was in the > ajax request. compare that with what you receive in the script. if the query > string is correct but the input value in your script is wrong then it's > probably to do with configuration of your script interpreter. if the query > string received in the http server GET request is wrong then the user agent > is probably using the wrong charset.