develooper Front page | perl.perl5.porters | Postings from January 2001

Re: One more patch for UTF8

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
January 9, 2001 09:06
Subject:
Re: One more patch for UTF8
Message ID:
20010109110548.A6541@chaos.wustl.edu
On Tue, Jan 09, 2001 at 04:47:18PM +0000, Nick Ing-Simmons wrote:
> Jarkko Hietaniemi <jhi@iki.fi> writes:
> >Well, I once added the string termination to uv_to_utf8().  Not just

s/Not just/Not/

> >that I feel that strongly about it, mainly it was just paranoia about
> >non-terminated strings.  Maybe we could add "= { 0 }" to all the utf8
> >temp buffers (which should be all of size UTF8_MAXLEN + 1).
> 
> FWIW 
> 
> char foo[10] = { 0 };
> 
> "means" set foo[0] to 0 and leaves foo[1..9] unspecified.
> Which is just what we don't want.

Ooops.  I blame early morning low brain activity.

> If array is global/static it is best to not intialize it at all
> as ".bss" is bulk initiallized to zero.
> If we really want this then use Zero(foo,sizeof(foo),char);

In this case maybe we want a wrapper, uv_to_utf8z().

> And if array is auto then initiallizing it isn't base-line C at all
> (though gcc can do it).

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About