dev@fi.java.net

Re: Shrinking FIME :-)

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 13 Jul 2005 17:52:47 +0200

Changshin Lee wrote:
> Hi all,
>
> I made a decision on StAX ME and FIME that it supports UTF-8 only. The
> main reason is MIDP's minimal requirement of character encoding, i.e.,
> UTF-8. In fact, it's quite tough for a mobile device to support various
> character encodings, so I think UTF-8 is sufficient and necessary.
>

Note that fully conformant XML and FI parsers must support both UTF-8
and UTF-16 character encodings.

FI only supports UTF-8 for strings associated with element/attribute
names, namespaces etc. but can support UTF-8 or UTF-16 in the same
document for content (element content or attributes).

I would recommend trying to support both character encodings at least
for FI as it is not that complicated and does not result in a huge
increase in code for the support of both. For XML it may be a little
more so because of the layering design.

UTF-8 decoding is defintely more complex that UTF-16 decoding.

Perhaps it would be worth while concentrating on limiting the features
supported for the serialzier first.

If you want to use your parsers in production environments in the future
then it is worthwhile trying to get to strive to conformant
implementations. Some features like character validation seem less
important interop issues but the UTF-8/UTF-16 appears, to me at least,
more important as documents containing Korean, Japanese characters will
be smaller when encoded in UTF-16 than UTF-8.


>
> Could you give any advice and idea of making FIME as slim as possible?
> Paul and I already discussed XMLChars. (Thanks, Paul :-)
>

I do not have much experience with writing code for ME devices apart
from trying to reduce the amount of static (both in terms of classes,
fields) and runtime memory that is used.

Maybe this will help:

http://java.sun.com/developer/J2METechTips/2002/tt0226.html#tip1

I think it worth going the Decoder/Encoder and marking anything that is
not required or will not be supported for the ME implementation. Maybe a
complete fork is necessary if you want to bind more closely to StAX?? I
do not know yet, it requires some evaluation and experimentation.

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109