Здравствуйте M.,
Monday, June 04, 2001, 2:17:03 AM, Вами было написано следующее письмо:
MA> Dear All,
MA> I'm building a mutilaguage website in which i use UTF-8 as the charset for my
MA> servlet but the getParameter() method uses ISO-8859-1 as its default encoding
MA> which results in the unicode characters not found in ISO-8859-1 are mapped
MA> incorrectly to different characters. Such as the special german characters for
MA> each mapped to two incorrect characters. So, how can i enforce the
MA> getParameter() to use UTF-8 to generate valid unicode characters ?
MA> Any help will be appreciated.
private String qparamNormalized = ""; //normalized string
public synchronized String normalize(String string) {
if (string == null) return " ";
else return string;
}
public String convert( String qparam )
{
qparamNormalized = normalize( qparam );
try {
parametr = qparamNormalized.getBytes( "ISO-8859-1" );
s = new String( parametr, 0, parametr.length,
"utf-8" );
} catch ( Exception e )
{
System.out.println(e.toString());
}
if (s.length() != 0) return s; else
return " ";
}
--
С уважением,
Dmitri mailto:[EMAIL PROTECTED]
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>