req.acceptedCharsets

This property is an array that contains the acceptable charsets specified by the user agent in the request.

Usage

  1. req.acceptedCharsets;

Details

Useful for advanced content negotiation where a client may or may not support certain character sets, such as unicode (utf-8.) This returns all of the “acceptable” charsets specified in this request’s Accept-Charset header (see RFC-2616.)

Example

  1. req.acceptedCharsets;
  2. // -> ['utf-8', 'utf-16']

Notes

  • See the accepts module for the finer details of the header parsing algorithm used in Sails/Express/Koa/Connect.