During my CS studies, we have a good bit of group assignments. We program in Java using Eclipse. We (or atleast i try to get them to) share code using Mercurial and BitBucket. I'm running Mac OSX 10.7 and the others are running Windows 7. We often have problems with the encoding when we share code. Danish characters such as æ, ø and å is often a mess.
What settings should we run across our eclipse setups to ensure that the encoding will be the same (and what encoding would be preferred?) On Windows, Eclipse defaults to Cp1252 and on MacOS it defaults to MacRoman. I've been trying to get everyone to use UTF-8, but code they previously wrote (in Cp1252) wont show correctly, so they are forced to switch around a lot, which usually ends up in them defaulting back to Cp1252 and forgetting about it when they submit code to a shared repository.
For me it works to use the standard encoding (Cp1252) in Eclipse on Windows and to tell Eclipse on Mac to use the encoding ISO-8859-1. On Mac I configured this for my whole workspace in the settings (under General --> Workspace).
Encode old 1250 texts into UTF8 by hand and use only these versions
Speaking from experience, I believe the best solution is for everybody to use UTF-8, that can represent any Unicode character.
The workaround CP1252 & ISO-8859-1 is not perfect, some characters are not compatible between them. Moreover, most IDEs default to UTF-8, if someone must have the trouble of changing Eclipse encoding settings, I believe it should be Windows users.
So after much headache using CP1252 & ISO-8859-1, I decided to change all my files to UTF-8. In case someone is interested, you can do that on Unix with a command like this, that will change all files in the current directory and its subdirectories:
find . -name "*.java" -exec sh -c "iconv -f ISO-8859-1 -t UTF-8 {} > {}.utf8" \; -exec mv "{}".utf8 "{}" \;
Since you are informing the original encoding, iconv will be able to convert without messing with accents and special characters.
Then ask everybody to create a new workspace, configure all encoding configuration on Eclipse to UTF-8 (Windows users) and import the project again.
Related
Now I download Apache NetBeans 11 and after that, I CLONE my Git PHP Repository to Windows Folder, If I open HTML files via Notepad, everything is ok, but when I open it via NetBeans, I got wrong characters interpretation like this:
BAD
Ăšvod
RIGHT
Úvod
How can I solve it to use UTF8? When I open a file in example via PSPad Editor I see the encoding is UTF8, but the format is UNIX, not DOS, maybe this cause a problem
Edit:
When I use Netbeans 8.2 Characters are ok
Any sugestions?
Windows 10 Jetbrains Clion 2018.2.1
MinGW-W64 Encoding
input[1] :
std::cout << "가나다라 abc" << std::endl;
output[1] :
媛?섎떎??abc
Settings > Editor > File Encodings
I can solve with Path setting: EUC-KR, but only configured file only. I have to configure Encoding setting every each project, every each file.
I found when using CMD, chcp 65001 works, but clion's cpp output cannot manage like that.
VM option :
-Dconsole.encoding=EUC_KR
-Dconsole.encoding=EUC-KR
-Dconsole.encoding=UTF8
-Dconsole.encoding=UTF-8
-Dfile.encoding=EUC_KR
-Dfile.encoding=EUC-KR
-Dfile.encoding=UTF8
-Dfile.encoding=UTF-8
I tried them all, each by each, but they does not work.
cygwin basically works well, but mingw-w64 doesn't work well. I searched for hours, but I couldn't find any answer.. :(
Thank you for reading..
Unfortunately, the Windows console only supports standard characters. If you try to print a special character, it will appear abnormally.
Windows cmd uses a simple ASCII table, while Windows uses an extended ANSI table. The 128 first characters are identical, so you can use them only.
I'm using Windows 7 and trying to use Grunt for workflow. I've never used it before and am trying to make sure everything is installed and running correctly. I've installed everything (Node.js, Ruby, Sass, Git, yo, Bower, Grunt) and everything up as far as Grunt is working fine. I'm testing out Grunt on a previous project from my company that works on all the other machines in the office (both PC and Mac) and I can start it watching my files, but when I edit a .scss file that is being watched and save it I get
Encoding::UndefinedConversionError: "\x9D" to UTF-8 in conversion from Windows-1252 to UTF-8. Use --trace for backtrace. Warning: Exited with error code 1
I've tried forcing all .scss files to encode UTF-8, changed defaults on Sublime Text to always use UTF-8, checked filenames for unusual characters, and it hasn't fixed anything. Any suggestions for what else I can try? Has anyone else had this problem?
I have problem with charset in my NetBeans on Windows when I open files, which were editting in NB on Linux by my coworkers.
I guess it should be unicode in both.
What I should to do to resolve this problem?
I can find proper option.
I use frensh and changed the netbeans encoding to Iso-8859-1 and it worked for me.
tried UTF-8 before didn't do it
my symptoms were as follows:
- a website hosted on linux and developped by another dev
- downloaded on my windows 8 , netbeans 8.0 beta or 8.1
- when opening a file for the first type it was saying "cannot option safely..." if chose Yes all my frensh special chars were messed up
-Hicham
right-click on Project -> Properties -> Sources -> Encoding
for maven project, put project.build.sourceEncoding in pom->project->properties
We had the same problem with Eclipse because of mixed Windows and Linux developers. If you use Java you have 3 options:
change to Unicode charset. Though we couldn't do that with Eclipse on Windows, maybe it works out for you. Linux should be usually on Unicode already.
change to Iso-8859-1 on Linux, seems to be compatible with CP1252
use the tool native2ascii to change non-ASCII-characters in strings to their explicit unicode representation (IMO this is the most robust solution, though it's Java only I guess)
The most easy way to solve this is by a terminal command
$ sudo sh netbeans-8.0.2-linux.sh
I am using msysgit on windows vista. I am still very new to it and on my first committed code to github another member said that all the tabs were replaced with spaces. Could it be possible that msysgit is changing this? I am editing the files in VS2008. Is is just come c sharp .cs files.
It's unlikely that msysgit replaced the tabs with spaces, that was more likely your editor settings.
You should configure your editor in such a way that you follow the established conventions of the project you're working with.
However, unless the file in question was a Makefile, my opinion is your editor settings are correct. :)