On May 18, 10:42 am, Laurie Harper <[email protected]> wrote: > On 2011-05-18, at 4:43 AM, Clothears wrote: > > > On May 17, 11:14 pm, Poetro <[email protected]> wrote: > > >> What HTTP headers does your server side script sends to the client? > >> Does it send the right Content-type header along with a charset? > > > At present, none, as this is an ajax response rather than a web page. > > Can I or should I be sending headers as part of an ajax response? > > I've not seen this mentioned anywhere. > > It doesn't matter if you request it with Ajax or not, you're still sending > the response over HTTP and thus need correct HTTP headers.
Now *that* is useful to know - thanks. That being the case there is more research and testing that I can do. > You said the value is displayed correctly in one case, when fetched via one > PHP script; and incorrectly in another, when fetched with a different PHP > script. That seems like a good place to start: what are the code differences > in the two different PHP scripts, and what are the code differences in the > two different client-side scripts? Yes, the mystery is that at present, the results look good in cell A and rubbish in cell B. However, if I leave out the gb2312 to UTF-8 conversion step that I mentioned in my first post, then I get (different) rubbish in cell A and cell B looks good - as if another conversion was occurring as I speculated. However the headers issue may influence that. Meanwhile I've looked up down and sideways at the two PHP scripts and the rather large JavaScript module that's making the two ajax requests to no avail - I'm as certain as I can be that I'm doing no conversions myself that I haven't already mentioned. I've got a little testbed where I've extracted the code from the production setup in order to test this issue - works like a charm drat it. I'll go off and look at headers and see how I get on - thanks for help so far. -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
