Skip to content
Myr

docs for charset

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 3d8400a · Browse files · 1 file+18 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+18 added−0 removed

  • other:+18 added−0 removed

1 file+18 added−0 removed

modified:docs/guide.md+18 added
751 unmodified lines
752 753 res.header('Content-Length');754 // => 123755756### res.charset757758Sets the charset for subsequent `Content-Type` header fields. For example `res.send()` and `res.render()` default to "utf8", so we may explicitly set the charset before rendering a template:759760 res.charset = 'ISO-8859-1';761 res.render('users');762763or before responding with `res.send()`:764765 res.charset = 'ISO-8859-1';766 res.send(str);767768or with node's `res.end()`:769770 res.charset = 'ISO-8859-1';771 res.header('Content-Type', 'text/plain');772 res.end(str);773774### res.contentType(type)775776Sets the _Content-Type_ response header to the given _type_.777
427 unmodified lines