Ignore:
Timestamp:
2001-01-16T11:48:04+13:00 (23 years ago)
Author:
sjboddie
Message:

Added support for Cyrillic languages (windows codepage 1251) - yet to be
tested by anyone who understands any such language though ;)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/multiread.pm

    r1227 r1838  
    3232# iso_8859_6   - 8 bit arabic (iso-8859-6)
    3333# windows_1256 - Windows codepage 1256 (Arabic)
     34# windows_1251 - Windows codepage 1251 (Cyrillic)
    3435
    3536package multiread;
     
    188189    }
    189190
     191    if ($self->{'encoding'} eq "windows_1251") {
     192    # Windows 1251 (Cyrillic)
     193    return undef if (eof ($handle));
     194    return &unicode::unicode2utf8(&unicode::windows2unicode ("1251", getc ($handle)));
     195    }
     196
    190197    # unknown encoding
    191198    return undef;
     
    275282    return undef;
    276283    }
     284   
     285    if ($self->{'encoding'} eq "windows_1251") {
     286    # Windows 1251 (Cyrillic)
     287    my $line = "";
     288    if (defined ($line = <$handle>)) {
     289        return &unicode::unicode2utf8(&unicode::windows2unicode ("1251", $line));
     290    }
     291    return undef;
     292    }
    277293
    278294    # unknown encoding
     
    345361    return;
    346362    }
     363
     364    if ($self->{'encoding'} eq "windows_1251") {
     365    undef $/;
     366    my $text = <$handle>;
     367    $/ = "\n";
     368    $$outputref .= &unicode::unicode2utf8(&unicode::windows2unicode ("1251", $text));
     369    return;
     370    }
    347371}
    348372
Note: See TracChangeset for help on using the changeset viewer.