22 users online (0 members and 22 guests)  


  Results 1 to 2 of 2
  1. #1
    maugustyniak's Avatar
    New User

    Status
    Offline
    Join Date
    May 2006
    Posts
    2

    panic: utf16_to_utf8

    I get the following error message when I try to run a specific perl file.

    panic: utf16_to_utf8: odd bytelen 37 at C:\Inetpub\wwwroot\cgi-bin\counter.pl line 22.

    Otherwise, I get the

    panic: utf16_to_utf8: odd bytelen

    error no matter what cgi-related perl file I run. Here's the code:

    Code:
    #counter.pl
    #This file basically creates the counter we're supposed to be using in counter.shtml.
    
    #from devshed
    open my $fh, "<", 'counter.dat';
    my $data = <$fh>;
    close $fh;
    $data++;
    
    open $fh, ">", 'counter.dat';
    #output all using only one call to print, space the variables with whitespace
    print $fh $data;    
    close $fh;
    
    print "<center>";
    print "<strong>You are visitor number</strong><br />";
    
    my @nums = split //, $data;
    foreach my $num (@nums){
      my $file = $num.'.jpg';
      print qq'<img src="../Deitel/counter/$file">';
    }
    print "</center>";
    I'm totally stumped since I'm new at this.
    Last edited by maugustyniak; 05-05-2006 at 09:49 PM.

  2. #2
    maugustyniak's Avatar
    New User

    Status
    Offline
    Join Date
    May 2006
    Posts
    2

    Re: panic: utf16_to_utf8

    Problem solved. All I had to do was to save my perl files as UTF8, in Notepad. Ciao!



Tags for this Thread