Hm, I tryed to do this:
URLDecoder.decode(hz, "cp1251")
And it works! Very strange why cp1251?
2007/5/16, Emmanuel Lecharny <[EMAIL PROTECTED]>:
Can you try to add the String in :
response.appendBody("тест") using escaped unicode ? ("\u" for each
char)
Just to check if it works better...
(don
Can you try to add the String in :
response.appendBody("тест") using escaped unicode ? ("\u" for each
char)
Just to check if it works better...
(don't worry about your english, I'm not sure there are a lot of english
natives working on Mina :)
Emmanuel
On 5/16/07, Opik <[EMAIL PROTECTED]> wrote
Hm, I use Netbeans, Default charset on it is UTF-8, option to compile is the
same - UTF-8. and I added the line to netbeans.conf - -
J-Dfile.encoding=UTF-8. So, all in UTF-8.
And if i append russians letters in the code:
response.appendBody("тест"); it's look OK, problem only with getting params
f
OK. look:
public void messageReceived( IoSession session, Object message )
{
try
{
HttpRequestMessage request = (HttpRequestMessage) message;
String hz = request.getParameter("test");
etc...
2007/5/16, Emmanuel Lecharny <[EMAIL PROTECTED]>:
Can you
Can you show us the code you used to create the hz String ? Are you typing
String hz = "абв" directly into your code ? In this case, you will have
problems, unless your file is saved as UTF-8 encoded. As a rule of thumb, if
you are using non-ascii chars into a String try to use the encoded Unicode
I tryed:
response.appendBody("QP.decode: " +
QuotedPrintable.decode( hz ));
response.appendBody("URLDecoder.decode: " +
URLDecoder.decode( hz , "UTF-8"));
With no result...
After URLDecoder.decode I have only "��" instead of russians letters.
Sources and other
Opik wrote:
> I use apache mina example (http codec server)
> I can't get a right UTF-8 charset from request. I get only %E0%E1%E2,
> (The
> right is абв), I tryed to use URLDecoder.decode(str, "UTF-8"), but the
> same
> error...
I think you need to URL decode the string first. %xx is an encoded
c
I use apache mina example (http codec server)
I can't get a right UTF-8 charset from request. I get only %E0%E1%E2, (The
right is абв), I tryed to use URLDecoder.decode(str, "UTF-8"), but the same
error...