Unicode support in Eclipse GGTS IDE editor (how to input unicode math symbols) - eclipse

I would like to deal with floral formulae by my DSL coded in groovy, so I need some special symbols such as female sign and Superscripts and Subscripts.
Thanks to the great answers that I found on stackoverflow questions like this now I'm able to
insert special unicode symbols in source code in VIM (MacVim) this way:
CTRL+V. U 2 6 4 0.
However, I would like to be able to do the same in Eclipse IDE (I'm trying to use Groovy/Grails Tool Suite Version: 3.1.0.RELEASE to develop a grails project)
Question: How can I insert in the Eclipse editor a 4 digit unicode symbol by knowing the encoding ( without cut & paste from another source) ?

There appear to be a few ways to get the unicode characters on a Mac. The first few don't appear to be what you want exactly, but included for completeness.
1) Make sure System Preferences->Keyboard "show keyboard & character viewers in menu bar" is selected. Then you can click on that (normally accessible via option+cmd+T, but not in eclipse) to get the Character Viewer. You can then double-click a special character you want and it should insert at cursor.
2) Under the default setup, you should be able to click Option + key to get an alternate character. Use the keyboard viewer from #1 to see what maps to what. Note you can switch to some more mappings using Shift at the same time. This will only get you a subset of unicode characters.
3) From here: Under System Preferences->Languages & Text, go to Input Sources tab. Select the Unicode Hex Input source. You may need to assign switching input sources (under System Prefs->Keyboard->Keyboard Shortcuts->Keyboard) to a hotkey combo (default probably conflicts with spotlight, so change to something else). After that, you should be able to use said hotkey combo to switch to the Unicode Input Source - in that mode, you can hold Option down and enter a hex 4-digit key code, which will result in the character being placed at cursor.

Related

How enter symbols in VS Code for Lean (macOS)

I'm using Lean in VS Code under macOS Catalina with a U.S. keyboard. How do I enter symbols such as for the implication arrow, union, intersection, subset?
Is there some built-in or add-on palette to facilitate this? Or do I have to use Option key combinations and, if so, where do I find the appropriate codes?
From the Lean reference:
You can enter Unicode characters with a backslash. For example, \a inserts an α.
Here are some ways to get the symbol codes:
Guess. Many of the symbols have intuitive names, like \union or \cup for ⋃.
Use the tooltip. If you already have the symbol, then hovering over it will reveal the code.
If you don't have the symbol, right click > Go to definition on a related symbol will often land you close by.
If all else fails, check translations.json. You can usually get away with guessing, though.
⟶ System preferences
⟶ Keyboard
⟶ Input Sources Tab
⟶ + at bottom left
⟶ add and select Unicode Hex Input
from panel on right
 ⟶ enter unicode characters via alt+[code]
⟶ example, to enter the sign for union, hold down Alt and press 222a
To find additional codes, you can simply Google search Unicode Union for example, and it's almost always the first hit
https://www.google.com/search?q=unicode+Union&oq=unicode+Union&aqs=chrome..69i57.3027j0j7&sourceid=chrome-mobile&ie=UTF-8

Entering accented characters with notepad++ using only the keyboard

I am new to notepad++ and like it very much, since I can customize how my text documents look more easily than with wordpad. However, I would like to know if it’s possible to enter accented characters like in wordpad (I thought it was a windows thing, but perhaps it isn’t). In wordpad, I can type, for instance, ctrl-’ then i to get an accented í character. Similarly, I can type ctrl-shift-~ then n to get the accented ñ character. It makes it much easier to enter accented characters than copying and pasting from the character map application, or trying to remember code points. When I tried this method in notepad++ I just got the plain character without the accents. I should also mention that when I open documents with such accented characters already present they appear just as expected. Is there a way to enter accented characters like this in notepad++ using only the keyboard? I am using the latest notepad++ under Windows 7.
In Notepad++ you can go to “Edit” then select “Character Panel” near the bottom of the drop down menu. It will show you the ASCII set available which includes most accented characters. You find the character you want and there will be a number for it, to easily use that, press and hold your ALT key, then, on your keypad on the right side of your keyboard type zero followed by the number for that character. So for something like “ñ” for example, the code for it is 241, so you would press ALT and then type 0241 on the keypad while holding down ALT and you will get the character you need. That works in most Windows programs, even in here.
This only works for ASCII characters in the range of 0 to 255. I don't know of a method other than copying and pasting from the “Character Map” app available in Windows for Unicode. Though I did test Wordpad with the Decimal number of the Hex value you see for a Unicode character above 255 and it will work with the ALT+#### in there, and probably other places, but it doesn't work in Notepad or Notepad++ for some strange reason, sadly. Two I use a lot and have memorized are ALT+0147 and ALT+0148 for the quotation marks “like these”, so once you use the numbers enough you tend to get used to them, or you can jot down the ones you use the most.
For anyone searching for a solution and coming across this page, try this (Windows): install and use the US International keyboard instead of the plain US keyboard. Search for "windows keyboard us international install" or something similar. I liked the techlanguage.com write-up on it and the teckangaroo.com step by step on how to install. Hope this helps someone in future looking around as I was earlier today for how to easily meet this need.
You can make your own keyboard layout to enter arbitrary characters anywhere in Windows, using MSKLC. Here's one I made earlier.
I think it is configured in the input method. With input method containing the characters you mentioned, you can press key combinations to get special letters.
You can add a keyboard layout preset in Windows. Under "Language and Regions" - "Language" - "Language settings" - "Input method" settings in Control Panel, you can add all what you want. Like this:
Switch keyboard layout with Alt + Shift.

