Hi all,

I have a simple servlet that at some point retrieves a parameter from the
request.  In a (thusfar futile) effort to get western europe characters to
work, I tried playing with getBytes to convert the encoding.  At the
suggestion of multiple people on the list, I added the following to my code:

   String paramValue = request.getParameter(paramName);
   if (paramValue != null) {
     try {
       byte[] bytes = paramValue.getBytes("ISO-8859-1");
       paramValue = new String(bytes, "ISO-8859-1");
     }
     catch (java.io.UnsupportedEncodingException uee) {
       throw new com.ttg.ParameterNotFoundException("Error encoding " +
parameterName + ": " + uee.toString());
     }
  }

I've also tried the above with "UTF-8".

But the simple act of putting this code in causes my servlet context to fail
to load!  I cannot understand it.  I've actually gotten two different
exception message as I've played around with this, either:

java.lang.ClassFormatError: com/ttg/TtgServlet (Illegal UTF8 string in
constant pool)

or

java.lang.ClassFormatError: com/ttg/TtgServlet (Illegal constant pool type)

Can anyone help??

Thanks!

-Richard


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to