Changeset 32096 for main


Ignore:
Timestamp:
2017-12-12T16:47:34+13:00 (6 years ago)
Author:
ak19
Message:

Marking all the uses of sysread() with a comment saying they're a candidate to use FileUtils::readUTF8File() in future, if thinking about each case beforehand has confirmed that the contents will indeed be UTF8.

Location:
main/trunk/greenstone2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/gti.pl

    r31751 r32096  
    773773    &FileUtils::copyFilesRecursiveNoSVN($en_helpxml_file, $glihelp_lang_dir);
    774774
     775    # The following file reading section is a candidate to use FileUtils::readUTF8File()
     776    # in place of calling sysread() directly. But only if we can reason we'd be working with UTF8
    775777    # In gli/help/<newlang>/help.xml, replace all occurrences of
    776778    # <Text id="1">This text in en will be removed for new langcode</Text>
  • main/trunk/greenstone2/bin/script/replace_srcdoc_with_html.pl

    r24475 r32096  
    187187    }
    188188
     189    # The following file reading section is a candidate to use FileUtils::readUTF8File()
     190    # in place of calling sysread() directly. But only if we can reason we'd be working with UTF8
    189191    # Now we know we have no file name collisions. We 'move' the html file by copying its
    190192    # contents over and ensuring that these contents are utf8. If we don't do this, PDFs
  • main/trunk/greenstone2/perllib/plugins/HTMLPlugin.pm

    r31955 r32096  
    962962   
    963963    my $css_filename_dirname = &File::Basename::dirname($css_filename);
    964    
     964
     965    # The following file reading section is a candidate to use FileUtils::readUTF8File()
     966    # in place of calling sysread() directly. But only if we can reason we'd be working with UTF8
    965967    open (CSSFILE, $css_filename) || return;
    966968    sysread (CSSFILE, my $file_string, -s CSSFILE);
  • main/trunk/greenstone2/perllib/plugins/ReadTextFile.pm

    r31492 r32096  
    216216     
    217217    if ($encoding eq "ascii") {
     218    # The following file reading section is a candidate to use FileUtils::readUTF8File()
     219    # in place of calling sysread() directly. But only if we can reason we'd be working with UTF8.
     220    # ascii is UTF8, but it may become inefficient to treat ascii as utf8
     221   
    218222    # Replace file 'slurp' with faster implementation
    219223    sysread(FILE, $$textref, -s FILE);
  • main/trunk/greenstone2/perllib/servercontrol.pm

    r31952 r32096  
    201201        # check the page content is as expected
    202202        #my $resultstr = $response_content;
    203        
     203
     204            # The following file reading section is a candidate to use FileUtils::readUTF8File()
     205    # in place of calling sysread() directly. But only if we can reason we'd be working with UTF8
    204206        open(FIN,"<$tmpfilename") or die "servercontrol.pm: Unable to open $tmpfilename to read ping response page...ERROR: $!\n";
    205207        my $resultstr;
  • main/trunk/greenstone2/perllib/util.pm

    r31971 r32096  
    12801280        # check llssite.cfg for line with url property
    12811281        # for server.exe also need to use portnumber and enterlib properties           
    1282        
     1282        # The following file reading section is a candidate to use FileUtils::readUTF8File()
     1283        # in place of calling sysread() directly. But only if we can reason we'd be working with UTF8
    12831284        # Read in the entire contents of the file in one hit
    12841285        if (!open (FIN, $llssite_cfg)) {
Note: See TracChangeset for help on using the changeset viewer.