CORBA-IDLtree

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


2.05  2021/06/13
      * Increase minimum required perl version to 5.8 due to
        addition of "use utf8".
      * Add handling of Windows CP-1252 character encoding in
        input file:
        - Add `use utf8`.
        - Require module Encode::Guess.
        - In sub get_items:
          - On encountering a non printable character call
            Encode::Guess->guess.
          - If the call returns a ref then a decoder was found
            and no special action is required.
          - If the call returns "No appropriate encodings found"
            then assign $l from Encode::decode("cp-1252", $l).
          - If the call returns none of the above then print a
            warning "Unsupported character encoding" and replace
            the non printable characters in $l by space.
        - In sub Parse_File_i case $file case $emucpp call to
          `open $in`, the encoding directive for UTF-8 is no
          longer needed due to use of Encode::Guess (see above).

lib/CORBA/IDLtree.pm  view on Meta::CPAN

#                   * On encountering unknown annotation, downgrade severity
#                     from error to warning.
# 2.05  2021/06/13  * Increase minimum required perl version to 5.8 due to
#                     addition of "use utf8".
#                   * Add handling of Windows CP-1252 character encoding in
#                     input file:
#                     - Add `use utf8`.
#                     - Require module Encode::Guess.
#                     - In sub get_items:
#                       - On encountering a non printable character call
#                         Encode::Guess->guess.
#                       - If the call returns a ref then a decoder was found
#                         and no special action is required.
#                       - If the call returns "No appropriate encodings found"
#                         then assign $l from Encode::decode("cp-1252", $l).
#                       - If the call returns none of the above then print a
#                         warning "Unsupported character encoding" and replace
#                         the non printable characters in $l by space.
#                     - In sub Parse_File_i case $file case $emucpp call to
#                       `open $in`, the encoding directive for UTF-8 is no
#                       longer needed due to use of Encode::Guess (see above).

lib/CORBA/IDLtree.pm  view on Meta::CPAN

    line:
    while (($l = <$in>)) {
        $line_number[$currfile]++;
        chomp $l;
        $l =~ s/\r//g;  # zap DOS line ending
        if ($firstline) {
            $l = discard_bom($l);
            $firstline = 0;
        }
        if ($l =~ /[^\t\f[:print:]]/) {
            my $decoder = Encode::Guess->guess($l);
            unless (ref $decoder) {
                # info($decoder);
                if ($decoder =~ /No appropriate encodings found/) {
                    $l = Encode::decode("cp-1252", $l);
                } else {
                    info "Unsupported character encoding - $decoder";
                    $l =~ s/[^\t\f[:print:]]/ /g;
                }
            }
        }



( run in 0.560 second using v1.01-cache-2.11-cpan-748bfb374f4 )