javascript - Wrong charset with JSON data in Node.js project -
how can fix following problem?
if use code on app.js renders page no problem:
app.get('/layout', function(req, res){ res.render('empreendimentolayout', {"titulo": "página layout"}) })
.ejs file this:
<head> <title><%=titulo%></title> </head>
but if on app.js:
var routes = require('./routes'); app.get('/layout', routes.layout);
and inside layout.js:
exports.layout = function(req, res){ res.render('empreendimentolayout', {"titulo": "página layout"}) })
then rendering like: p�gina layout
it happens in json data send. if coming directly app.js works well, if coming .js file comes wrong charset.
Comments
Post a Comment