Keep file encoding in eclipse for each file (different encodings for different files) - eclipse

I'm working with a git repository where some of the files are encoded in latin-1 and some of them in utf-8. I'm using Eclipse CDT to work with them, and it's configured to use UTF-8 as default encoding.
The thing is, when I open latin-1 encoded files, some of the characters are not shown properly , and despite I've just tried also the Luna version, which came out 2 days ago, the problem persists (It's supposed that latin-1 and latin-2 are supported now, according to the review information).
Furthermore, and here comes the real trouble, when I modify and save latin-1 encoded files, they are being saved as UTF-8 (as configured in Eclipse), so if I push these changes to the repository, quite a lot of conflicts will emerge, messing up the entire commit.
Is there some way of telling Eclipse to keep the original encoding for each file?
Thank you.

Related

German character Encoding issue in Decompiler

Hi guys,
I am facing one ecoding related issue. Actually there is a need to decompile a .class file and modify few lines and again compile it
back.
I used a open source tool and download it to decompile the class, now I am copying that coode in Eclipse to change the lines and
to compile it back.
The problem is that the .class file contains some german character, as soon as I copying that code in eclipse it is showing all
of them as junk characters.
I changed the ecoding to UTF-8 in Preferences- workspace section but still getting the junk characters.
Any help to know how to do it without getting the junk characters?
Attaching the sample of German characters in a decompiler
After copying in eclipse editor: These character are showing as junk.
Even copying it in Notepad++ is not working for me.

Eclipse .properties file disable escaping of UTF-8 characters

I'm using *.properties files in my java/android applications for my translations files. My problem is that .properties files in eclipse escape utf-8 characters that are out of the ISO-8859-1 charset so I see the escaped characters. So I decided to make my own library that reads the file in utf-8 format. BUT eclipse still escapes characters. Is there any way to make eclipse handle *.properties files as normal text files??
Right Click on the file, properties. Under "resource" tab , check for "Text File Encoding" at the bottom right and change that to UTF-8.
Don't call them .properties files, give them another file extension and they will be handled by the text editor only, instead of the properties file editor.
Even without the editing issue you should not call them .properties, as they are not compliant to the Java properties file standard, which might confuse other developers on that project, other tools and so on.
The best solution however is yet another one: Throw away your selfmade implementation and get yourself a better editor for properties files, which shows you the characters as you want to read them, independent of how they are encoded in the file.

Xcode showing unknown characters

Please anybody help me with this,
my xcode project showing this charachters when i restarted my pc, any solutions are welcomed.
It seems that you changed the encoding of the characters to an unknown encoding
To solve it,
make sure that the class.m file is saved in UTF-8 format, to save it to utf-8, open it with any editor (for example textedit) and save it to UTF-8 format
make sure that the encoding in xcode is set to UTF-8, go to preferences->text editing
May be your project is connected with svn or other secure server, and unfortunately your svn stop working and at that time you save your data on svn that's why this was happen. now no way to recover this data but definitely you get that before saved data or backup which was taken by you.

Eclipse turns Japanese into garbage during refactoring

I have several Java files that have Japanese strings in them, and are encoded in UTF-8. I use Eclipse. However, whenever Eclipse touches them in any automated way, it turns the Japanese into garbage. A good example of this is JAWJAW, the Java Japanese WordNet interface. You can see the code on the website with Japanese characters in it. If you load the project into Eclipse, though, everything will fail because the characters are garbled (bakemoji).
Does anyone know how to fix this?
What is the default encoding for your project?
Future version of Eclipse (like e4) could be set by default to UTF-8, which would avoid any automatic conversion into "garbage".
See bug 108668 for more on that reflexion:
No solution will be perfect. However in the long term I think the current platform specific approach is clearly inferior to a platform-independent UTF-8 default.
+1 UTF-8 should be the obvious default character set for all text files, I had
a problem with eclipse when I was using an English Windows XP system and trying
to open a file in eclipse with Chinese characters, as you can imagine the
display is completely messed up and eclipse doesn't tell me what I need to do.
I had to spend time google for answers. I had to put -Dfile.encoding=UTF-8 in
eclipse.ini so that it behaves correctly.
Making UTF-8 the default is not the right solution for the problem you were
having.
+1 for embedding encoding in the character stream wherever we can (like XML, HTTP, some kinds of file systems).
Encoding is meta-info for the data and belongs to the data, not to a separate user-changeable setup.
The primary reason for this cause is - the unicode supported font is missing from the system fonts. So do the following things to get it done.
Download Arial Unicode MS font and put it inside windows->fonts
directory in windows.
Change the default text encoding in eclipse to UTF-8 by navigating to
Window->Preferences->General->Workspace->Text File encoding
->Other->UTF-8
set Arial Unicode MS font to the Text Font attribute by navigating to
Window->Preferences->General->General->Appearance->colors and
Fonts->Basic->Text Font (select it)->Edit

Jekyll does not parse UTF-8

I created a page in notepad and selected UTF-8 as the encoding while saving. Jekyll does not parse this page. It renders the liquid extensions in the page as they are.
Now I saved the same page using ANSI encoding. Jekyll parses that easily and my site is up and running. But it is limited only to ANSI and some characters appear as a question mark due to wrong encoding. I do not want to use ANSI instead of UTF-8 when the web fully supports it.
It may be due to the fact that Notepad inserts a byte order mark (BOM) at the beginning of UTF-8 documents, which may interfere with their processing (especially by tools that are aimed primarily at Unix). You could try using another text editor (or stripping out the BOM with another tool may work).