jEdit Community - Resources for users of the jEdit Text Editor
Problem with accents on Ubuntu Feisty
Submitted by gp on Thursday, 3 May, 2007 - 22:10

I am having a problem with foreign characters when using jEdit 4.3pre9 on Ubuntu Feisty. It's not strictly a jEdit problem, but I was hoping that someone here more experienced with Java could help me.

The problem is this: when typing characters with an accent, those characters come out wrong in Java apps. It appears to only affect Swing apps (jEdit, Zend Studio). Eclipse, which uses SWT, does render the accents correctly. Please note that this has nothing to do with character encoding settings in the apps themselves.

With Java 1.5, when typing an accented character, it is replaced with a totally different character (I usually get the blank square); with Java 6, accented characters are replaced with the non-accented equivalent (for example, what should be ă comes out as the letter "a"). There is one exception: accented characters from the Latin-1 (ISO 8859-1) character set, such as "ü", "é" etc. are rendered correctly.

I ran the apps on sun-java5-jre and sun-java6-jre (from the Ubuntu repositories), as well as on Java 1.5 downloaded directly from Sun. There is no difference.

Here's the output of jEdit's keyboard troubleshooting feature when I try to type the characters:

I am trying to type ă (U+0103). jEdit running on Java 1.5.

Event KEY_PRESSED,keyCode=0x41,keyChar=0x1e3,modifiers=0 x20,consumed=0 filtered
Event KEY_TYPED,keyCode=0x0,keyChar=0x1e3,modifiers=0x20 ,consumed=0 passed
==> Translated to <0,1e3>
Event KEY_RELEASED,keyCode=0x41,keyChar=0x1e3,modifiers= 0x20,consumed=0 passed

Same character, jEdit running on Java 6.

Event KEY_PRESSED,keyCode=0x0,keyChar=0xffff,modifiers=0 x0,consumed=0 filtered
Event KEY_PRESSED,keyCode=0x41,keyChar=0x61,modifiers=0x 20,consumed=0 filtered
Event KEY_TYPED,keyCode=0x0,keyChar=0x61,modifiers=0x20, consumed=0 passed
==> Translated to <0,61>
Event KEY_RELEASED,keyCode=0x0,keyChar=0xffff,modifiers= 0x20,consumed=0 passed
Event KEY_RELEASED,keyCode=0x41,keyChar=0x61,modifiers=0 x0,consumed=0 passed

Any help would be greatly appreciated.

Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
Solved
by gp on Fri, 04/05/2007 - 18:37

It turns out that Java/Swing only supports a few locales on Linux (see Supported Locales). If you happen to be in the wrong locale and you're having problems typing accented characters in jEdit, try this:

env -u LC_CTYPE jedit

User login
Browse archives
« April 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   82349
Context Free Art (*.cfdg)   0.31   46055
BBEdit scheme   1.0   18595
JBuilder scheme   .001   18495
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293