[#2629] Add charset to Content-Type header #3483

Merged
merged 2 commits into from Jan 19, 2013

Conversation

Projects
None yet
3 participants
Owner

weierophinney commented Jan 18, 2013

  • Defaults to UTF-8
  • Allows setting via a setter
  • charset is always used in generated content-type header

Addresses #2629

[#2629] Add charset to Content-Type header
- Defaults to UTF-8
- Allows setting via a setter
- charset is always used in generated content-type header
+ *
+ * @var string
+ */
+ protected $charset = 'utf-8';
@Freeaqingme

Freeaqingme Jan 18, 2013

Member

If I'm interpreting the spec correctly, I think this should be upper case? (not sure)

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

Member

Freeaqingme commented Jan 18, 2013

The JSON spec also states: When JSON is written in UTF-16 or UTF-32, the binary content-transfer-encoding must be used.

Is this something you considered? Would you consider this to be something that should be incorporated in this PR?

Member

Freeaqingme commented Jan 18, 2013

Also, perhaps we should also add a getter, for sake of convenience?

Incorporate feedbac
- Added getter for charset
- For selected multibyte character sets, an additional
  content-transfer-encoding header is set with the value 'BINARY'

Maks3w added a commit that referenced this pull request Jan 19, 2013

@Maks3w Maks3w merged commit fe7cfad into zendframework:develop Jan 19, 2013

1 check passed

default The Travis build passed
Details

gianarb pushed a commit to zendframework/zend-view that referenced this pull request May 15, 2015

Merge pull request zendframework/zendframework#3483 from weierophinne…
…y/feature/json-strategy-charset

[zendframework/zendframework#2629] Add charset to Content-Type header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment