[sldev] Limiting the length of string inconsistently

Alissa Sabre alissa_sabre at yahoo.co.jp
Sat Sep 8 05:10:25 PDT 2007


I filed a new JIRA issue, VWR-2367.

It is on the maximum message length of a Group Notice.  The point is,
that, when editing the notice, the maximum length of the message is
limited by the number of _characters_.  When the notice is sent, the
lower messaging layer checks the maximum length by the number of
_bytes_.

When editing, the maximum length is 511 characters.  The lower layer
limits the maximum by 1200 bytes (including some overheads).  Since,
one Japanese character occupy three bytes in UTF-8, Japanese Group
Notice messages with more than about 400 characters are truncated when
sent.

I can imagine three approaches to fix it.  Which fix is best?  I want
to know your opinions.

(a) Extend the messaging maximum to cover the worst case maximum.
    Because, a character can occupy four bytes in UTF-8 as a maximum,
    511 characters can be up to 2044 bytes.  Enlarge the lower layer
    limit to this value (plus some overhead.)

(b) Reduce the UI (editing) limit to the value that is guaranteed to
    pass the lower layer limit in worst case.  That is 1200 (minus
    some overhead) divided by four, i.e., around 250.

(c) Add a feature to a UI component (LLTextEditor) to limit the
    maximum size in bytes as opposed to in characters, and set that
    limit to a value around 1000.

If the way we should go is (b) or (c) above, I can write a fix.
However, if the correct fix is (a), I don't think it's doable by open
source developers, since I guess the server-side code should be
updated in sync.

    Alissa Sabre
--------------------------------------
Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar
http://pr.mail.yahoo.co.jp/toolbar/



More information about the SLDev mailing list