ijse / freemarker.js

make freemarker available for node.js with FMPP.
http://freemarker.js.org/
MIT License
111 stars 41 forks source link

中文出现乱码 #11

Open zzbo opened 9 years ago

zzbo commented 9 years ago
<h1>hello, ${word}.</h1>
{"word": "测试"}
var fm = new Freemarker({
    viewRoot: tplDirPath,
    options: {
        sourceEncoding: 'utf-8'
    }
});

输出的中文有乱码

zzbo commented 9 years ago

但是我去掉

options: {
    sourceEncoding: 'utf-8'
}

乱码问题就没有了,那这是什么问题呢?

ImHype commented 8 years ago

之后有解决吗

elcarim5efil commented 8 years ago

@ImHype ftl做同步mock data, 不设sourceEncoding就乱码, 设了的话, 普通的.json同步mock data又乱码了...