Mahesh Patil wrote:
>
> Hi,
> Is there any function in Java to convert Ascii ( latin text ) to Unicode...
>
> Suppose
> String str = "Mahesh";
> I want to store this string str in a database as unicode character. Oracle
> 8i supports unicode data type ........Does anybody know how to do this in
> Java.
Java string are already Unicode strings I don't know Oracle,
but I think you can save string directly:
String mystring = "ABCD";
Connection con = DriverManager.getConnection (...);
PreparedStatement save = con.prepareStatement("UPDATE mytable SET mycolumn = ?");
save.setString(1,mystring);
save.executeUpdate();
If you want to save UTF-8 encoded text just use:
byte [] UNICODEbytes = mystring.getBytes("UTF-8");
Martin
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INET, a.s. Mgr. Martin Kuba
Kralovopolska 139 e-mail: [EMAIL PROTECTED]
601 12 Brno WWW: http://www.inet.cz/~makub/
Czech Republic tel: +420-5-41242414/33
--------------------------------------------------------------------
PGP fingerprint = D8 57 47 E5 36 D2 C1 A1 C3 48 B2 59 00 58 42 27
http://wwwkeys.cz.pgp.net:11371/pks/lookup?op=index&search=makub
--------------------------------------------------------------------
___________________________________________________________________________
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