Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipse-dev] Displaying Chinese Fonts

NOTE: This sort of question should be posted in the eclipse news groups, 
rather than the mailing list.

In 3.0.1 and earlier, the console encoding was not configurable. This has 
been fixed in 3.1. Please see the following bug report:

        https://bugs.eclipse.org/bugs/show_bug.cgi?id=69815

Darin



AJ <jr102@xxxxxxxxx> 
Sent by: eclipse-dev-admin@xxxxxxxxxxx
11/30/2004 08:51 PM
Please respond to
eclipse-dev


To
eclipse-dev@xxxxxxxxxxx
cc

Subject
[eclipse-dev] Displaying Chinese Fonts






All,

I've tried searching for an answer to this but can't
seem to find it anywhere. 

I have too support two client interfaces that both
need to support chinese data. One is an JSP that if I
set the content type in the jsp as follows it works
fine. 

<%@ page language="java"
contentType="text/html;charset=UTF-8"%>

However, from a java application I can't get the
chinese characters to display properly in Eclipse
3.0.1 (I'm using the stable build on windows 2000 -
english version. Also I can display chinese characters
inside wordpad. etc. fine without any problems.) The
problem is when I run a test by clicking on Run Test
in eclipse. The output in the console is garbage. I
also tried changing the fonts for the console too and
nothing seemed to work. 

Attached is my source code: If there is a
configuration issue I need to do on eclipse I would be
really appreciative if someone could assist me. I have
tried using UTF8, big5 and other encoding options but
nothing seems to work. Of if there is a program change
 I need to do please let me know. 

Any help would be appreciated. At this point I'm not
sure if its my code or eclipse configuration.

Thanks,

AJ

see attached code below;



class Test 
{
  public static void main (String s[])
    {
                 String scola=null;
                 String scolb=null;
      try {
        Class.forName("oracle.jdbc.OracleDriver");
       }
        catch (ClassNotFoundException e) {
            System.err.println (e) ;
            System.exit (-1) ;
        }
       try {

            // open connection to database
           Connection connection =
DriverManager.getConnection(
             "jdbc:oracle:thin:@localhost:1521:china",
             "system",  // ## fill in User here
             "fuckme11" // ## fill in Password here
            );
                                 System.out.println("Got connection....");
            // build query
            String query = "SELECT cola,colb From abc"
;

            // execute query
            Statement statement =
connection.createStatement () ;
            ResultSet rs = statement.executeQuery
(query) ;
 
            System.out.println ("Executed query and
retrieving results...") ;
            while ( rs.next () ){
                                    scola=rs.getString("cola");
               scola=new
String(scola.getBytes("Big5"));
               System.out.println(scola);

                                    //scolb=rs.getString("colb");
               //scolb=new
String(scolb.getBytes("GBK"));
               //System.out.println (scolb);
 
            System.out.println (rs.getString
("colb"));
 

 
              } connection.close () ;

        }
        catch (java.sql.SQLException e) {
            System.err.println (e) ;
            System.exit (-1) ;
 
        }

                 catch(UnsupportedEncodingException uee) {
                 uee.printStackTrace(); 
                 }
    }
}


 
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail
_______________________________________________
eclipse-dev mailing list
eclipse-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe 
from this list, visit
http://dev.eclipse.org/mailman/listinfo/eclipse-dev




Back to the top