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

RE: The State of The Unicode

Thread Previous | Thread Next
Paul Marquess
February 20, 2001 06:14
RE: The State of The Unicode
Message ID:
From: Nick Ing-Simmons []

> What I didn't tell you is utf8_length() is to be defined thus:
> MODULE = Encode, PACKAGE = Encode, PREFIX = Nicks_
> IV
> Nicks_utf8_length(sv)
> SV *	sv
> {
>  STRLEN len;
>  (void) SvPV_force(sv,len);  // its a string damn it!
>  sv_utf8_upgrade(sv);        // I want it encoded
>  SvUTF8_on(sv);              // even if there are no high-bits yet,
>  RETVAL = SvCUR(sv);         // now how long is it ...
> }

Will there be any impact on legacy .xs code that doesn't know anything about
the new UTF8 SV's? I'm thinking here of modules like Compresss::Zlib.

Hmmm, does this fall under the "if an XS sub expects bytes, it's the
responsibility of the person using the code to give them bytes".


Do You Yahoo!?
Get your free address at

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About