List Info

Thread: XS question




XS question
user name
2006-09-29 14:01:26
hi all,

what length will I get in the following case:

data = SvPV(my_sv, PL_na);
size = (int)PL_na;

if my_sv is encoded internally in UTF8.
Will it be the character size or the binary
size ?

Thomas.

XS question
user name
2006-09-29 15:15:16
On Fri, Sep 29, 2006 at 04:01:26PM +0200, Thomas Busch
wrote:
> hi all,
> 
> what length will I get in the following case:
> 
> data = SvPV(my_sv, PL_na);
> size = (int)PL_na;

Don't use PL_na.
Create your own local variable. PL_na kicks out to thread
local storage in
a threaded perl, to maintain source compatibility with
mistakes in older
Perl versions

> if my_sv is encoded internally in UTF8.
> Will it be the character size or the binary
> size ?

The binary size. Octets.

Nicholas Clark
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )