Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Posts
    5

    Unanswered: Oracle - JSP: data encoding

    Hi all,

    I really need your help, I tried many times but still can't find out the answer. and this's my problem:

    My Oracle Database's NLS_LANG = AMERICAN.AMERICA.VN8VN3, and data stored in "SVNhelvetica" font.

    my JSP page try get data from Oracle Database by following methods:

    1/
    String name = new String(rs.getBytes("NAME"),"ISO-8859-1");

    2/ OR
    InputStream is = rs.getAsciiStream("NAME");
    InputStreamReader isr = new InputStreamReader(is, "ISO-8859-1");
    char []c = new char[25];
    isr .read(c);
    String name= new String(c);

    3/ OR with this way connect to Oracle Database:
    Properties prop = new Properties();
    prop.put("charSet", "ISO-8859-1");
    prop.put("user", strUserName);
    prop.put("password", strPassword);
    conn = DriverManager.getConnection(strConnect,prop);

    But still can't get the correct data.

    ContentType in jsp page is "text/html; charset=ISO-8859-1", I also tried all above with UTF-8 and Windows-1252 charset but still get notthing.


    Thanks much !

  2. #2
    Join Date
    Jul 2003
    Posts
    1

    Thumbs up Re: Oracle - JSP: data encoding

    Originally posted by vms
    Hi all,

    I really need your help, I tried many times but still can't find out the answer. and this's my problem:

    My Oracle Database's NLS_LANG = AMERICAN.AMERICA.VN8VN3, and data stored in "SVNhelvetica" font.

    my JSP page try get data from Oracle Database by following methods:

    1/
    String name = new String(rs.getBytes("NAME"),"ISO-8859-1");

    2/ OR
    InputStream is = rs.getAsciiStream("NAME");
    InputStreamReader isr = new InputStreamReader(is, "ISO-8859-1");
    char []c = new char[25];
    isr .read(c);
    String name= new String(c);

    3/ OR with this way connect to Oracle Database:
    Properties prop = new Properties();
    prop.put("charSet", "ISO-8859-1");
    prop.put("user", strUserName);
    prop.put("password", strPassword);
    conn = DriverManager.getConnection(strConnect,prop);

    But still can't get the correct data.

    ContentType in jsp page is "text/html; charset=ISO-8859-1", I also tried all above with UTF-8 and Windows-1252 charset but still get notthing.


    Thanks much !
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •