I have written a core java internationalization program but in eclipse console I am not able to see the out put message. The reason is its not ASCII code. I changed the console preferences to UTF-8 then also not able to see the result.
This issue is Windows-only and believe it or not, it is not related to console encoding. It is related to source file encoding.
In the Project Explorer (or Package Explorer, it doesn't matter) right-click on a source file and choose Properties. Alternatively, you can use Alt+Enter on a selected source file to activate the same dialog.
In the Properties dialog make sure that Resource tab is selected and at the bottom of this tab switch text file encoding to UTF-8 (by default it will be Windows-family encoding...).
Run the program again and that should do the trick.
Each file that does any printing must be encoded like that. Don't ask me why, I guess it has something to do with Eclipse long history of weirdness.
Related
I edited the settings file and there must have been a typo and now the app crashes on startup.
Online the documentation says the settings lives in $env:LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
I can't figure out what that path means since it doesn't exist on the computer.
I re-installed the app to fix the problem then made sure to see what the actual path is.
It's located in : C:\Users\{USERNAME}\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
In the current version (1.7.1033.0), the application can open the JSON settings file for you via a button. Open the Settings tab, and the bottom left corner will have a button named "Open JSON file". Clicking that button will open a prompt asking with what application to open the file. That text editor can then tell you where the file is located.
If you open the terminal settings, it will open a text editor with the settings.json file. If your default editor is VS Code it will show you the path below the tabs on the top of the screen.
I'm unsure what other editors show you the path, but if it is crucial you can change your default text editor to Code.
There is still the option to open the JSON file through settings. In version 1.15.2875.0 you can still find the "Open JSON file" at the bottom left corner
Screenshot with highlights
This hint was given by a comment by user1340531:
Mine is at C:\Users\{username}\AppData\Local\Microsoft\Windows Terminal\settings.json
(or more generically: %userprofile%\AppData\Local\Microsoft\Windows Terminal\settings.json)
If it's not there, you should consider OP's answer or vyps comment which lets you find out one of these generic paths (they are equivalent):
%userprofile%\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
%LocalAppData%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
$env:LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState
If you don't know what these paths mean, I'd recommend playing around with "Windows Run" (Win+R) and the explorer address bar.
In Notepad++ (Windows 7), is there a way to disable the Common File Dialog Box when saving a file? I would like to replace it with the standard Save File Dialog Box.
Notepad++ uses this dialog box for saving:
I would like to use the following dialog box:
Adding shortcuts to "My Place" bar is not an option as I don't plan to use the Common File Dialog Box at all.
The feature was implemented on 2017-01-30.
Settings > Preferences... > Default Directory > Enable "Use new style save dialog (without file extension feature)".
#Tamarindo94 found where the setting was a couple days ago:
https://github.com/notepad-plus-plus/notepad-plus-plus/issues/176#issuecomment-299876885
From the sounds of it this feature is on the books for the next release of Notepad++ once the support for XP goes away, details here: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/176
I noticed in Notepad++ they still don't have Favorites but they do have Libraries. My work around was to use Libraries instead of Favorites. You can actually add a Library that points to any folder you want. In Windows File Explorer on Windows 8, I had to go to Folder Options and check to turn on "Libraries" so that I could see them. Then I was able to right click and create Libraries pointed to the folders I wanted.
How do i set a default application to open a file with my preferred text editor? I am currently trying open file.rb. It opens text wrangler, but I want to open with another. How do i do this?
Go to finder, right click on your file.rb file and select Get Info.
In the Info Window you'll see a section that says Open with, expand that section. There you can change the default application to open that particular file. There's also a button labeled Change All... This button allows you to use the specified application for all similar filetypes (*.rb).
You want to use the name of the editor you want to open with, i.e. gedit file.rb, or vim file.rb. You can probably also change your default editor associated with that file type, depending on your OS, etc.
I much prefer Wordpad to Notepad in Windows 7 for quickly checking out source files, namely because Notepad doesn't display most correctly if the file was written in Unix.
However it saddens me that I can't chose the plain-text mode's default font.
Is there a way to change it? I'm guessing registry here, if at all.
Open a new document, set the default font and size, and save the file as
"wordpad.wri". Close wordpad. Right click on the saved file and select
Properties. On the general tab check read-only, apply your changes and
click OK.
Whenever you want to launch wordpad, do so by double clicking the saved
wordpad.wri.
[src: Tom Porterfield ]
You can change also the Icon of the shortcut, putting the icon of the Wordpad program, and to change also the name of the shortcut, so it will look as it's really the Workpad program.
Where can I set it? I need files to be encoded in UTF-8 by default... there is nothing in Tools -> Options or any other menu as far as I know :(
P.S. I don't need to set default encoding for Project or so, I need it to be default for any files I create. Thanks for your help :)
Instead of clicking save click save as. Then click the little down arrow by save to save with encoding. Once this is done it will bring you to the advanced save options which appear in full VS studio. You can then pick UTF-8 as the encoding.
The encoding options are available from a drop down list attached to the Save button when you select Save as..
File -> Advanced save options
Choose Encoding and Line endings
Regards,
Haris
I believe you cannot set the source encoding as a project setting. Instead, it tries to determine the source encoding from the file, using a fairly limited algorithm. Part of that algorithm is
if it has an UTF-8 signature (BOM), it is UTF-8 encoded
otherwise, it is in the ANSI system code page (CP_ACP)
There might be some additional checks in-between (e.g. checking for UTF-16 with BOM also).
In my experience, the "save as" encoding is not very useful, unless saving as UTF-8-with-BOM. You can save it in a different encoding, but in reopening, it will still assume it's CP_ACP.
IIRC, source files in visual studio are already encoded as UTF-8.
However, if I'm wrong or if you just want to force any specific coding, you can do it by choosing the Save As... option for the file and checking the pull down options under the save button from there.
Thank you for your answers but that's not exactly what I need.
Ok I will try to be more specific. That's how it goes: I go to Open website, I open website directly via FTP. On the right hand side I can see file list. I right-click on it, choose new item, html file, I have new html file. I add some text into it, click save (CTRL+S), the file is saved. Now I open it via browser and I see it's not saved in UTF-8. So, can I fix this problem in any way? :)
are you saying that even though the source file is encoded in utf-8, your internet browser is displaying it as ansi? do you have a meta encoding tag defined?
http://tlt.its.psu.edu/suggestions/international/web/tips/declare.html
try this and your browser should say it is utf-8. just saving a file in utf-8 won't do it.