window -> preferences -> general -> workspace : text file encoding
what worked for me in eclipse mars was to go to window > preferences > web > html files, and in the right panel in encoding select iso 10646/unicode(utf-8), apply and ok, then and only then my .html files were created with .
to change the default encoding used for all workspaces you can do the following:
create a defaults.ini file in the eclipse configuration folder. for example, if eclipse is installed in
c:/eclipse/configuration/defaults.ini. the file should contain:
if you want to set the line terminator to unix values you can also add:
in eclipse.ini in the eclipse install folder (e.g.,
c:/eclipse) add the following lines:
you might need to play around with where you put it. inserting it before the "-product" option seemed to work.
i was having the same problem when i received a html to put inside my project and rename it to .jsp. to solve the problem, i needed to what people above already said, that is, to change text encoding in eclipse preferences. however, before renaming the files to .jsp, it was necessary to include the following line in the beginning of each .html file:
<%@ page language="java" contenttype="text/html; charset=utf-8"
i believe this forced eclipse to understand that it was necessary to change file encoding when i tried to rename .html to .jsp.
if you need to edit files of same type with more encodings in different folders and projects (e.g. one project is in utf-8 and other in windows-12xx), go to window > preferences > general > content types > text > and select each type with multiple encodings.
for each type delete content of the default encoding and click update.
this way eclipse will not "autodetect" encoding and will use encoding set for project or folder.
preferences >> general >> editors >> text editors >> spelling: enconding
p.s.: eclipse indigo and juno.
nanda's answer wasn't enough in my setup. what i needed to do is:
- window > preferences > general > content types
- select text > html in the tree
- select all file associations, particularly .html
- input "utf-8" in the text-field "default encoding"
- How to change default text file encoding in Eclipse?
- Eclipse JSP: incorrect default text file encoding
- How to change the default C++ file extension in Eclipse CDT when creating a new file?
- How can we change default label provider of eclipse ide's project explorer view to render file with customized label
- how can i change the font size of a text file in Eclipse
- how to change the default text when creating a new html file in eclipse?
- How to change font size in Eclipse for Java text editors?
- How to change the Eclipse default workspace?
- How to change an Eclipse default project into a Java project
- How do I change the default author and committer in the Eclipse Git plugin?
- Eclipse Editor: How to change file format from Dos to Unix
- How can I change font size in Eclipse for ALL text editors?
- How to change the color of current line & text selection in eclipse (for Java)?
- How to change default JRE for all Eclipse workspaces?
- How do I change the default text font in Eclipse?
- How to change the default Eclipse startup workspace?
- How to change default Eclipse WTP "Web Resources" dynamic folder
- How to set charset encoding property for SVN File and Eclipse
- Change text encoding for multiple files at once in Eclipse
- Eclipse Theme - How to change the color of the main editor text
- How do I change text cursor color in Eclipse
- How can I change Eclipse color scheme for a specific file extension?
- How do you change the default test location in Eclipse when using Maven?
- How to change default eclipse shell interpreter?
- Eclipse PDE build/export plugin/feature/update site does not honor file encoding - how to forbid recompiling
- How to change the text in the thread group display in CDT-based eclipse debugger?
- How can I change the default IDetailPane in an Eclipse plugin?
- how to access a text file while debugging with eclipse CDT
- How to change the *default* default encoding in Eclipse?
- How can I change the view / editor for a file in Eclipse using the keyboard?
More Query from same tag
- Add hotkeys to Eclipse
- Running ant in eclipse (sql2java) - no output to the console
- java.lang.NoClassDefFoundError occures using tess4j without Eclipse
- Issue connection to MySql database through JDBC
- eclipse plugin project do not build anymore
- Eclipse generating Javadocs just for the last class edited
- Eclipse: maven multiple argument string in exec.args
- FileNotFoundException while trying to access external storage Android
- Run protobuf given example on eclipse (C++)
- Devices in eclipse layout view
- Eclipse Marketplace client installed but missing
- -vm arguments does not working on eclipse mars
- Eclipse will not run correctly and stops suddenly
- Converting Eclipse Java Project to Android Project
- Using Jetty in Eclipse Juno
- update IFile content in eclipse plugin
- Calling organize imports programmatically
- Stray threads in Android application
- Eclipse Javadocs: How to *easily* create @see links?
- Netbeans Platform / Eclipse RCP alternatives in .NET
- Android: Asynch Thread for Method
- How to search for a Java string in Eclipse?
- show only .classpath files in eclipse package view?
- Write/read SVN files to external files in eclipse?
- Eclipse IDE Crash on startup
- Java & Slick2d - Object Interaction
- Eclipse support breakpoints in .xsl-file?
- Adding custom right click menu into Eclipse's project explorer view in RCP application
- Android/Eclipse Package Manager: Generate Java files have different icons?
- How to programmatically run an Xpand workflow on a model in a second workbench?