栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

在NetBeans中将JSP保存为UTF-8

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

在NetBeans中将JSP保存为UTF-8

首先; 不要忘了首先考虑以下这一行:

<%@page contentType="text/html" pageEncoding="UTF-8"%>

其次; 在NetBeans文件夹中,有一个配置文件。应该有这样一行:

netbeans_default_options="-J-Xms32m -J-Xmx128m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true"

将其添加到行的末尾:

-J-Dfile.encoding=UTF-8

第三:

NetBeans实现项目编码设置。

要更改项目的语言编码:

  1. 在“项目”窗口中右键单击项目节点,然后选择“属性”。
  2. 在“源”下,从“编码”下拉字段中选择一个编码值。

编码至少影响:

* how non-ASCII characters are displayed in the editor window when you open files* Java file compilation of sources containing non-ASCII identifiers, string literals, or comments* textual search for international characters over the project

从NetBeans IDE 6.8开始,您还可以指定将在运行时使用的编码。例如,当运行应用程序的操作系统的编码与项目的编码不同时,这很有用。

要指定在运行时使用的编码:

  1. 在项目的“文件”窗口中,打开nbproject> private> private.properties
  2. 将以下行添加到private.properties文件并保存更改:

runtime.encoding = <编码>

该编码将覆盖项目的编码设置,并在运行应用程序时使用。

一般来说,

*.properties files always use ISO-8859-1 encoding plus uXXXX escapes. (International characters will be displayed natively in the editor but stored as an escape on disk.)*.xml files and some *.html files can specify their own encodings, regardless of the project encoding. For such files, the IDE's editor ignores the project encoding.

这些可能对您有帮助。

我使用的答案来源:

链接1:http://forums.netbeans.org/topic33.html

链接2:http://wiki.netbeans.org/FaqI18nProjectEncoding



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/417296.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号