From: Nick Ing-Simmons [mailto:nik@tiuk.ti.com] ... > 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 > CODE: > { > 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 ... > } > OUTPUT: > RETVAL 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". Paul _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.comThread Previous | Thread Next