# Revision history for Perl extension Encode.
#
-# $Id: Changes,v 1.95 2003/05/21 08:41:11 dankogai Exp $
+# $Id: Changes,v 1.96 2003/06/18 09:29:02 dankogai Exp $
#
-$Revision: 1.95 $ $Date: 2003/05/21 08:41:11 $
+$Revision: 1.96 $ $Date: 2003/06/18 09:29:02 $
+! lib/Encode/JP/JP.pm t/guess.t
+ m/(...)/ in void context then $1 is considered a Bad Thing
+ Message-Id: <B5AB34D0-A019-11D7-AF03-000393AE4244@dan.co.jp>
+! Encode.pm
+ Mentions in POD that as of perl 5.8.1 utf8::is_utf8() is
+ also available.
+! encengine.c
+ More typecast from maintperl@19739
+ Message-Id: <200306110645.h5B6j5D2009640@smtp3.ActiveState.com>
+! t/perlio.t
+ Tests 37 & 38 failed on Win32 -- yet another CRLF issue
+ Message-Id: <200306090733.h597XQPA031646@smtp3.ActiveState.com>
+! t/Encode.t
+ Now skips for EBCDIC platform.
+ Message-Id: <OF44B38062.A3998148-ON80256D27.004CF379@portsmouth.uk.ibm.com>
+! t/perlio.t
+ Craig's patch applied that addresses "Many systems (DOS, VMS) cannot
+ have more than one C<.> in their filenames." -- perlport.
+ Message-Id: <3ED79E01.8050401@mac.com>
+! bin/piconv
+ Found and fixed the back that -p,--perlqq does not work.
+ Induced by the change from Getopt::Std to Getopt::Long.
! encoding.pm
Addressed [cpan #2629] Wrong assumption in numeric comparison
Message-Id: <rt-2629-7326.19.5700583232515@cpan.org>
#
-# $Id: Encode.pm,v 1.95 2003/05/21 08:40:59 dankogai Exp $
+# $Id: Encode.pm,v 1.96 2003/06/18 09:29:02 dankogai Exp $
#
package Encode;
use strict;
-our $VERSION = do { my @r = (q$Revision: 1.95 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.96 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
our $DEBUG = 0;
use XSLoader ();
XSLoader::load(__PACKAGE__, $VERSION);
If CHECK is true, also checks the data in STRING for being well-formed
UTF-8. Returns true if successful, false otherwise.
+As of perl 5.8.1, L<utf8> also has utf8::is_utif8().
+
=item _utf8_on(STRING)
[INTERNAL] Turns on the UTF-8 flag in STRING. The data in STRING is
/*
- $Id: Encode.xs,v 1.55 2003/02/28 01:40:27 dankogai Exp dankogai $
+ $Id: Encode.xs,v 1.56 2003/06/18 09:29:02 dankogai Exp $
*/
#define PERL_NO_GET_CONTEXT
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Encode
-version: 1.95
+version: 1.96
version_from: Encode.pm
installdirs: perl
requires:
distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.10_03
+generated_by: ExtUtils::MakeMaker version 6.10_05
use warnings;
no warnings 'redefine';
-our $VERSION = do { my @r = (q$Revision: 1.39 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.40 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
use XSLoader;
XSLoader::load(__PACKAGE__,$VERSION);
/*
- $Id: Unicode.xs,v 1.7 2003/02/20 14:42:34 dankogai Exp dankogai $
+ $Id: Unicode.xs,v 1.8 2003/06/18 09:29:02 dankogai Exp $
*/
#define PERL_NO_GET_CONTEXT
#!./perl
-# $Id: piconv,v 1.26 2003/05/10 18:13:59 dankogai Exp $
+# $Id: piconv,v 1.27 2003/06/18 09:29:02 dankogai Exp $
#
use 5.8.0;
use strict;
-# $Id: encoding.pm,v 1.44 2003/03/09 20:07:37 dankogai Exp $
+# $Id: encoding.pm,v 1.45 2003/06/18 09:29:02 dankogai Exp $
package encoding;
-our $VERSION = do { my @r = (q$Revision: 1.44 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.45 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
use Encode;
use strict;
sub _exception{
my $name = shift;
- $] > 5.008 and return 0; # 5.8.1 then no
+ $] > 5.008 and return 0; # 5.8.1 or higher then no
my %utfs = map {$_=>1}
qw(utf8 UCS-2BE UCS-2LE UTF-16 UTF-16BE UTF-16LE
UTF-32 UTF-32BE UTF-32LE);
- $utfs{$name} or return 0; # UTFs or no
+ $utfs{$name} or return 0; # UTFs or no
require Config; Config->import(); our %Config;
return $Config{perl_patchlevel} ? 0 : 1 # maintperl then no
}
package Encode::Encoding;
# Base class for classes which implement encodings
use strict;
-our $VERSION = do { my @r = (q$Revision: 1.32 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.33 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
require Encode;
package Encode::JP::JIS7;
use strict;
-our $VERSION = do { my @r = (q$Revision: 1.10 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.11 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
use Encode qw(:fallbacks);
my ($obj, $str, $chk) = @_;
my $residue = '';
if ($chk){
- $str =~ s/([^\x00-\x7f].*)$//so;
- $1 and $residue = $1;
+ $str =~ s/([^\x00-\x7f].*)$//so and $residue = $1;
}
$residue .= jis_euc(\$str);
$_[1] = $residue if $chk;
#
-# $Id: Unicode.t,v 1.12 2003/05/21 08:41:11 dankogai Exp $
+# $Id: Unicode.t,v 1.13 2003/06/18 09:29:02 dankogai Exp $
#
# This script is written entirely in ASCII, even though quoted literals
# do include non-BMP unicode characters -- Are you happy, jhi?
use Encode qw(decode encode find_encoding _utf8_off);
#use Test::More qw(no_plan);
-use Test::More tests => 23;
+use Test::More tests => 29;
use_ok("Encode::Guess");
{
no warnings;
my $result = guess_encoding($test);
ok(! ref($result), "UTF-16$bl:$result");
}
+
+
+
+Encode::Guess->set_suspects();
+for my $jp (@jp){
+ # intentionally set $1 a priori -- see Changes
+ my $test = "English";
+ '$1' =~ m/^(.*)/o;
+ is(guess_encoding($test, ($jp))->name, 'ascii',
+ "ascii vs $jp (\$1 messed)");
+ $test = encode($jp, $test . "\n\x{65e5}\x{672c}\x{8a9e}");
+ is(guess_encoding($test, ($jp))->name,
+ $jp, "$jp vs ascii (\$1 messed)");
+}
+
__END__;