NetTalk Central

Author Topic: Where to set charset in ReplyContentType for Ajax calls?  (Read 2668 times)

patrick de laet

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • ShopPlus
    • Email
Where to set charset in ReplyContentType for Ajax calls?
« on: January 07, 2012, 11:12:03 AM »
(Nettalk 5.45.)
I have problems with French characters (like "bébé" or "garçon").
A GET of a normal HTML page works OK.
But my Ajax calls translate the é, ç, ... to some weird characters.
When I change NetWeb.clw as follows, it works.
But of course, I don't want to change the NetWeb.clw source.
I tried several overrides in several embeds (eg CreateHeader, ParseHTML, ...), no result.

Anybody an idea.

ParseHTML

  If self.RequestAjax = 1
    self.ReplyContentType = 'text/xml; charset=iso-8859-1'
    ! this was the original ==> - self.ReplyContentType = 'text/xml'
  end

regards

Patrick De Laet

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Where to set charset in ReplyContentType for Ajax calls?
« Reply #1 on: January 09, 2012, 12:39:12 AM »
hi Patrick,

there's no embed point (ie no method call) between the line you changes, and where it is used, so the only (very short term) option for you there is to change it.

However, the data you are sending back should be ok - the fact that it is not is the real concern. Is it possible for you to say set up example 1 - as you have your app, and duplicate the effect there. Then send me that modified example. I'd like to test here to see if I can duplicate the issue - and hence solve it properly.

You mention "your ajax" as well - so I'm not sure if this is specific to your setup maybe? Is this using some "out the box" type stuff?

cheers
Bruce