Bug Tracker

Modify

Ticket #7088 (closed bug: wontfix)

Opened 3 years ago

Last modified 2 years ago

not bug, but... JSON parser and BOM (Byte order mark)

Reported by: olden Owned by:
Priority: low Milestone: 1.4.3
Component: ajax Version: 1.4.2
Keywords: utf8,utf-8,JSON,BOM Cc:
Blocking: Blocked by:

Description

Example. A request from the client is processed on the server by a PHP-script (UTF-8). The script file begins with "<?php". But before "<?php" there are 3 bytes BOM (EF BB BF for UTF-8). These bytes are present in body of the JSON-response to the client. jQuery receives such JSON-response in a kind "EFBBBF{" var1 ":" val1 "," var2 ":" val2 "...}" also considers that it not format JSON.

Change History

comment:1 Changed 3 years ago by john

  • Status changed from new to closed
  • Resolution set to wontfix
  • Milestone changed from 1.4.2 to 1.4.3

Seems like that's something that should be trimmed out on the server side prior to the request then? Or if the request is done it should be trimmed out on the client.

comment:2 Changed 2 years ago by anonymous

Well, using BOMs in content advertised as application/json is in conflict with RFC4627 (see section "3. Encoding")

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.