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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -