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
Related
Netbeans 12.1 no longer respects the --fontsize directive in the /etc/netbeans.conf config file.
The menu fonts are way too small on a large screen.
Yet setting Preferences->LXQt Settings->Font->Point size in the Ubuntu control menu, which is normally respected by most Unix app windows, does not carry through either.
And although Netbeans's
Tools->Options->Fonts & Colors->Profile: NetBeans->Syntax->All Languages->Default -> Font
setting changes the font for the code itself inside the editor, it doesn't change the IDE menus.
You would think, after all these years, that there would be a command inside the Options to change the menu font size, but it's still not there yet.
And now editing config to change the --fontsize startup option is no longer respected.
How best to change the size of all the system fonts in the Netbeans IDE display environment?
The best solution I've found so far is to change the Look & Feel.
Invoking aptitude install netbeans currently (Sept '20) gives version 10, which breaks with a jcraft/jsch error, also "could not successfully run the /usr/bin/g++ compiler" on my system even though g++ is perfectly fine and protections cleared, also "Build Host not connected", after C++ is installed from the 8.2 repository. Tastes like some kind of jdk error (I've got /usr/lib/jvm both 8 and 11 jdks installed, hard to believe it can't find them). But if the install doesn't work right out of the box, it's a bad sign. So I tried snap install netbeans --classic . This gets version 12.
Netbeans version 12 comes with the Metal Look & Feel configured by default. Changing this to the GTK+ look and feel, using Tools->Options->Appearance->Look and Feel->GTK+ with a restart, finally got the menus to the correct system size.
Unfortunately, the Help->About popup still does not respect this, having minuscule fonts. Perhaps there is a better way?
Although "Look and Feel" is an improvement, I would still like to see direct control of the IDE menu fonts. From the Options Fonts & Colors menu.
Running netbeans from commandline with an additional argument --fontsize 12 works for me. Open a console and go the bin directory of netbeans and use the command ./netbeans --fontsize 12. Change the font size to whatever suits you.
In Netbeans in Tools->Options->Appearance->Look and Feel, I could solve the problem.
But in my case, the selected option already was GTK+. Changing to Metal solved it.
Install Netbeans 13.
It should help
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?
In Eclipse Luna (4.0.4) / Python 3.4.1 I can't get the PyDev 3.6.0 console to work with Unicode despite having tried several recommended corrective steps.
I attempted this example in Dive Into Python 3: http://www.diveintopython3.net/files.html
If I do the example's a_file.read(), the PyDev console displays:
'Dive Into Python \u662f\u4e3a\u6709\u7ecf\u9a8c......' instead of 'Dive Into Python 是为有经验的程序员编写的一本...'
If I paste the Chinese characters into the PyDev console ala cstring = '是为有经验的程序员编写的一本', then in the console type "cstring ENTER', I again get '\u662f\u4e3a\u6709\u7ecf\u9a8c...'
If I then try print(cstring), I get the following error:
Traceback (most recent call last):
File "", line 1, in
File "C:\Python34\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-13: character maps to
I don't know what do do with that information. The cp1252.py bit is at the heart of my confusion because I've told Eclipse and PyDev to use UTF-8 in every place I can find to do that, beginning with the information in the following:
Printing Unicode in eclipse Pydev console and in Idle
However, I cannot modify "site.py" as described in those steps because [EclipseInstallDir]/lib/site.py does not contain "encoding = ".
I can't figure out what to do next.
For regular runs:
The problem there is that the PYTHONIOENCODING is overridden by PyDev based on the encoding you used in the run configuration (which is the encoding used by the console view too -- so, it'd make no sense having a PYTHONIOENCODING with a value and the allocated console in the PyDev side with another value).
You can change the encoding you're using for a run configuration in:
Run > Run configurations > common > encoding.
By default it'll use the encoding of the file being launched (you can change the default encoding for the workspace in general > workspace > text file encoding).
For interactive console runs:
For interactive console runs there's currently no API to change the encoding in the java side, so, one has to start Eclipse itself in a VM that uses UTF-8 by default... In practice, this means that you have to add:
-Dfile.encoding=UTF-8
to the vmargs of Eclipse in eclipse.ini (and in this case it's also recommended to set the PYTHONIOENCODING environment variable in the related interpreter and set it to UTF-8).
Found it! (At least for Python 3.4.1, Eclipse Luna 4.0.4, PyDev 3.6.0.)
In Eclipse, in Preferences —> PyDev —> Interpreters —> Python Interpreter, in the Environment tab, I added the environment variable PYTHONIOENCODING and specified its value as utf-8.
The PyDev Interactive Console now properly displays the aforementioned Chinese characters (and Thai characters, too).
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.
Netbeans has this wiki entry on line endings: http://wiki.netbeans.org/FaqEditorEOLs
But it isn't very useful. It just says that you shouldn't develop on different OS and that's that...
In my situation however, I have no power over it. I'm on a windows machine and the PHP app I'm working on needs to end with the UNIX EOL.
There does not seem to be an option to set this for new files. Can anyone tell me where to set this?
Just saw that you can set this as a command-line startup flag: -J-Dline.separator=LF
I haven't tested this myself but I'm looking for ways to bake this into the configs somehow.
Since, a specific plug-in came out: http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=36810
I also like #JimLewis suggestion but I work on Windows with a linux virtual machine thus in some cases the versioning system line ending cannot help.
[update 201709]
I no longer use netbeans (sorry, but I need python support and it's too buggy) and almost no longer develop on windows, but #marinos-an in a comment suggests https://github.com/welovecoding/editorconfig-netbeans which uses a common setting file that can be picked up by multiple editors through plugins. Definitely interesting to try since the settings file is committable!
Have you considered managing the line endings at the version control level? Subversion,
for example, lets you set an "eol-style" attribute with values "LF", "CR", "CRLF",
and "native" (which translates the line endings stored in the repository to whatever
is appropriate for the platform where the files are being checked out, and converts
the other way when you check in.)
Please use following Netbeans Plugin
http://plugins.netbeans.org/plugin/36810/show-and-change-line-endings
fentie's answer solved my problem with line endings, as pasting multi-line MySQL from NetBeans into the MySQL command prompt caused errors.
To pass this argument to NetBeans every time it opens, add it to the netbeans.conf file:
/Applications/NetBeans/NetBeans\ 7.1.2.app/Contents/Resources/NetBeans/etc/netbeans.conf on OS X.
From the NetBeans Mac page under Tips & Tricks.
When I pasted multi-line SQL statements from NetBeans to the MySQL command line client on OS X or a remote Linux server, MySQL would list all possible command choices, give me some strange '> type of prompt and I was forced to hit Ctrl+C and log back into MySQL again.
For my Netbeans 12.6
I found a pluging called "Change Line Endings on Save"
https://plugins.netbeans.apache.org/catalogue/?id=31
more details are there
https://github.com/junichi11/netbeans-change-lf
once pluging installed you can configure EOL in there:
Tools > Options > Editor > Line Endings