doIMSend breaking Unicode?

1 view
Skip to first unread message

Jay Lynch

unread,
Apr 23, 2008, 10:44:14 AM4/23/08
to wimas3
Hi, sorry, only new to all of this, but I've been using the library to
work on an AS3/Flex client, and hit a hitch with non-English messages.
Localization/multi-lingual messaging is a big feature for us, and it
wasn't sending properly with unicode based messages.

Eventually managed to track it down to this:

protected function doIMSend(evt:IMEvent):void {
//store the event to represent the request data
var requestId:uint = storeRequest(evt);
evt.requestId = requestId;
var method:String = "im/sendIM";
var query:String =
"?f=amf3" +
"&aimsid=" + _session.aimsid +
"&r=" + requestId +
"&t=" + encodeURIComponent(evt.im.recipient.aimId) +
"&message=" + /*escape(*/
encodeURIComponent(evt.im.message)/*)*/ +
"&autoResponse=" + evt.im.isAutoResponse +
"&offlineIM=" + evt.im.isOfflineMessage;
_logger.debug("SendIMQuery: " + _session.apiBaseURL +
method + query);
sendRequest(_session.apiBaseURL + method +
query);
}

Switching the escaping on the "&message" part of the URI from escape()
to encodeURIComponent() fixes the problem, as seen above, but was
wondering if there might have been some justification for using it
that I'm not aware of?

There was mentions online of System.useCodePage having an effect on
the default escape() functionality, but I was unable to make it change
anything, the switch above seems to help without any real downside,
just thought I'd bring it up and see what people think.

Osman Ullah

unread,
Apr 23, 2008, 12:13:20 PM4/23/08
to wim...@googlegroups.com
Hey Jay,

Thanks for finding this. I think it was just overlooked on our part.
We'll do some testing, and if there aren't any issues we will update
our source.

Osman

Jay Lynch

unread,
Apr 25, 2008, 7:15:20 AM4/25/08
to wimas3
Thanks Osman, good to hear.

Are you guys looking for code contributions, also, things look pretty
dead, or is it in progress and not checked in yet, what's the current
status like?

I've been fleshing out some of the missing API calls, in particular
Data IMs and capabilities... They're still mostly useless pending a
resolution on an issue I'm having with setting capabilities ( Any help
much appreciated if anyone knows, btw: http://dev.aol.com/node/1284 )
but would be happy to share once they're up and running if nobody else
is working on it.

Shawn Carnell

unread,
Apr 25, 2008, 12:24:12 PM4/25/08
to wim...@googlegroups.com
First, Jay, do you drink beer?  If so, we owe you one for submitting our first patch contribution.

Wrt status, things are very, very alive.  We maintain two repositories, one is internal and gets updates frequently and then goes to our QA along with the client built on it.

We haven't pushed our updates out in a while because i haven't had a chance to check for backward compatibility, because some stuff only works internally, and because we've just been super-busy.  But, we are absolutely interested in contributions.   So, in the interest of the community, i just update the repository with our latest code.  This includes your patch (which fixed a bug we had logged internally, btw.)

This may break things (he said, cringing) but it will definitely get everyone up-to-date with our work so you can integrate yours.  

I'll try to get better about synching out our changes more frequently. 

Shawn

Shawn Carnell

unread,
Apr 25, 2008, 1:44:54 PM4/25/08
to wim...@googlegroups.com
I should note, too, that a good buddy of mine submitted some improvements for the Base64.as class that i simply haven't had a chance to review and integrate yet.  He sent it to me off list a while back.  He, too, is beer deserving.  :-)

It's Friday.  I could use a beer myself.

Shawn

Jay Lynch

unread,
Apr 25, 2008, 2:08:40 PM4/25/08
to wimas3
Hi Shawn, nice to meet you. And thanks, great to see things are alive
and kicking, was a little worried! Shall look forward to seeing more
updates.

> First, Jay, do you drink beer?  If so, we owe you one for submitting our
> first patch contribution.

Frequently, and with gusto, cheers. :)

For what it's worth, whilst I wouldn't claim anything like 100% usage
yet (Haven't really implemented buddy management yet), I did a quick
test checkout into the code being used by my current app and it runs
completely fine, with close to 0 changes. So at a minimum basic signin/
out, IMs, etc. should be without issue.

Only minor change needed was commenting out this oddity in the
session.as@602, or removing the "DEV::internal", perhaps something
slipped through processing before it got put up?

/*DEV::internal_only
{
queryString += encodeStrPart(",userAddedToBuddyList");
}*/

Looks like data and presence are largely unchanged, so I'll start
cleaning up the changes for the DataIMs, etc. and try to get some
proper tests happening, then hopefully once I've heard back about
what's going on with the server things will be close to ready for
public consumption.

Again, thanks for the quick replies, looking forward to things getting
a bit more lively around here!

Jay

Jay Lynch

unread,
Apr 25, 2008, 2:15:11 PM4/25/08
to wimas3
Great to hear it's spreading, if slowly...
I hear that though, we're getting well into Saturday here and just
wrapping up for the night... Might have to grab some on the way home.
Shame the group's not quite big enough to be throwing wimas3 nights
yet, perhaps one day! :)
Reply all
Reply to author
Forward
0 new messages