internationalization
I know it must be possible but I have not yet found the key.
I am able to write Hebrew to the client with and without the
setContentType-charset setting
but still cannot get Hebrew letters out of the RESULTSET and pass them on
to the user although Access is Hebrew enabled and in fact the search
pinpoints
the correct records. I have tried the regular getString and getAscii etc.,
have overwritten font.properties with font.properties.iw and tried all sorts
of other possibilities i.e., CharToByte from unicode (only in sun.io and
missing javai.dll in JDK1.2).
Please see ---->s below.
Any further help would be very much appreciated.
----> res.setContentType("text/html; charset=windows-1255");
//res.setContentType("text/html; charset=Cp1255");
//res.setHeader("Content-Language", "iw");
//Locale locale = new Locale("iw", "");
// DateFormat full =
DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG,locale);
String query = req.getParameter("query");
PrintWriter out = new PrintWriter(res.getOutputStream());
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:db3", "", "");
Statement stmt = con.createStatement ();
String mySQL = "select * from urls where descript like "+"'"+query+"'";
ResultSet rs = stmt.executeQuery(mySQL);
ResultSetMetaData rsmd = rs.getMetaData();
int numCols = rsmd.getColumnCount();
out.println("<table border=3>");
out.println("<tr>");
for (int i=1; i<=numCols; i++) {
out.println("<th>" + rsmd.getColumnLabel(i) + "</th>");
}
java.io.InputStream as;
char[] stringbuffer;
int b;
int offset = 0;
byte buf;
out.println("</tr>");
while (rs.next()) {
out.println("<tr>");
for (int i=1; i<=numCols; i++)
out.println("<th>"+rs.getString(i)+"</th>");
out.println("</tr>");
out.println("<tr>");
for (int i=1; i<=numCols; i++){
----> as = rs.getAsciiStream(i);
stringbuffer = new char[100];
try {
while ((b = as.read()) != -1){
buf = (byte) b;
stringbuffer[offset++] = (char) buf;
}
String er = String.copyValueOf(stringbuffer,0,offset);
out.println("<th>"+er+"</th>");
} catch (Exception e) {
System.out.println("error "+e.toString());
}
out.println("</tr>");
}
----> also tried rs.getUnicodeStream(i);
Morgan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html