强制eclipse忽略字符编码属性 [英] force eclipse to ignore character encoding attribute

查看:340
本文介绍了强制eclipse忽略字符编码属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个在其html模板中使用动态字符编码的Web框架,如下所示:

  ; meta charset =$ {_ response_encoding}> 

问题是当我尝试在Eclipse中编辑此文件时,Eclipse认为这是一个文字编码类型,因此拒绝打开文件,说:


不支持的字符编码字符编码
$ {_ response_encoding}


有没有办法告诉Eclipse停止尝试聪明(因为它很明显't)只是显示我的文本?

解决方案

更改HTML的内容类型文件:



转到Windows - >首选项 - >常规 - >内容类型并更改所有文件扩展名的编码(设置为utf-8)。 / p>

I'm working with a web framework that uses a dynamic character encoding in its html templates, like this:

<meta charset="${_response_encoding}">

The problem is when I try to edit this file in Eclipse, Eclipse thinks this is a literal encoding type, and thus refuses to open the file, saying:

"Unsupported Character Encoding" Character encoding "${_response_encoding}" is not supported by this platform.

Is there any way to tell Eclipse to stop trying to be "smart" (because it plainly isn't) and just show me the text? I've tried using "Open With... Text Editor" but still same result.

解决方案

Change the content type for HTML files:

Go to Windows -> preferences -> General -> Content types and change encoding (set them to utf-8) for all the file extensions you need.

这篇关于强制eclipse忽略字符编码属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