From: Evan S. <ev...@dr...> - 2005-02-18 03:45:12
|
All my OSCAR group chats have the same maxmsglen and maxvislen values: (Libgaim: oscar) inside chat_info_update (maxmsglen = 2000, maxvislen = 232) In English, maxvislen is correct. Attempts to send messages which return a len greater than 232 will fail. This is true in iChat, AIM, and Gaim. The length in question is returned by reference by gaim_plugin_oscar_convert_to_best_encoding() in oscar_send_chat(). It is checked against c->maxvis (that is, the maxvislen) which equals 232 on all chats I have tried. Unfortunately, it seems that non-ascii test isn't properly considered in the maxvislen comparison. The maximum length of Japanese characters iChat will send yields a length of 638 within Gaim when the same characters are sent. Here's an example (junk) string: 。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉しかったん。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉しかったん。でも、彼女の 心が少し柔らかくされたようで、ちょっと嬉しかったん。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉しかったん。でも、彼女の心が少し柔らか くされたようで、ちょっと嬉しかったん。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉し、ちょっと嬉しっと嬉しょっと嬉しっと嬉しょっと嬉 しっと嬉し嬉しょっと嬉しっと嬉し嬉しょっ The succesfully-received sent HTML is: <HTML><body ichatballooncolor="#EBEBEB" ichattextcolor="#000000"><font face="Hiragino Kaku Gothic Pro" ABSZ=12 color="#000000">。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉しかったん。でも、彼女の心が少し柔らかくされたようで、 ちょっと嬉しかったん。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉しかったん。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉し かったん。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉しかったん。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉し、ちょっと嬉 しっと嬉しょっと嬉しっと嬉しょっと嬉しっと嬉し嬉しょっと嬉しっと嬉し嬉しょっ</font></body></HTML> Gaim receives that message just fine. Note that the number of characters sent is quite close to 232 -- my quick estimate puts it at 240. Copying the received text and sending it makes gaim_plugin_oscar_convert_to_best_encoding() in oscar_send_chat() return a len of 638 (in charset 2). This exceeds c->maxvis (that is, the maxvislen) at 232 so errors and refuses to send, even though it is clear that the protocol can handle the message. The sent HTML which fails is: <HTML><FONT FACE="Hiragino Kaku Gothic Pro" LANG="11" ABSZ="11" SIZE="3">。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉しかったん。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉しかっ たん。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉しかったん。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉しかったん。でも、彼 女の心が少し柔らかくされたようで、ちょっと嬉しかったん。でも、彼女の心が少し柔らかくされたようで、ちょっと嬉し、ちょっと嬉しっと嬉しょっと嬉 しっと嬉しょっと嬉しっと嬉し嬉しょっと嬉しっと嬉し嬉しょっ</FONT></HTML> (so as you can see, there's no bizarre HTML padding upping the string length). Removing the check against c->maxvis allows this 'oversized' Japanese string to be sent succesfully. Unfortunately, removing the check also means that attempts to send English strings greater than 232 fail silently. You have to get up to an extreme number (length over about 900) to actually receive a busted SNAC error. So does maxvis maybe really mean max visible quite literally, in terms of visible characters regardless of unicode or other space requirements? Thanks, Evan www.adiumx.com ---- FYI: Other data: The official AIM for Mac OS X, version 4.7, can also send significantly more than Gaim can, though significantly less than iChat can: 本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本 語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語本語本 That's the maximum characters it will let you enter... any more and it errors as you type, saying that you can't enter more text) The outgoing HTML is <HTML><FONT FACE="Hiragino Kaku Gothic Pro" LANG="11" ABSZ="11" SIZE="3">本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語 日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語本語日本語</FONT></HTML> , for a len of 394, still greater than 232. |