[imp] address book -> compose window

Rong-En Fan rafan at csie.org
Mon Sep 6 10:35:58 PDT 2004

On Sun, Sep 05, 2004 at 09:35:53PM +0800, Rong-En Fan wrote:
> my issue is two fold,
> first javascript's unescape is NOT multibyte
> safe. If any contacts in a group contain
> multibyte words, after calling updateMessage()
> in contacts.inc, the name become a mess.
> after some study, it seems impossible to do
> reassemble the multibyte word by two ascii
> values.

Current implementation in contacts.inc is
not multibyte friendly. The reason is that,
the option's value uses php's rawurlencode()
which encode string byte by byte. Then,
the value goes to updateMessage(), it uses
unescape() to decode the option value.
But in ECMA spec, string is multibyte-aware,
when it comes to escape(), it produces output
like %uXXXX (You can take a look at mozilla's
source: js/jsstr.c).

My currently fix is to break HTML's spec:
use raw multybyte string in option value and
quoted by ''. Then, add escape() in addAddress().
In this way, updateMessage() can correctly
unescape multibyte words.

I have been thinging this problem for few days,
but I can not figure out a good way to solve
this. Hope somebody can fix this. Thanks.

Rong-En Fan

More information about the imp mailing list