Guten Tag,
my problem is:
How can unicode be submitted from form fields in an adequate way to the
server?
I'm using the struts framework and trying to submit some unicode text in
a HTML form to the server. My Target is, to use that unicode characters
on the server (as parameter for a RPC to a lecacy application).
It is not a problem for me to display that unicode characters in the
browser by declaring:
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
and in the head:
<head><meta http-equiv="content-type" content="text/html;
charset=utf-8"></head>
But it is a problem to go the way in the other direction:
1. The IE5.5 (much better: Netscape 6) does not display the unicode
characters in the form field correctly (i. e. he shows something like
|||||||). BTW: I cut & paste the Unicode from the browser from a page
that displays unicode characters (s.a.).
2. When I submit the form, then I ask in the Action-Class for
request.getCharacterEncoding(), but the resulting String is null, even
though I specified in my JSP something like:
<form:form action="direktSuche.do" method="post" target="content"
enctype="text/plain;charset=UTF-8">. Why is getCharacterEncoding() ==
null??
3. When I read the form-field with the unicode data, I get:
�?���?�?���. I think, this is UTF-8, isn't it (I'm not sure)?
4. When I take exactly that string and display it again with a JSP-Page,
I get somthing other (Ӂƣ�?�?ƱƸƸ) than the original, from where I
cutted & pasted the characters (s. a.). Why?
Question: Must I convert the POSTed data before processing with it? Must
I implement some mechanism for converting UTF-8[??] to Unicode?
I greatly appreciate your help!
Chiao
Hartmut