ModuleMessage Encoding Problem.

Added by Antonio Yeom 1040 days ago

I have a problem with communicating through ModuleMessage.
I'm Korean so I need UTF-8 Encoding.
Whenever I use UTF-8 encoding, it always have problems. :(

When I did it with just digit and english letter, it works well.
and Just pass-through Messages also work well.(including DB fetched data)

I want to store some datas which is UTF-8 encoding into database.
I used sendModuleMessage Method in Room Class.

In server-side, i tried to solve this
1 title = evt.getMessage().getArg("title").toString();
and
1 title = new String(evt.getMessage().getArg("title").getBytes("UTF-8"));
and changing db string, etc.
Eventually, I thought there would be bug in Message class in Union Server.

Could you check it for me?

Thanks.
Antonio.


Replies

RE: ModuleMessage Encoding Problem. - Added by Antonio Yeom 1040 days ago

I fixed it temporary using encodeURI() in Flash, java.net.URIDecode.decode().
:)

RE: ModuleMessage Encoding Problem. - Added by derek clayton 1040 days ago

Hi Antonio,

To clarify, are you saying it works correctly when you pass through Korean characters? (Eg. you type in Korean characters in a chat application and they appear ok)

Thanks,

Derek

RE: ModuleMessage Encoding Problem. - Added by Antonio Yeom 1039 days ago

When I test on the third example in union web site, typing in Korean and appearing are okay.
Room creation with an attribute which is written in Korean, It's also okay and I can see that attribute correctly.
Client attribute setting in Korean using Client.setAttribute Method also works fine. I can see this attribute on all of joined client.

Thanks.
Antonio.

RE: ModuleMessage Encoding Problem. - Added by Antonio Yeom 1039 days ago

I missed the point. :(

When I check in server-side-module, All of attributes are broken.
Just fine in Flash movie.

I think it would be caused Object.toString() method in java.

Antonio.

RE: ModuleMessage Encoding Problem. - Added by Antonio Yeom 1039 days ago

I sorry I made you confused, if i did.

I did :(

I changed java compile option with "-encoding utf8"
and code
title = new String(evt.getMessage().getArg("title").getBytes(), "UTF-8");

I was confused this getByte to String encoding.

Anyway It's works well, and Union platform is innocent.

Thanks for your effort.

Antonio.