powered by Jive Software

Cannot support UTF8?

I use Chinese as login name, but spark cannot recognize it and the user cannot login. Use other client, It can.

Hi,

is it a problem with your username or with your password when you are using Spark?

I did create JM-694 some time ago but this is an Openfire and not a Spark issue and may be wrong.

LG

it’s probably not a problem of openfire.
I got same problem. A same username and password can login through sparkweb, but as spark it’s failed.
When I inserted some log in server. I find the username which sent by spark was unrecognizable, but with sparkweb, it’s well.
Maybe i should correct the problem by modifying the spark, but with distribution consideration, i don’t think this is a good idea. So i tried to decode it on server, but i failed, i tried all coding type.

Here is my code which inserted in openfire by me.

Log.info(username + “------->”);
Log.info(pattern.matcher(username).matches() + “—>”);
try {
Log.info(new String(username.getBytes(“iso-8859-1”),“gb2312”));
Log.info(new String(username.getBytes(“iso-8859-1”),“gbk”));
Log.info(new String(username.getBytes(“iso-8859-1”),“UTF-8”));
Log.info(new String(username.getBytes(“gbk”),“iso-8859-1”));
Log.info(new String(username.getBytes(“gbk”),“UTF-8”));
Log.info(new String(username.getBytes(“gbk”),“gb2312”));
Log.info(new String(username.getBytes(“gb2312”),“gbk”));
Log.info(new String(username.getBytes(“gb2312”),“utf-8”));
Log.info(new String(username.getBytes(“gb2312”),“iso-8859-1”));
Log.info(new String(username.getBytes(“UTF-8”),“gbk”));
Log.info(new String(username.getBytes(“UTF-8”),“gb2312”));
Log.info(new String(username.getBytes(“UTF-8”),“iso-8859-1”));
Log.info("??");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}

And the log output is:

login with sparkweb:

2009.01.04 16:25:17 ???------->
2009.01.04 16:25:17 true—>
2009.01.04 16:25:17 ???
2009.01.04 16:25:17 ???
2009.01.04 16:25:17 ¶ÎÓÀ±ó
2009.01.04 16:25:17 ???
2009.01.04 16:25:17 ???1?
2009.01.04 16:25:17 ???1?
2009.01.04 16:25:17 ???
2009.01.04 16:25:17 ??
2009.01.04 16:25:17 User name=???. password=**********

login with spark:

2009.01.04 16:28:36 ???------->
2009.01.04 16:28:36 false—>
2009.01.04 16:28:36 ???
2009.01.04 16:28:36 ???
2009.01.04 16:28:36 ???
2009.01.04 16:28:36 ???
2009.01.04 16:28:36 ???
2009.01.04 16:28:36 ???
2009.01.04 16:28:36 ???
2009.01.04 16:28:36 ??
2009.01.04 16:28:36 User name=???. password=**********