On 8 October 2014 11:39, Greg Keogh <g...@mira.net> wrote:
> I've been looking for official REST documentation on this matter (that I
> still can't find),

I think REST is more an idiom than a hard standard. The HTTP 1.1 spec
is the closest thing you will find to a REST standard.

RFC 2616 (HTTP 1.1) and RFC 2617 (HTTP authentication) are invaluable resources.

> I didn't search the Unicode documentation, where it does
> say
>
> "Where UTF-8 is used transparently in 8-bit environments, the use of a BOM
> will interfere with any protocol or file format that expects specific ASCII
> characters at the beginning"
>
> I'm guessing this applies to REST bodies, so I'm getting rid of the BOM. I'm
> using a stream writer for the XML, so there'll be some options somewhere to
> omit it.

REST does not prescribe any particular text encoding. Indeed, a
resource (the HTTP spec calls it an "entity") needn't be text at all.
Whatever entity you send, just be sure to include a correct and
detailed Content-Type header and always include the charset parameter
if the media type is text.

Note however that JSON's media type is "application/json", not text. I
think it is generally agreed that JSON is always encoded in UTF-8.

On 8 October 2014 11:04, Thomas Koster <tkos...@gmail.com> wrote:
> The standard states quite explicitly that a BOM in UTF-8 is
> unnecessary[1, 2] and discouraged[2].

--
Thomas Koster

Reply via email to