application/json

  • 数据必须是Unicode编码,默认编码方式为UTF-8

  • 因为json数据前2个字符总是ASCII字符({",与[空格]的组合),所以可以推断出其编码方式

    1
    2
    3
    4
    5
    00 00 00 xx  UTF-32BE
    00 xx 00 xx UTF-16BE
    xx 00 00 00 UTF-32LE
    xx 00 xx 00 UTF-16LE
    xx xx xx xx UTF-8
  • 若采用UTF-16UTF-32,则需要设置content-transfer-encodingbinary??

参考:

  1. http://www.ietf.org/rfc/rfc4627.txt

参考

  1. http://stackoverflow.com/questions/9254891/what-does-content-type-application-json-charset-utf-8-really-mean

留言

2015-11-25