package Encode;
use strict;
- our $VERSION = do { my @r = (q$Revision: 1.50 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+ our $VERSION = do { my @r = (q$Revision: 1.51 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
our $DEBUG = 0;
+use XSLoader ();
+XSLoader::load 'Encode';
-require DynaLoader;
require Exporter;
-
-our @ISA = qw(Exporter DynaLoader);
+our @ISA = qw(Exporter);
# Public, encouraged API is exported by default
}
require Encode::Encoding;
+@Encode::XS::ISA = qw(Encode::Encoding);
-eval {
++# This is very dodgy - PerlIO::encoding does "use Encode" and _BEFORE_ it gets a
++# chance to set its VERSION we potentially delete it from %INC so it will be re-loaded
++# NI-S
++eval {
+ require PerlIO::encoding;
+ unless (PerlIO::encoding->VERSION >= 0.02){
+ delete $INC{"PerlIO/encoding.pm"};
+ }
+ };
+ # warn $@ if $@;
1;
}
case ENCODE_NOREP:
/* encoding */
- if (dir == enc->f_utf8) {
+ if (dir == enc->f_utf8) {
STRLEN clen;
UV ch =
- utf8n_to_uvuni(s+slen, (SvCUR(src)-slen), &clen, UTF8_ALLOW_ANY|UTF8_CHECK_ONLY);
- utf8n_to_uvuni(s+slen, (SvCUR(src)-slen),
++ utf8n_to_uvuni(s+slen, (SvCUR(src)-slen),
+ &clen, UTF8_ALLOW_ANY|UTF8_CHECK_ONLY);
if (check & ENCODE_DIE_ON_ERR) {
Perl_croak(
- aTHX_ "\"\\N{U+%" UVxf "}\" does not map to %s, %d",
+ aTHX_ "\"\\N{U+%" UVxf "}\" does not map to %s, %d",
ch, enc->name[0], __LINE__);
}else{
if (check & ENCODE_RETURN_ON_ERR){
}
}
/* settle variables when fallback */
- d = (U8*)SvEND(dst);
- dlen = SvLEN(dst)-ddone-1;
- s = (U8*)SvPVX(src) + sdone;
+ d = (U8 *)SvEND(dst);
+ dlen = SvLEN(dst) - ddone - 1;
- s = (U8*)SvPVX(src) + sdone;
++ s = (U8*)SvPVX(src) + sdone;
slen = tlen - sdone;
break;