Date: Sat, 22 May 2004 21:38:33 +0900
Message-Id: <
20040522212704.C068.BQW10602@nifty.com>
Date: Sun, 23 May 2004 09:56:15 +0900
Message-Id: <
20040523095609.E404.BQW10602@nifty.com>
p4raw-id: //depot/perl@22842
use strict;
use vars qw($VERSION);
-$VERSION = do { my @r = (q$Revision: 2.0 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+$VERSION = '2.00_01';
use Encode qw(:fallbacks);
$ret .= pack 'a*', $tmp; # remove UTF8 flag.
}
elsif ($str =~ s/(.)//) {
- my $tmp = $GB->encode($1, $chk);
+ my $s = $1;
+ my $tmp = $GB->encode($s, $chk);
last if !defined $tmp;
if (length $tmp == 2) { # maybe a valid GB char (XXX)
if ($in_ascii) {
no warnings 'redefine';
use base qw(Encode::Encoding);
__PACKAGE__->Define('UTF-7');
-our $VERSION = do { my @r = (q$Revision: 2.0 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = '2.00_01';
use MIME::Base64;
use Encode;
if ($1 eq "+"){
$bytes .= "+-";
}else{
- my $base64 = encode_base64($e_utf16->encode($1), '');
+ my $s = $1;
+ my $base64 = encode_base64($e_utf16->encode($s), '');
$base64 =~ s/=+$//;
$bytes .= "+$base64-";
}
U8 *s, *t, *e;
int hibit = 0;
- if (!sv)
- return 0;
-
if (!SvPOK(sv)) {
STRLEN len = 0;
- (void) sv_2pv_flags(sv,&len, flags);
- if (!SvPOK(sv))
- return len;
+ (void) SvPV_force(sv,len);
}
- if (SvUTF8(sv))
+ if (SvUTF8(sv)) {
+ SvSETMAGIC(sv);
return SvCUR(sv);
+ }
if (SvIsCOW(sv)) {
sv_force_normal_flags(sv, 0);
/* Mark as UTF-8 even if no hibit - saves scanning loop */
SvUTF8_on(sv);
}
+ SvSETMAGIC(sv);
return SvCUR(sv);
}