perl-unicode

[RFE] Fallback list for Encode::Guess

2002-09-23 01:30:04
Hi.  Recently I've becoming a heavy user of Encode::Guess;
my largest gripe with it is its non-overridable behaviour
to die when two or more encodings match, which is highly
inconvenient when you 'just know' if something matches
both latin-1 and big5, it must be latin-1.

What do you feel about adding a graceful fallback flag,
to let it remember the order of imported encodings, or
alternatively specifying another @PREFERRED_FALLBACK list.

    use Encode;
    use Encode::Guess qw/latin-1 big5 gbk/

    # Possibility 1
    $Encode::Guess::Fallback = 1;
    my $utf8 = decode("Guess", $data);  # prefer latin1, then big5

    # Possibility 2
    @Encode::Guess::Fallback = qw(big5 latin1);
    my $utf8 = decode("Guess", $data);  # prefer big5, then latin1

Would that feature be a sensible thing to have?

Thanks,
/Autrijus/

Attachment: pgpFL7EM54Yta.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>
  • [RFE] Fallback list for Encode::Guess, Autrijus Tang <=