I′m using node.js and express to serve static JavaScript files to a single page application.
In the node.js server code I use express.static to allow public access folder
app.use(express.static(__dirname + '/public/'));
In the client side, I use $.getScript
to get the JavaScript files stored in the public folder, for example:
$.getScript("js/init.js");
When I try to get some JavaScript files that have letters with accents or some UTF-8 special character I get strange characters instead of what I want.
Is there any way to set the charset when I define the public folder?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…