[Ietf-calsify] Status of simplification work

George Sexton gsexton at mhsoftware.com
Fri May 26 08:14:00 PDT 2006



Sam Roberts wrote:
> Quoting gsexton at mhsoftware.com, on Thu, May 25, 2006 at 03:30:59PM -0600:
>   
>> The proposed change simplifies things because programmers can simply write;
>>
>> for (int i=0; i < data.length; ) {
>>    stream.write(data[i++]);
>>    if ((i%75==0) && (i<data.length))
>>       stream.write("\n");
>> }
>>     
>
> Sorry, but that assumes that your data buffer is 16 bit unicode
> characters, which might be true for you in java but isn't true in the
> languages I work in. My library is written with its buffers being in
> utf-8, so when I split at the 75 octet boundary, it really is the 75
> octet boundary, and not necessarily at the 75 character boundary.
>
> If it was changed to 75 characters, the effect would be to complicate my
> code for much the same reasons the current definition complicates your
> code, I'd have to figure out how many "characters" are in the buffer.
>   
In my example, data is an array of characters. The Java I/O classes 
handle the conversion to the appropriate file encoding automatically.

-- 
George Sexton
MH Software, Inc.
Voice: +1 303 438 9585
URL:   http://www.mhsoftware.com/



More information about the Ietf-calsify mailing list