|
Description
|
This is fixed in 1.3
The cases in the bug report have definite problems with 1.2.2 but work fine
with 1.3. As stated in the evaluation, fixes to other bugs have updated the
exclusion ranges which prevented cyrillic characters being used in the logical
fonts, even if the underlying physical fonts contaiend those characters.
Platform: Win 95b German Version with Cyrillic support
(PanEuropean)
Cyrillic support is installed (Fonts, keyboard, etc)
Bug:
Cyrillic is not supported under JDK 1.2 RC2, RC1
Cyrillic symbols are not displayed and perhaps not
entered.
(Under JDK 1.2beta4 everything works fine. )
Code Example:
-----------------cut here -----------------------
import javax.swing.*;
public class Test extends JApplet
{
public void init()
{
JPanel testPanel = new JPanel();
JButton testButton = new JButton("Account \u0421\u0447\u0435\u0442");
JTextField testField = new JTextField("Cancel \u041e\u0442\u043c\u0435\u043d\u0430");
testPanel.add(testButton);
testPanel.add(testField);
setContentPane(testPanel);
}
}
-----------------cut here-----------------------------
My font.properties file:
# @(#)font.properties 1.10 98/10/09
#
# AWT Font default Properties for Windows
#
dialog.0=Arial,ANSI_CHARSET
dialog.1=Arial,RUSSIAN_CHARSET,NEED_CONVERTED
dialog.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
dialog.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
dialog.bold.0=Arial Bold,ANSI_CHARSET
dialog.bold.1=Arial Bold,RUSSIAN_CHARSET,NEED_CONVERTED
dialog.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
dialog.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
dialog.italic.0=Arial Italic,ANSI_CHARSET
dialog.italic.1=Arial Italic,RUSSIAN_CHARSET,NEED_CONVERTED
dialog.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
dialog.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
dialog.bolditalic.0=Arial Bold Italic,ANSI_CHARSET
dialog.bolditalic.1=Arial Bold Italic,RUSSIAN_CHARSET,NEED_CONVERTED
dialog.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
dialog.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
dialoginput.0=Courier New,ANSI_CHARSET
dialoginput.1=Courier New,RUSSIAN_CHARSET,NEED_CONVERTED
dialoginput.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
dialoginput.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
dialoginput.bold.0=Courier New Bold,ANSI_CHARSET
dialoginput.bold.1=Courier New Bold,RUSSIAN_CHARSET,NEED_CONVERTED
dialoginput.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
dialoginput.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
dialoginput.italic.0=Courier New Italic,ANSI_CHARSET
dialoginput.italic.1=Courier New Italic,RUSSIAN_CHARSET,NEED_CONVERTED
dialoginput.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
dialoginput.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
dialoginput.bolditalic.0=Courier New Bold Italic,ANSI_CHARSET
dialoginput.bolditalic.1=Courier New Bold Italic,RUSSIAN_CHARSET,NEED_CONVERTED
dialoginput.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
dialoginput.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
serif.0=Times New Roman,ANSI_CHARSET
serif.1=Times New Roman,RUSSIAN_CHARSET,NEED_CONVERTED
serif.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
serif.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
serif.bold.0=Times New Roman Bold,ANSI_CHARSET
serif.bold.1=Times New Roman Bold,RUSSIAN_CHARSET,NEED_CONVERTED
serif.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
serif.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
serif.italic.0=Times New Roman Italic,ANSI_CHARSET
serif.italic.1=Times New Roman Italic,RUSSIAN_CHARSET,NEED_CONVERTED
serif.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
serif.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
serif.bolditalic.0=Times New Roman Bold Italic,ANSI_CHARSET
serif.bolditalic.1=Times New Roman Bold Italic,RUSSIAN_CHARSET,NEED_CONVERTED
serif.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
serif.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
sansserif.0=Arial,ANSI_CHARSET
sansserif.1=Arial,RUSSIAN_CHARSET,NEED_CONVERTED
sansserif.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
sansserif.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
sansserif.bold.0=Arial Bold,ANSI_CHARSET
sansserif.bold.1=Arial Bold,RUSSIAN_CHARSET,NEED_CONVERTED
sansserif.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
sansserif.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
sansserif.italic.0=Arial Italic,ANSI_CHARSET
sansserif.italic.1=Arial Italic,RUSSIAN_CHARSET,NEED_CONVERTED
sansserif.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
sansserif.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
sansserif.bolditalic.0=Arial Bold Italic,ANSI_CHARSET
sansserif.bolditalic.1=Arial Bold Italic,RUSSIAN_CHARSET,NEED_CONVERTED
sansserif.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
sansserif.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
monospaced.0=Courier New,ANSI_CHARSET
monospaced.1=Courier New,RUSSIAN_CHARSET,NEED_CONVERTED
monospaced.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
monospaced.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
monospaced.bold.0=Courier New Bold,ANSI_CHARSET
monospaced.bold.1=Courier New Bold,RUSSIAN_CHARSET,NEED_CONVERTED
monospaced.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
monospaced.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
monospaced.italic.0=Courier New Italic,ANSI_CHARSET
monospaced.italic.1=Courier New Italic,RUSSIAN_CHARSET,NEED_CONVERTED
monospaced.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
monospaced.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
monospaced.bolditalic.0=Courier New Bold Italic,ANSI_CHARSET
monospaced.bolditalic.1=Courier New Bold Italic,RUSSIAN_CHARSET,NEED_CONVERTED
monospaced.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED
monospaced.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED
# name aliases
#
alias.timesroman=serif
alias.helvetica=sansserif
alias.courier=monospaced
# for backword compatibility
zapfdingbats.0=WingDings,SYMBOL_CHARSET
# font filenames for reduced initialization time
#
filename.Arial=ARIAL.TTF
filename.Arial_Bold=ARIALBD.TTF
filename.Arial_Italic=ARIALI.TTF
filename.Arial_Bold_Italic=ARIALBI.TTF
filename.Courier_New=COUR.TTF
filename.Courier_New_Bold=COURBD.TTF
filename.Courier_New_Italic=COURI.TTF
filename.Courier_New_Bold_Italic=COURBI.TTF
filename.Times_New_Roman=TIMES.TTF
filename.Times_New_Roman_Bold=TIMESBD.TTF
filename.Times_New_Roman_Italic=TIMESI.TTF
filename.Times_New_Roman_Bold_Italic=TIMESBI.TTF
filename.WingDings=WINGDING.TTF
filename.Symbol=SYMBOL.TTF
# DEFAULT font definition
#
default.char=2751
# Static FontCharset info.
#
fontcharset.dialog.0=sun.io.CharToByteCp1252
fontcharset.dialog.1=sun.io.CharToByteCp1251
fontcharset.dialog.2=sun.awt.windows.CharToByteWingDings
fontcharset.dialog.3=sun.awt.CharToByteSymbol
fontcharset.dialoginput.0=sun.io.CharToByteCp1252
fontcharset.dialoginput.1=sun.io.CharToByteCp1251
fontcharset.dialoginput.2=sun.awt.windows.CharToByteWingDings
fontcharset.dialoginput.3=sun.awt.CharToByteSymbol
fontcharset.serif.0=sun.io.CharToByteCp1252
fontcharset.serif.1=sun.io.CharToByteCp1251
fontcharset.serif.2=sun.awt.windows.CharToByteWingDings
fontcharset.serif.3=sun.awt.CharToByteSymbol
fontcharset.sansserif.0=sun.io.CharToByteCp1252
fontcharset.sansserif.1=sun.io.CharToByteCp1251
fontcharset.sansserif.2=sun.awt.windows.CharToByteWingDings
fontcharset.sansserif.3=sun.awt.CharToByteSymbol
fontcharset.monospaced.0=sun.io.CharToByteCp1252
fontcharset.monospaced.1=sun.io.CharToByteCp1251
fontcharset.monospaced.2=sun.awt.windows.CharToByteWingDings
fontcharset.monospaced.3=sun.awt.CharToByteSymbol
# Exclusion Range info.
#
exclusion.dialog.0=0100-20ab,20ad-ffff
exclusion.dialoginput.0=0100-20ab,20ad-ffff
exclusion.serif.0=0100-20ab,20ad-ffff
exclusion.sansserif.0=0100-20ab,20ad-ffff
exclusion.monospaced.0=0100-20ab,20ad-ffff
exclusion.dialog.1=0100-0400,0460-ffff
exclusion.dialoginput.1=0100-0400,0460-ffff
exclusion.serif.1=0100-0400,0460-ffff
exclusion.sansserif.1=0100-0400,0460-ffff
exclusion.monospaced.1=0100-0400,0460-ffff
# charset for text input
#
inputtextcharset=ANSI_CHARSET
(Review ID: 43288)
======================================================================
The exaple demonstrates that cyrillic works in AWT and does not work in Swing classes. Both examples used in bg_BG locale.
I have made a copy of font.properties.ru as font.properties.bg
Windows is configured with Bulgarian locale and bulgarian keyboard.
Run the examples, type something in CYR and press the button.
See the difference.
java version "1.2.1
"Classic VM (build JDK-1.2.1-A, native threads)
JAVA.EXE full version "JDK-1.2.1-A"
*** With Swing
public class testcyr extends javax.swing.JFrame {
/** Initializes the Form */
public testcyr() {
initComponents ();
pack ();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the FormEditor.
*/
private void initComponents () {//GEN-BEGIN:initComponents
// This code was developed using a non-commercially licensed version of NetBeans Developer 2.x.
// For details, see http://www.netbeans.com/non_commercial.html
addWindowListener (new java.awt.event.WindowAdapter () {
public void windowClosing (java.awt.event.WindowEvent evt) {
exitForm (evt);
}
}
);
getContentPane ().setLayout (new java.awt.BorderLayout ());
jTextField1 = new javax.swing.JTextField ();
jTextField1.setText ("jTextField1");
getContentPane ().add (jTextField1, "Center");
jButton1 = new javax.swing.JButton ();
jButton1.setText ("????");
jButton1.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
jButton1ActionPerformed (evt);
}
}
);
getContentPane ().add (jButton1, "South");
}//GEN-END:initComponents
private void jButton1ActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// Add your handling code here:
jButton1.setLabel(jTextField1.getText());
}//GEN-LAST:event_jButton1ActionPerformed
/** Exit the Application */
private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
System.exit (0);
}//GEN-LAST:event_exitForm
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField jTextField1;
private javax.swing.JButton jButton1;
// End of variables declaration//GEN-END:variables
public static void main(java.lang.String[] args) {
new testcyr ().show ();
}
}
*** with AWT
public class testcyr2 extends java.awt.Frame {
/** Initializes the Form */
public testcyr2() {
initComponents ();
pack ();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the FormEditor.
*/
private void initComponents () {//GEN-BEGIN:initComponents
// This code was developed using a non-commercially licensed version of NetBeans Developer 2.x.
// For details, see http://www.netbeans.com/non_commercial.html
addWindowListener (new java.awt.event.WindowAdapter () {
public void windowClosing (java.awt.event.WindowEvent evt) {
exitForm (evt);
}
}
);
setLayout (new java.awt.BorderLayout ());
textField1 = new java.awt.TextField ();
textField1.setText ("textField1");
add (textField1, "Center");
button1 = new java.awt.Button ();
button1.setLabel ("button1");
button1.addActionListener (new java.awt.event.ActionListener () {
public void actionPerformed (java.awt.event.ActionEvent evt) {
button1ActionPerformed (evt);
}
}
);
add (button1, "South");
}//GEN-END:initComponents
private void button1ActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button1ActionPerformed
// Add your handling code here:
button1.setLabel(textField1.getText());
}//GEN-LAST:event_button1ActionPerformed
/** Exit the Application */
private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
System.exit (0);
}//GEN-LAST:event_exitForm
// Variables declaration - do not modify//GEN-BEGIN:variables
private java.awt.TextField textField1;
private java.awt.Button button1;
// End of variables declaration//GEN-END:variables
public static void main(java.lang.String[] args) {
new testcyr2 ().show ();
}
}
(Review ID: 57923)
======================================================================
1. Run any Swing based application, for example, SwingSet demo.
2. SwingSet demo.
3. None
4. None
5. Sorry, I can't supply with this information right now. I'm using a standard JDK 1.2.1/Win32.
6. Windows 95 OSR2 (Russian release)
The problem is that Swing application is completely ignoring russian letters
both in output (4ex: menu text, button text, etc) by simply skipping any
non-english letters and in input (4ex: input box). Default locale is ru_RU, and, for example, AWT widgets doesn't
have such a problem. So I think this is Swing bug.
(Review ID: 84294)
======================================================================
=20
/*
I'm using JDK1.2.2 with HotSpot 1.0(last)
this bug was detected since 1.2 first release
what's the problem ? May I help something ?
Best regards. Andrey.
*/
import=09javax.swing.*;
import=09java.awt.*;
import=09java.awt.event.*;
class q extends JFrame{
=09q(){
=09=09super("QQQ");
=09=09addWindowListener( new WindowAdapter(){
=09=09=09public void windowClosed( WindowEvent e){
=09=09=09=09System.exit(0);
=09=09}});
=09=09Container con=3D getContentPane();
=09=09con.add( new JLabel("=D4=DB=C2=C0")); // Russian charset with ru_RU.C=
p1251 coding
=09}
=09public static void main( String[] args){
=09=09q instance=3D new q();
=09=09instance.pack();
=09=09instance.setVisible( true);
=09}
}
(Review ID: 84573)
======================================================================
Bug 4192443 (Cyrillic is not supported) again is not fixed in
JRE 1.3 beta
JRE 1.3 outputs only 3 ASCII characters in this program
(under Windows 95 and 98 PE) while JDK11 outputs 6 characters:
import java.awt.*;
public class Hello extends Frame
{
public Hello(int w,int h){ setSize(w,h); show();}
public void paint(Graphics g){ g.drawString("ABC\u0410\u0411\u0412",10,50);}
public static void main(String arg[]){ Hello h = new Hello(200,100);}
}
(Review ID: 95793)
======================================================================
|
|
Comments
|
Submitted On 07-DEC-1998
andyM
Platform:
Win95b German Version & !!! Russian Version
Cyrillic isnīt supported under JDK 1.2 Final Release
for WinXX
Submitted On 18-JAN-1999
lado
The same thing is with Cp1250
Submitted On 11-FEB-1999
WakeUp
I'm agry with all
Submitted On 22-FEB-1999
Kovalev
u must fix this!
Submitted On 06-APR-1999
mom040267
The same thing is with Win95/OSR2, Cp1251,
JDK1.2.1
Is this a kind of export restriction for Russia ?!
Submitted On 10-APR-1999
mbranko
JDK 1.2.1/Win98: Displaying East European, Greek or Cyrillic characters doesn't
work.
JDK 1.2.1/WinNT 4.0: Greek and Cyrillic characters are displayed correctly, but
Greek are converted to Latin.
Submitted On 19-MAY-1999
ost1
win98/cp1251/jdk1.2.1
Cyrillic isnt supported ?
Please, fix this BUG !
Submitted On 04-JUN-1999
Hedin
1.2.2 RC1 - problem is still exist...
Submitted On 15-JUN-1999
PedroD
NLS isn't what is supposed to be... a MUST fix!
Submitted On 16-JUN-1999
butthead
Nice, folks here do not allow literal HTML !
Ok use
<html>&ocirc;&agrave;&ecirc;</html>
to set JLabel text in JDK 1.2.2 for those
nice word :-)
Submitted On 16-JUN-1999
butthead
It is possible to work around this stupid
restriction in some cases.
Just use &lt;html&gt; tags and use &amp and
symbolic names for ASCII > 127.
See HTML spec.
It will works for JLabel at least.
Submitted On 16-JUN-1999
PedroD
Yes, you could also make a translator script to translate a-la Unicode, so that
the Java compiler don't translate 1251 to Unicode, but that's a half
solution... The report is dated Nov 1998, and it's not fixed yet... very, very
annoying!!!
Especially since it's in the Top 25!
Submitted On 18-JUN-1999
MUTbKA
PedroD, you are wrong. Java itself HAS a nice support to any codepage (see
switch -encoding in javac). This bug, IMHO, is somewhere inside JFC.
Submitted On 20-JUN-1999
PedroD
MUTbKA, yes, I know that you can force javac not to encode chars, but if you
have some texts which are shown on the status bar of the browser, these SHOULD
be encoded, opposite to those which are drawed with drawString. So you must
encode some of the chars, and not encode other chars... Complicated enough and
not for the faint of the heart!
Submitted On 20-JUN-1999
PedroD
My investigations showed that the problem is in
sun.awt.font.NativeFontWrapper.draw.... methods,
but since they are native, I can't look at the source. Please, fix the bug! :+)
Submitted On 20-JUN-1999
Hedin
Hello everyone!
I have found workaround. Bug is not in Swing, but in Java2D - it's incorrectly
draw strings with standart fonts supplied with Win9x (Arial, Courier, Times,
etc.). If you replace them in font.properties.ru, by Tahoma or Lucida Sans
Unicode - russian letters coming back. For example:
dialog.0=Tahoma,RUSSIAN_CHARSET
dialog.bold.0=Tahoma Bold,RUSSIAN_CHARSET
filename.Tahoma=TAHOMA.TTF
filename.Tahoma_Bold=TAHOMABD.TTF
Hope this helps, until they are fixing
this stupid bug (IMHO, problem can be solved
with several lines in AWT code.....).
Submitted On 21-JUN-1999
PedroD
Hedin,
THANKS! :+))
Submitted On 28-JUL-1999
slavik_ua
Mot dramatic for me is that i wrote a Russian and
Ukrainian string resources methods and they worked
properly in Java 1.1.8 under Win95, NT, and OS/2
After i installed new release - all characters
dissapeared.
Submitted On 20-SEP-1999
PedroD
It's fixed in JDK 1.3b. I hope they don't break it in the official release...
Submitted On 27-SEP-1999
sakva
NO !!! JRE 1.3 beta outputs only 3 ASCII characters in this program
while JDK11 outputs 6 characters:
import java.awt.*;
public class Hello extends Frame
{
public Hello(int w,int h){ setSize(w,h); show();}
public void paint(Graphics g){ g.drawString("ABC\u0410\u0411\u0412",
10,50);}
public static void main(String arg[]){ Hello h = new Hello(200,100);}
}
Submitted On 04-OCT-1999
Dmitry E. Karasev
Yes, I confirm. This bug is still present in 1.3beta.
Submitted On 28-DEC-1999
alukin
Part of this problem is still present in RC2 for Linux.
KOI8 does not get encoded in UNICODE.
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|