jEdit Community - Resources for users of the jEdit Text Editor
Inserting Unicode chars
Submitted by McSwell on Monday, 7 November, 2005 - 15:52
How do I insert a Unicode character, if I know the hex code for it?

For example, U+00E7 (= c cedilla), or U+0BB1 (in the Tamil range).

Things I have tried:

(1) Entering the Unicode codes (e.g. \U+00E7) into the replace field of the find-and-replace dlg. (IMHO, this is the way it *ought* to work; it's what you do in Visual Slickedit, for example.) But instead, this just gives me the string "\U+00E7" in my buffer.

(2) Copying and pasting from the Unicode consortium charts. But the charts are in PDF, and don't seem to support cut-and-paste. (I'm aware of Unibook, a wonderful tool, but for the moment I can't use that, for reasons I won't go into...)

(3) Modifying the code at http://community.jedit.org/?q=node/view/2115. Specifically, I tried doing a find/replace where the replace string is

(char)Integer.parseInt(0xe7,16)

(and variants thereof); but I get an error msg

Static method parseInt( int, int ) not found in
class'java.lang.Integer

Not being a Java programmer, I'm not sure what to do with this error msg. I suppose I need to install some Java code or other, but I'd really rather not do that (not to mention that this is a *really* clumsy way to do find-and-replace).

(4) Macros | Misc | HexConvert, entering the string
0xE7
(and variants...). But I get the error msg
0xE7 is not a valid hex string.
(If that isn't valid, what is?!!)

(5) The CharacterMap plugin. When I choose the 8859-1 encoding in this plugin's dlg box, I can paste in the c-cedilla (which fortunately happens to be the same hex code as the Unicode c-cedilla). But when I choose UTF-8 encoding, it only gives me the Basic Latin box, and trying to paste in s.t. from the high end of that gives me U+FFFD. And of course Tamil characters (etc.) are not in the Basic Latin part of Unicode.

So how do I enter arbitrary Unicode characters in jEdit? Please note that I'm not trying to set up a keyboard for this, I just have to enter a single character from time to time (or do find-and-replace, where either the 'find' or the 'replace' field contains a Unicode char).
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Here is how I do: Enter co
by pandadev on Tue, 08/11/2005 - 11:29
Here is how I do:
  1. Enter code in the text area: (char)0xe7 (where 0xe7 is a hex code), or (char)4321 (where 4321 is a base-10 index)
  2. Then select it and invoke Utilities->Beanshell->Evaluate Selection.
PS Make sure you have selected a unicode font, such as Arial Unicode MS for the textarea, under Global Options / Textarea
 
Entering Unicode chars: it works
by McSwell on Thu, 10/11/2005 - 13:35
Thanks!
User login
Browse archives
« September 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   97301
Context Free Art (*.cfdg)   0.31   46062
BBEdit scheme   1.0   18601
JBuilder scheme   .001   18502
ColdFusion scheme   1.0   18031
R Edit Mode - extensive version   0.1   17480
Advanced HTML edit mode   1.0   16212
Matlab Edit Mode   1.0   16075
jEdit XP icons   1.0   15235
XP icons for jEdit   1.1   14299