ICU4JNI Proposal: Obsolete CharsetEncoderICU.canEncode methods

Ram Viswanadha <[email protected]> Wed, 26 Jan 2005 17:57:12 -0800
Newsgroups gmane.comp.lib.icu.general
Message-ID <[email protected]>
Expiry
------
2005-2-4

Proposal
--------
Obsolete the CharsetEncoderICU.canEncode methods.
a)public boolean canEncode(char c)
b)public boolean canEncode(int codePoint)

Motivation
----------
There are couple of problems with the above mentioned methods.
a)These methods currently override the super class implementations. To 
implement the contract correctly these methods need access to the status 
fields private to super class so as to interrupt an ongoing encoding 
progress. The default implementation in the super class is adequate.
b)The implementation does not change CodingErrorAction to "report" 
before invoking native method, and reset the both CodingErrorAction 
after that. Otherwise if the CodingErrorAction is "ignore" or "replace", 
the native method always return success.


Best Regards,

Ram Viswanadha