On Sep 8, 2004, at 4:45 AM, Tim Bunce wrote:

I was thinking of doing at least "0" on that list for DBI 1.44.

I'd especially like to do

  $dbh->{SetUTF8} = 2;

And be done with it.

I'll take a look. Patches welcome, of course!

Hey, if I knew any C...I can paste these from Encode.xs, at least:

_utf8_on(sv)
SV *    sv
CODE:
{
    if (SvPOK(sv)) {
        SV *rsv = newSViv(SvUTF8(sv));
        RETVAL = rsv;
        SvUTF8_on(sv);
    } else {
        RETVAL = &PL_sv_undef;
    }
}
OUTPUT:
    RETVAL

SV *
_utf8_off(sv)
SV *    sv
CODE:
{
    if (SvPOK(sv)) {
        SV *rsv = newSViv(SvUTF8(sv));
        RETVAL = rsv;
        SvUTF8_off(sv);
    } else {
        RETVAL = &PL_sv_undef;
    }
}
OUTPUT:
    RETVAL

PS: I assume that if I do:

  my $data = $utf8_data;

where $utf8_data has SvUTF8_on that $data will also have SvUTF8_on. Is
that correct?

Yes.

Great, I figured as much. Thanks!

David



Reply via email to