Change The Character Encoding [duplicate] - encoding

This question already has answers here:
How to use Special Chars in Java/Eclipse
(7 answers)
Closed 3 years ago.
I'm having some problems when i try to save my project in Eclipse. The error is because of the character encoding that is Cp1252 that is because i copyed the file from another that i have created in my Linux computer, then i cant save my file in Eclipse, but how i can solve this problem? But if is needed here is an screenshot of the error:
Encoding Error http://www.uploadimagens.com/upload/2dfccb154f30a1ccd39f2e3a9697e5cf.jpg
Thanks!

from this mail thread-->
dev.eclipse.org/mhonarc/lists/cdt-dev/msg16205.html
So I can reliably make the problem come and go using Preferences > C/C++ > Environment.
There I set LANG to en_US.UTF-8 (what it was from cmd line environment) then the problem comes back when i launch from Finder.
So launching from the command line, I can UNset it there (hit "Undefine" button for that env. variable which shows its value as !! )
to fix it.

Related

Go to current path in Console or PowerShell Terminal in VS Code [duplicate]

This question already has answers here:
VS Code - Shortcut to change the current directory in the PowerShell console to the currently opened file? [duplicate]
(1 answer)
How to quickly change shell folder to match the currently open file
(5 answers)
Closed 3 years ago.
Quick Question: Is there a shortcut key or an add-on for VS Code that updates the path in the integrated terminal to the path of the file that is currently open??
For example: Powershell in the integrated terminal always opens in my C:\Users\andy folder, but if I have a script in say c:\scripts\powershell\superdooperhacks\andysscript\ I need to cd through a lot of folders to get there (or prepend the command with the entire path).
The only quick way I found so far is to right click on the file and Reveal in Explorer and then open another Powershell session by right-clicking and... you get the idea. That means, I now have three windows open and it defeats the purpose of having an integrated shell.
Try Terminal Here add-on. Exposes the command terminalHere.create that creates a terminal at the current file's directory. This can be accessed through the command palette (ctrl/cmd+shift+p) or by attaching a custom keybinding to it.

NetBeans 11 and Encoding characters

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?

how to open emacs via OSX terminal [duplicate]

This question already has answers here:
How to launch GUI Emacs from command line in OSX?
(15 answers)
How to start "emacsformacosx" in terminal
(5 answers)
Closed 9 years ago.
how do you open emacs for OSX?
I have it downloaded in my Applications, but I don't know how to open it via my terminal (calling it "emacs test.cpp")..
I checked out some sites, but their solution didn't work for me.
I have this in my .bashrc (or .zshrc) file.
alias emacs="open -a Emacs.app"
ysakamoto's answer is correct.
I've taken it a step further, I'm using a shellscript using emacsclient to open a file in a running instance of Emacs, or launch a new one if there's none running. Alternatively, it just focuses Emacs/opens an empty session when I don't give it a file. Take a look.

How to make sure that the scripts I package in my War files are in Unix text format?

Last day I wrote a script so that my J2ee app could do backups. After deployment, the script was not working. I was wondering why, so I copied it from the deployment directory to my home dir. It was not even executing the first echo. That was strange because I tested the script on the very same machine. Later, after another SO question, I discovered that passing it through dos2unix would solve the problem. What happened was that I wrote the script on Linux, I did a simple copy and paste on Eclipse (running on windows), then I deployed the application (and the script was with /n/r the windows way).
How can I avoid this? I mean, I should write the script on Linux and not touch it at all (I'd like to have other options), or is there some special setting I could use?
You can set Eclipse to use Unix line-endings. http://www.sics.se/node/2108
Navigate to the Workspace preferences
(General:Workspace) Change the Text
File Encoding to UTF-8 Change the New
Text File Line Delimiter to Other and
choose Unix from the pick-list Note:
to convert the line endings of an
existing file, open the file in
Eclipse and choose File : Convert Line
Delimiters to : Unix

How to change the line ending used in Netbeans

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