[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Problem with escape characters in when receiving JSon messages trough a rest endpoint

  • Thread starter Thread starter Matt Baker
  • Start date Start date
Status
Not open for further replies.
M

Matt Baker

Guest
Further info for anyone reading this: Browser’s will submit an XHR request back to a server using the code page from the original request. So if a .jsp page is running javascript that has an XHR request, then the browser will select the encoding for the XHR request based on what the .jsp request content type is set to. So if the .jsp page is declared without content type, then the server default is used…which is probably going to be ISO8859-1. If the .jsp sets its content type to UTF-8, then the browser is going to send any XHR requests that originate from that page as UTF-8. Unless explicitly overridden when setting the headers for the individual XHR request. So if you don’t want to specify content encoding for every XHR request, you can set your .jsp pages to UTF-8 and the browser will do the right thing. Or you can make each XHR request have the right Content-Type header that includes the character set encoding. The body encoding for the JSON must end up as Unicode otherwise you’re violating the JSON standard and the server is going to reject the request if there are characters outside the code page. But if they have to move these characters over to the AVM (since this is PASOE), they still need to deal with the characters in that context as well…then also in the database if this is going to get stored there as well. mattB

Continue reading...
 
Status
Not open for further replies.
Back
Top