1
  3   çˆl–Ðz¾”ªC]ŠqAàZ¸Ë*bÑ¿ŽþDòÎ6\#->éóÄ40ÃÈÀ  (    ç             )  Ò   ISO-8859-15   H   éˆl–ßi~”Jj"TÊ�zà¸©‹Fÿ�þ@³€yÑ²ØˆRÆ?çÅ0Äa–ßi~” T¾R( 	Å ‚ÆÄ¦-ÿÂ  5   ëˆl–ßi~”ÔD¨ 
ËŒ¹q–TÅ£�þC(Vn1’6äeq ?Ç497Æ¿Ã ñ    ëall.equal.Formula	Formula
as.Formula	Formula
as.Formula.default	Formula
as.Formula.Formula	Formula
as.Formula.formula	Formula
Formula	Formula
formula.Formula	Formula
is.Formula	Formula
length.Formula	Formula
model.frame.Formula	model.frame.Formula
model.matrix.Formula	model.frame.Formula
model.part	model.frame.Formula
model.part.Formula	model.frame.Formula
model.part.formula	model.frame.Formula
print.Formula	Formula
str.Formula	Formula
terms.Formula	model.frame.Formula
update.Formula	Formula
  1   íˆl–ßi~”Êa,jm@»q—î6â˜´o�þ@³‚+…A$®2÷óÈ0ÇÀÄ  5   ïˆl–ß=¿J
j"T% íÆÙ¸ËêbÑ¿�þB0¾³e�Ñ?+ÃqÂùÉƒqÇƒÈÁÅ     ï#!/usr/bin/perl -w

=head1 NAME

umap - map between different character sets

=head1 SYNOPSIS

 umap [options] <before>:<after>

=head1 DESCRIPTION

The I<umap> script acts as a filter between different encodings and
character sets.

The following options are recognized:

=over 4

=item --list [charset]

Without argument list all character sets recognized.  With a specified
character set list the mapping between this set and Unicode.

=item --strict

Do the stict mapping between the character sets.  The default is to
not translate unmapped character.  With I<--stict> we will remove
unmapped characters or use the default specified with I<--def8> or
I<--def16>.

=item --def8=<charcode>

Set the default 8-bit code for unmapped chars.

=item --def16=<charcode>

Set the default 16-bit code for unmapped chars.

=item --verbose

Generate more verbose output.

=item --version

Print the version number of this program and quit.

=item --help

Print the usage message.

=back

=head1 SEE ALSO

L<Unicode::String>,
L<Unicode::Map8>,
recode(1)

=head1 COPYRIGHT

Copyright 1998 Gisle Aas.

This is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.

=cut


use strict;
use Getopt::Long  qw(GetOptions);

my $VERSION = "1.05";

my $list;
my $strict;
my $verbose;
my $def8;
my $def16;
my $before;
my $after;

GetOptions('version' => \&print_version,
	   'help'    => \&usage,
	   'list:s'  => \$list,
	   'verbose' => \$verbose,
	   'strict!' => \$strict,
	   'def8=i'  => \$def8,
	   'def16=i' => \$def16,
	  ) || usage ();


if (defined $list) {
    if (length($list)) {
	list_charset($list);
    } else {
	list_charsets();
    }
    exit;
}

# Try to extract $before/$after from the remaining arguments
$before = shift || $ENV{UMAP_BEFORE} || "latin1";
if (!@ARGV && $before =~ s/([^\\]):/$1\0/) {
    ($before, $after) = split('\0', $before, 2);
}
unless ($after) {
    $after  = shift || $ENV{UMAP_AFTER}  || "utf8";
}
for ($before, $after) {
    s/\\:/:/g;
}
usage() if @ARGV;

print STDERR "$before --> $after\n" if $verbose;


#------------------------------------------------------------------
package MySpace;  # use a new namespace

use Unicode::String 2.00 qw(ucs4 ucs2 utf16 utf7 utf8);

my $bsub = \&{$before};

unless (defined(&$bsub)) {
    require Unicode::Map8;
    my $map = Unicode::Map8->new($before);
    die "Don't know about charset '$before'\n" unless $map;
    $map->nostrict unless $strict;
    $map->default_to16($def16) if defined($def16);
    no strict 'refs';
    *{$before} = sub {	$map->tou($_[0]); };
}

if ($after =~ /^(ucs[24]|utf16|utf[78])$/) {
    *out = sub { print $_[0]->$after(); };
} elsif ($after eq "hex") {
    *out = sub {
	my $hex = $_[0]->hex;
	$hex =~ s/U\+000a\s*/U+000a\n/g;
	print $hex;
    };
} elsif ($after eq "uname") {
    require Unicode::CharName;
    *out = sub {
	for ($_[0]->unpack) {
	    printf "U+%04X   %s\n", $_, Unicode::CharName::uname($_) || "";
	}
    };
} else {
    require Unicode::Map8;
    my $map = Unicode::Map8->new($after);
    die "Don't know about charset '$after'\n" unless $map;
    $map->nostrict unless $strict;
    $map->default_to8($def8) if defined($def8);
    #*out = sub {