How to change default encoding in NetBeans 8.0 [duplicate] - netbeans

This question already has answers here:
How to change file encoding in NetBeans?
(8 answers)
Closed 2 years ago.
I'm wondering if I can change default encoding in NetBeans 8.0... I searched a lot but I haven't find a way how to change the encoding in this version of NetBeans.
I have this tag in my html document:
<meta charset="utf-8">
BUT! As you can see on attached image, NetBeans notice is warning me about an encoding problem.
Internal encoding declaration "utf-8" disagrees with the actual encoding of the document ("windows-1250").
I created index.html by "new file" function in NetBeans. There is UTF-8 encoding in project properties, so I think it should be UTF-8. I really don't know where that 'windows-1250' came from!!
Where I can find some option to change default encoding or even current file encoding in NetBeans 8.0?

Solution given by Danny
Navigate to <Netbeans installation directory>/etc and open the netbeans.conf file.
Add -J-Dfile.encoding=UTF-8 at the end of the line that starts with netbeans_default_options (make sure to include the leading space).
Restart Netbeans and it should be in UTF-8
To verify go to help -> about and check System: Windows Vista version 6.0 running on x86; UTF-8; nl_NL (nb)

Answer here worked well for me on Netbeans 7.3 Stackoverflow Answer
Right click on the project name and click on properties. Sources tab -> Encoding and change it to whatever you need. In my case i needed Windows 1252 encoding.

I had the problem with a cyrillic characters (russian and ukranian letters) in netbeans 8.1 for Ubuntu 14.04. I have fixed problem like #Rex Wagenius adviced + I had to change a font of netbeans (in main menu: Tools -> Option -> Fonts&Colors -> Syntax tab -> Font changed from Courier to Serif 20). Hope this answer will be helpful for some users with the same problem.

Related

Apache Netbeans changing default delimiter

Despite having changed the pcs regional delimiter to a "." Netbeans 12 is still using a ",". I have tried adding the following to the netbeans.conf file but it has no effect:
-J-Duser.language=en -J-Duser.country=US
How do you force netbeans to use a particular local via the conf file?
I had changed the delimiter on win 10 but not the entire format for the pc. By changing the whole format to English UK, Netbeans honours the change.

error using doxygen and graphViz: problems opening map file

I'm using Doxygen-1.8.7, which i have downloaded from official website in dmg version. I'm using 10.9.3 MacOS. I have installed graphviz 2.38.0.0 via macports.
I use Doxygen GUI to configure it and run. Everything works great, if i choose "use build-in diagram generator". But when i use dot tool, i get this:
error: problems opening map file
/Users/pavelantonov/qtProjects/doxygen/result/11-06
1207/html/inherit_graph_21.map for inclusion in the docs!
I've tried to change SHORT_NAMES and FULL_PATH_NAMES as i find in solution from 2008, but it doesn't help.
GraphViz/bin is in paths.
There are no white spaces in *.dot names.
I got this message 'problem opening map file for inclusion in the docs', if doxygen is not able to find graphviz/dot in the path.
Try setting the path explicitly using DOT_PATH in the doxyfile.
As albert, already mentioned remove any whitespace in the path to the output path.
Another good idea is to completely remove your output directory, e.g. html, and regenerate your documentation.
It also seems that doxygen is for activating dot.exe space sensitive. Make sure your path is like this or at least without whitespaces:
D:/Graphviz2.38/bin
based on experience of Graphviz 2.38 on windows 10
The following method worked for me on Windows 10 with Doxygen 1.8.14.
Open cmd and type dot -c. Then, delete the doxygen output folder and regenerate it.
Make sure you have graphviz in your path. My graphviz is installed at C:\Program Files\Graphviz 2.44.1. So, there is no problem, even if spaces are there.

How do I add a BOM to all UTF-8 files in a project?

Current encoding is UTF-8 and I want to add BOM to all the files
Context: Windows 8 app certification toolkit throws following error, if BOM is not added:
File C:\x\y\z.js is not properly UTF-8 encoded. Re-save the file as UTF-8 (including Byte Order Mark).
If you are using IDE like eclipse or netbeans, you can select all files and set the encoding.
Other option is open all files in text editor and change.
I know this is an old question but here is how I did it:
create a php file: addBOMtoFile.php and add the following line:
file_put_contents("some_new_file_name.js", "\xEF\xBB\xBF" . mb_convert_encoding(file_get_contents("some_file_name.js"), "UTF-8", "UTF-8"));
C:\php>php addBOMtoFile.php

Encoding - Pydev changes character automatically

I am encoding every py script in my project to utf-8, as we are definitely migrating our application from Jython 2.2.1 to Jython 2.5.2. For that reason, I have added a 'magic comment' at the first line of every py file (#encoding=utf-8) and I have started testing whether everything is OK by debugging the application in Eclipse.
The problem appears in a script that contains the string straße, because it is automatically converted to straße.
My doubt is if this change is caused by Pydev or it happens because utf-8 doesn't cover this kind of characters.
What can I do to automatically avoid this issue with other 'strange' strings I haven't detected yet?
Are you sure your .py files use UTF-8 encoding? Try to open it with WebBrowser (as text) and check various encodings. While you see straße if seems that ß is encoded by two bytes (most probably UTF-8) but ensure it is really UTF-8.
Also check in Eclipse settings on Project/Properties. There is Resource panel with "Text file encoding" setting (I use Eclipse only for Java projects and do not know if Pydev uses this setting).
Try such code with PyDev and check if result file contains UTF-8 text:
# -*- coding: utf8 -*-
import codecs
f = codecs.open('strasse.txt', 'wb', 'UTF-8')
f.write('straße'.decode('UTF-8'))
f.close()
My guess is that you had a different encoding at that file (say cp1252, which is the default windows encoding) and when you put utf-8 it became garbled (so, it wasn't really PyDev who garbled it, but the fact that it was previously in another encoding).
While you're at it, also make sure you also set the default encoding for Eclipse to utf-8 (which is usually the default platform encoding) -- you can do this at preferences > general > workspace.
As a note, I believe the most common way of putting that comment is #coding: utf-8, followed by #-*- coding: utf-8 -*- (i.e.: not #encoding:utf-8) -- although all those formats work (see pep: https://www.python.org/dev/peps/pep-0263/)

Zend Studio for eclipse - Switch character encoding for all files in a project

I'm using Zend Studio for Eclipise on Mac, and it seems to keep setting all files to have and encoding of 'Mac Roman'. This becomes problematic when I save the files, as they all need to be UTF-8.
I know how to change the encoding to UTF-8 on a file by file basis, but I was wondering if I could set this project wide?
Eclipse-Wide: Window->Preferences->Appearence->Workspace
Project-Wide: Rightclick on Project->Properties
Filewide: Rightclick on File->Properties
On my Eclipse for PHP Helios SR 2 for Mac:
Eclipse-Wide: Eclipse->Preferences->General->Workspace
The others are the same as #SkaveRat
On a Zend Studio 8.x,for Mac osx 10.5.8 I changed it like this:
Top menu chose: Edit->Set encoding->Other: UTF-8,. By default it is set Mac Roman.
And then apply.
Just remember, php does not actually support utf-8 encoded sourcefiles.
When creating strings in a utf-8 encoded file, php will just see 2 static bytes per character.
Try running the following with either utf-8 or ISO-8859-1 enconding.
strlen() will report different lengths depending on encoding.
<?php
$string = "äüö";
echo (strlen($string));
?>