How do I convert form data from ascii/html unicode to a true Java unicode string.
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Dss_Dff
Posted On:   Monday, September 17, 2001 08:00 AM

How do I convert HTML form data from ASCII/HTML representation to a true Java Unicode string? I have a JSP that stores what should be a Unicode stream into a NCLOB. The insert happens fine, however the form that posts to it passes the stream as
党组夏季扩大会 which is exactly how it gets stored in the database. How can I convert this to standard Java Unicode?

Re: How do I convert form data from ascii/html unicode to a true Java unicode string.

Posted By:   Anonymous  
Posted On:   Tuesday, October 30, 2001 08:12 PM

Conversion from HTML escaped numeric entities is straightforward, if not particularly fun. One method that shows the basic concept, while not very efficient, would be to use String.startsWith() and String.indexOf() to find the beginning "&#" and ending ";", substring enclosed characters and set the Java ( Unicode ) char to the value of Integer.parseInt( theSubstring ).


To understand why this works, see What is a char?

Re: How do I convert form data from ascii/html unicode to a true Java unicode string.

Posted By:   mindterm_A  
Posted On:   Monday, October 1, 2001 12:11 AM

Please look at
http://www.angelfire.com/amiga/yores/

It maybe helpful to you.

M.T.
About | Sitemap | Contact