Mmm, changing to that works - but the error is still there with the unlat charachters :(
On Jan 12, 12:40 pm, "Jonathan Vanherpe (T & T NV)" <jonat...@tnt.be> wrote: > maybe it's because of the application/json part. I guess that should be > application/x-www-form-urlencoded or something. Just play with the > options you find here:http://docs.jquery.com/Ajax/jQuery.ajaxSetup > > Jonathan > > > > youradds wrote: > > Mmm, maybe that didn't work :/ > > > jQuery.ajaxSetup({ scriptCharset: "ISO-8859-1" , contentType: > > "application/json; charset=ISO-8859-1"}); > > jQuery.post("/cgi-bin/unterricht/review.cgi", { > > Review_Rating: the_rating, > > ID: theID, > > add_this_review: 1, > > Review_Contents: contents, > > Review_Subject: subject, > > Review_ByLine: byline, > > Review_GuestName: guestname, > > Review_GuestEmail: guestemail, > > add_review: 1, > > SecurityImage: SecurityImage, > > SessionID: SessionID > > > }, function(response){ > > > jQuery('#ajax_rate_indicator').fadeOut(); > > setTimeout("finishAjaxReview('the_rating_box', '"+escape > > (response)+"')", 400); > > }); > > > The script is called ok, but it doesn't pass any of the paramaters - > > the POST values passed in are simple $VAR1 = {}; (i.e nothing was > > passed it?) > > > TIA > > > Andy > > > On Jan 11, 3:54 pm, "Jonathan Vanherpe (T& T NV)"<jonat...@tnt.be> > > wrote: > >> actually, putting this once somewhere in your script should fix it: > >> $.ajaxSetup({ scriptCharset: "ISO-8859-1" , contentType: > >> "application/json; charset=ISO-8859-1"}); > > >> but still, you'll make your life easier if you just go for a completely > >> utf-8 workflow. > > >> Jonathan > > >> Jonathan Vanherpe (T& T NV) wrote: > > >>> this seems to answer your question somewhat: > >>>http://stackoverflow.com/questions/26620/how-to-set-encoding-in-getjs... > > >>> although I'd personally recommend to just use utf-8 for everything (so > >>> making your website and database use utf-8) > > >>> Jonathan > > >>> youradds wrote: > >>>> Anyone got any suggestions? This is the last bug I've gotta squish :/ > > >>>> TIA > > >>>> Andy > > >>>> On Jan 11, 9:18 am, youradds<andy.ne...@gmail.com> wrote: > >>>>> I found a way to do this in the .cgi script - but obviously I'd prefer > >>>>> to do it vai the AJAX submission, instead of having to encode it > >>>>> properly at the server end :) > > >>>>> my $contents = $IN->param('Review_Contents'); > >>>>> $contents =~ s/([\200-\377]+)/from_utf8({ -string => $1, - > >>>>> charset => 'ISO-8859-1'})/eg; > >>>>> $IN->param('Review_Contents' => $contents ); > > >>>>> TIA > > >>>>> Andy > > >>>>> On Jan 11, 8:15 am, youradds<andy.ne...@gmail.com> wrote: > > >>>>>> Hi, > > >>>>>> Got a bit of a weird one here :/ > > >>>>>> The following code works fine: > > >>>>>> jQuery.post("/cgi-bin/review.cgi", { > >>>>>> Review_Rating: the_rating, > >>>>>> ID: theID, > >>>>>> add_this_review: 1, > >>>>>> Review_Contents: contents, > >>>>>> Review_Subject: subject, > >>>>>> Review_ByLine: byline, > >>>>>> Review_GuestName: guestname, > >>>>>> Review_GuestEmail: guestemail, > >>>>>> add_review: 1, > >>>>>> SecurityImage: SecurityImage, > >>>>>> SessionID: SessionID > >>>>>> }, function(response){ > > >>>>>> jQuery('#ajax_rate_indicator').fadeOut(); > >>>>>> setTimeout("finishAjaxReview('the_rating_box', '"+escape > >>>>>> (response)+"')", 400); > >>>>>> }); > > >>>>>> ...*appart* from the fact stuff like: > > >>>>>> = > >>>>>> = > >>>>>> = > > >>>>>> ..gets converted to: > > >>>>>> = > >>>>>> = > >>>>>> = > > >>>>>> I did a little bit of research, and found something about adding this > >>>>>> (but this seems to really be for a different jQuery function - which > >>>>>> is probably why its not working); > > >>>>>> contentType: "application/x-www-form- > >>>>>> urlencoded;charset=ISO-8859-15", > > >>>>>> Can anyone suggest how I could fix this issue with foreign > >>>>>> charachters? > > >>>>>> TIA > > >>>>>> Andy > > >> -- > >> Jonathan Vanherpe - Tallieu& Tallieu NV - jonat...@tnt.be > > -- > Jonathan Vanherpe - Tallieu & Tallieu NV - jonat...@tnt.be