How to support UTF-8 encoding in Eclipse
250,891
Solution 1
Try this
1)
Window > Preferences > General > Content Types
, set UTF-8 as the default encoding for all content types.2)
Window > Preferences > General > Workspace
, setText file encoding
toOther : UTF-8
Solution 2
Open Eclipse and do the following steps:
- Window -> Preferences -> Expand General and click Workspace, text file encoding (near bottom) has an encoding chooser.
- Select "Other" radio button -> Select UTF-8 from the drop down
- Click Apply and OK button OR click simply OK button
Solution 3
You can set a default encoding-set whenever you run eclipse.exe.
- Open eclipse.ini in your eclipse home directory Or STS.ini in case of STS(Spring Tool Suite)
- put the line below at the end of the file
-Dfile.encoding=UTF-8
Solution 4
Just right click the Project -- Properties and select Resource on the left side menu.
You can now change the Text-file encoding to whatever you wish.
Author by
Katty
Updated on March 13, 2021Comments
-
Katty about 3 years
How can I add UTF-8 support in eclipse? I want to add for example Russian language but eclipse won't support it. What should I do? Please guide me.
-
soulcheck about 12 yearsdo you want to use translated eclipse or simply change the file encoding?
-
Nyerguds over 7 yearsIs this about code, or resources? UTF-8 resource support takes a bit more work.
-
Ripon Al Wasim almost 7 yearsI need Chinese language support in eclipse for Selenium WebDriver tests.
-
-
Stijn de Witt about 10 yearsI wrote a blog post about this very topic which illustrates this in great detail (with screenshots etc): Unicode/UTF-8 in your Eclipse Java projects
-
Kaushik Lele over 9 yearsI am not able to accept UTF-8 characters as input from console. Scanner sc=new Scanner(System.in); sc.nextLine(); here if I give non-English characters it gets something garbage. What changes needed in setting or in program ?
-
meustrus about 9 yearsKaushik Lele: Your question does not relate the the question asked here. I invite you to search for your solution in other questions, or if none exist, ask your own question.
-
Nyerguds over 7 yearsThat is pretty awful... surely the encoding of a project should be dependent on the project, not on the global Eclipse settings?
-
Ralph over 7 years@Nyerguds: In the Package Explorer, right-click on a project and choose
Properties'. The first entry
Resource' offers exactly what you want. -
Vibhav Singh Rohilla almost 7 years@sajan : your answer saved my production solr-app deployment..! Thanks a ton..!
-
Ripon Al Wasim about 6 yearsI followed the steps you mentioned above and changed into UTF-8 for console printing for Chinese an Russian languages. But unfortunately it didn't work.
-
softwarevamp over 4 yearsWhy
Default encoding
ofJS Object Notation File
not works for*.json
?