Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Default charset not set when calling res.render from within res.format #1585

allenpc opened this Issue · 2 comments

3 participants


Normally, res.render() will have a default charset of utf-8 because it eventually calls through res.send(), which has logic for default Content-Type and charset when the content is a string.

However, if you call res.render() from within the html callback of a res.format() call, the default charset is not set because res.format() sets the Content-Type, which doesn't allow the default charset logic in res.send() to kick in later.

I thought about adding some logic in res.render() to set a default charset, but I realized that this probably isn't the right thing to do since you can pass a callback and potentially send back something that isn't text/html.


I think this was solved with #1747 wasn't it @visionmedia @jonathanong?


Thanks @sorribas. There are a bunch of charset issues, I just haven't looked into the current state.

@jonathanong jonathanong closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.