Changeset 1838


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 ;)

Location:
trunk/gsdl
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/macros/pref.dm

    r1717 r1838  
    349349  <option value="g" _If_("_cgiargw_" eq "g",selected)>GBK
    350350  <option value="a" _If_("_cgiargw_" eq "a",selected)>Arabic (windows 1256)
     351  <option value="c" _If_("_cgiargw_" eq "c",selected)>Cyrillic (windows 1251)
    351352</select>
    352353}
  • 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
  • trunk/gsdl/perllib/plugins/BasPlug.pm

    r1756 r1838  
    5454    print STDERR "                        unicode (just unicode -- doesn't currently do endian\n";
    5555    print STDERR "                                 detection)\n";
     56    print STDERR "                        windows_1251 (Windows codepage 1251 (Cyrillic))\n";
    5657    print STDERR "   -process_exp      A perl regular expression to match against filenames.\n";
    5758    print STDERR "                     Matching filenames will be processed by this plugin.\n";
     
    8788
    8889    my $self = {};
    89     my $encodings = "^(iso_8859_1|Latin1|ascii|gb|iso_8859_6|windows_1256|Arabic|utf8|unicode)\$";
     90    my $encodings = "^(iso_8859_1|Latin1|ascii|gb|iso_8859_6|windows_1256|Arabic|utf8|unicode|windows_1251)\$";
    9091    $self->{'outhandle'} = STDERR;
    9192    my $year = (localtime)[5]+1900;
  • trunk/gsdl/src/recpt/librarymain.cpp

    r1649 r1838  
    123123
    124124  // arabic
    125   text_t armapfile = filename_cat (gsdlhome, "unicode", "MAPPINGS");
    126   armapfile = filename_cat (armapfile, "WINDOWS", "1256.TXT");
     125  text_t mapfile = filename_cat (gsdlhome, "unicode", "MAPPINGS");
     126  mapfile = filename_cat (mapfile, "WINDOWS", "1256.TXT");
    127127  simplemapinconvertclass arinconvert;
    128   arinconvert.setmapfile (armapfile);
     128  arinconvert.setmapfile (mapfile);
    129129  simplemapoutconvertclass aroutconvert;
    130   aroutconvert.setmapfile (armapfile);
     130  aroutconvert.setmapfile (mapfile);
    131131  recpt.add_converter ("a", &arinconvert, &aroutconvert); 
     132
     133  // cyrillic
     134  mapfile = filename_cat (gsdlhome, "unicode", "MAPPINGS");
     135  mapfile = filename_cat (mapfile, "WINDOWS", "1251.TXT");
     136  simplemapinconvertclass cyinconvert;
     137  cyinconvert.setmapfile (mapfile);
     138  simplemapoutconvertclass cyoutconvert;
     139  cyoutconvert.setmapfile (mapfile);
     140  recpt.add_converter ("c", &cyinconvert, &cyoutconvert); 
    132141 
    133142  // hindi
  • trunk/gsdl/src/recpt/receptionist.cpp

    r1779 r1838  
    750750    } else if (args["w"] == "a") {
    751751      response_data += "; charset=windows-1256";
     752    } else if (args["w"] == "c") {
     753      response_data += "; charset=windows-1251";
    752754    } else {
    753755      response_data += "; charset=ISO-8859-1";     
Note: See TracChangeset for help on using the changeset viewer.