window->preferences,然后是General->Content Types,选择JavaScript Content,在下面的Default encoding,改为UTF-8。为什么不用GBK呢?因为引用该JS文件的页面编码也是UTF-8 <%@page contentType="text/html;charset=UTF-8"%>