From: <mo...@ic...> - 2011-06-01 18:27:46
|
Dear ICU team & users, I would like to propose the following API for: *ICU 49* Please provide feedback by: *Tuesday, 2011-06-14*. Designated API reviewer: *Markus* Ticket: http://www.icu-project.org/trac/ticket/8515 API proposal for CharsetEncoderICU: /** * Calculates the size of a buffer for conversion from Unicode to a charset. * The calculated size is guaranteed to be sufficient for this conversion. * * It takes into account initial and final non-character bytes that are output * by some converters. * It does not take into account callbacks which output more than one charset * character sequence per call, like escape callbacks. * The default (substitution) callback only outputs one charset character sequence. * * @param length Number of chars to be converted. * * @return Size of a buffer that will be large enough to hold the output of bytes * * @draft ICU 49 */ public int getMaxBytesForString(int length) This API is similar to the ICU4C's UCNV_GET_MAX_BYTES_FOR_STRING and is a port of that MACRO. -regards Michael |