SWT KeyStroke to String

I am trying to convert a KeyStroke in SWT to a nice user presentation:
KeyStroke ks = org.eclipse.jface.bindings.keysKeyStroke.getInstance(SWT.CONTROL + SWT.SHIFT, SWT.F5);
which results in
CTRL+SHIFT+F5
Basically this works, however I have two concerns:
When I look at the Eclipse IDE, it shows keyStrokes like this: Ctrl+Shift+F5
I am wondering why the locale is not considered. I would expect the keyStroke to be Strg+Shift+F5 on a German locale
Any hints?
Eclipse calls
KeyFormatterFactory.setDefault(SWTKeySupport.getKeyFormatterForPlatform());
to set the key formatting to match the normal display for the platform. This may use 'Ctrl+Shift', on my Mac it uses '^⇧'.
This formatter is used by the KeyStroke.format() method. If you use the KeyStroke.toString() method you always get the upper case version.
Update:
The 'Ctrl'... names are looked up in resource bundle properties files so it should be possible to localize these but the default Eclipse download does not include any localization.

How can I clean source code files of invisible characters?

I have a bizarre problem: Somewhere in my HTML/PHP code there's a hidden, invisible character that I can't seem to get rid of. By copying it from Firebug and converting it I identified it as  or 'Zero width no-break space'. It shows up as non-empty text node in my website and is causing a serious layout problem.
The problem is, I can't get rid of it. I can't see it in my files even when turning Invisibles on (duh). I can't seem to find it, no search tool seems to pick up on it. I rewrote my code around where it could be, but it seems to be somewhere deeper in one of the framework files.
How can I find characters by charcode across files or something like that? I'm open to different tools, but they have to work on Mac OS X.
You don't get the character in the editor, because you can't find it in text editors. #FEFF or #FFFE are so-called byte-order marks. They are a Microsoft invention to tell in a Unicode file, in which order multi-byte characters are stored.
To get rid of it, tell your editor to save the file either as ANSI/ISO-8859 or as Unicode without BOM. If your editor can't do so, you'll either have to switch editors (sadly) or use some kind of truncation tool like, e.g., a hex editor that allows you to see how the file really looks.
On googling, it seems, that TextWrangler has a "UTF-8, no BOM" mode. Otherwise, if you're comfortable with the terminal, you can use Vim:
:set nobomb
and save the file. Presto!
The characters are always the very first in a text file. Editors with support for the BOM will not, as I mentioned, show it to you at all.
If you are using Textmate and the problem is in a UTF-8 file:
Open the file
File > Re-open with encoding > ISO-8859-1 (Latin1)
You should be able to see and remove the first character in file
File > Save
File > Re-open with encoding > UTF8
File > Save
It works for me every time.
It's a byte-order mark. Under Mac OS X: open terminal window, go to your sources and type:
grep -rn $'\xFEFF' *
It will show you the line numbers and filenames containing BOM.
In Notepad++, there is an option to show all characters. From the top menu:
View -> Show Symbol -> Show All Characters
I'm not a Mac user, but my general advice would be: when all else fails, use a hex editor. Very useful in such cases.
See "Comparison of hex editors" in WikiPedia.
I know it is a little late to answer to this question, but I am adding how to change encoding in Visual Studio, hope it will be helpfull for someone who will be reading this sometime:
Go to File -> Save (your filename) as...
And in File Explorer window, select small arrow next to the Save button -> click Save with Encoding...
Click Yes (on Do you want to replace existing file dialog)
And finally select e.g. Unicode (UTF-8 without signature) - that removes BOM

Double click text selection in CFEclipse

In CFEclipse, I do a lot of double-clicking to select text. The standard behavior is to select all text within the nearest word boundaries. This is problematic when editing code where the original editor didn't use camel-case; for example, they wrote "myObject" as "my_object".
Is there a way to change the double-click selection behavior to include '_' as a valid word character?
In the latest version of CFEclipse, there is now the option to define what characters are considered word boundaries when double-clicking, and also the option to use different characters when using alt or shift keys.
In Preferences, goto CFEclipse > Editor > Text Selection to update this:
(source: bpsite.net)
CFEclipse does not recognize either the underscore or a period as a character for selecting text with a double-click. There is no way that I know of other than rolling your sleeves up and hacking the editor code to change it. I doubt that this will be changed any time soon with the impending release of Bolt from Adobe.
On eclipse 3.4.1 Ganymede, it seems to select the nearest boundaries including the '_' (at least in the java file I am using)
What eclipse version are you using ?
This blog even reports that eclipse3.3 does select word as you are expecting it...
vs.