1

Comments in java file are written in french. However the code is getting distorted. What setting in eclipse can i use so that code and comment is rendered properly.

// R�cup�ration des params d'envoi mail du fichier BFC2.properties

texte.append("Vous recevez ce mail automatique suite � la cr�ation d�un ou plusieurs nouveaux items dans");
        texte.append("l�application FERIA");
Ghasem
  • 14,455
  • 21
  • 138
  • 171
simba
  • 277
  • 4
  • 19
  • 3
    try setting, `Window > Preferences > General > Content Types`, set `UTF-8` as the default encoding, also refer [this](http://stackoverflow.com/questions/14167880/eclipseusing-utf-8-encoding-in-the-text-editor-make-the-strings-not-work-proper) discussion – Ankur Singhal Nov 30 '15 at 05:31
  • You can use unicode escapes, but it's hard to tell which you need because your text doesn't render here. – Elliott Frisch Nov 30 '15 at 05:31
  • it does not work with this setting.. i have tried it – simba Nov 30 '15 at 05:37
  • 1
    If you did not create these files you need to find out what encoding was used to create them – greg-449 Nov 30 '15 at 08:28

1 Answers1

0

I really hope this is a university project. Anyway, I am guessing you're using Windows which means that default character encoding for your source files will be Windows-1252 (since it's French).
What you need is to change file encoding both on project level and individual file level.

First you need to select current project, right-click on it and select Properties from a pop-up menu:

enter image description here

Then you can set global file encoding for the project:

enter image description here

This should set valid encoding for new folders and files. However, it won't change encoding of existing ones. In order to change the encoding for the file, you need to right click on it and select its properties:

enter image description here

Only then you can actually change the encoding for your current file:

enter image description here

Your job is sadly still not over, since now you'd have to fix broken accents by hand. Sorry.
The better option is to actually use ResourceBundles - you can read more about this approach here. This is easily done via Eclipse built-in string externationalization feature (Source -> Externalize Strings...).

Paweł Dyda
  • 18,366
  • 7
  • 57
  • 79