如何在Netbeans中以UTF

如何在Netbeans中以UTF

本文介绍了如何在Netbeans中以UTF-8格式打开文件;不会扭曲字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

属性文件中包含挪威语字符.当我在启用了UTF-8的Notepad ++中打开时,它会正确显示:

There are Norwegian characters in properties file.When i open in UTF-8 enabled Notepad++ it appears correctly:

Foreslåtte

但是当我在Netbeans编辑器中打开相同文件时;它显示扭曲的字符,如:

But when i open same file in my Netbeans editor; it shows distorted characters like :

Foreslåtte

正在使用的Netbeans版本:8.0.2.

Netbeans Version in Use: 8.0.2.

项目类型:Maven项目

Project Type: Maven Project

在Maven Proeject属性中,已设置UTF-8:

In Maven Proeject properties there is setting for UTF-8:

<properties>
    <app.navn>posten</app.navn>
    <jdk.version>1.8</jdk.version>
    <wro4j.version>1.7.6</wro4j.version>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <--
    <servlet.version>3.1.0</servlet.version>
</properties>

有谁能帮助您找到需要在Netbeans中进行哪些设置才能获取正确的UTF-8字符?

Could anyone help in finding what settings need to be done in Netbeans to get correct UTF-8 characters?

推荐答案

右键单击属性文件->属性->编码->勾选使用项目编码

Right Click Properties File -> Properties -> Encoding -> Tick Use Project Encoding

现在打开文件并解决问题.

Now open the file and matter resolved.

注意:我的项目编码"已设置为UTF-8.您可以设置i:右键单击Project-> Properties-> Sources->选择Encoding UTF-8

Note: My Project Encoding was already set to UTF-8. You can set i: Right Click on Project -> Properties -> Sources -> Select Encoding UTF-8

这篇关于如何在Netbeans中以UTF-8格式打开文件;不会扭曲字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 11:36