[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Japanese Pages getting corrupted



I have a problem with some html pages in Japanese.  My scripts does the following:

open(CONT,"$content_file") || print STDERR "Unable to open or read $content_file: $!\n";
@cont=<CONT>;
close(CONT);
@cont = "$NO_CONTENT" if (! @cont); # print something if files is empty
print "@cont";

The problem is that when $content_file is not standard ASCII but EUC or S-JIS or JIS then @cont becomes garbled.  I tried this, too:

print <CONT>;

in place of 

@cont = <CONT>;

and even went as far as

while (<CONT>){
  print $_;
}


I have looked over jcode.pl and jcode.pm but I do not see how it can help me.  I have seen an example that uses a system call to invoke network kanji filter (nkj). . .it massages the file after closing it.
The problem with jcode is that it does not appear to work for an entire file. . .:(

Any other ideas?

Thanks,
Ward
------
CFD Laboratory, 318 GUG                http://www.aa.washington.edu/cfdlab
University of Washington
  Department of Aeronautics & Astronautics                     Plasma Physics
  Department of Technical Communications                 Technical Japanese
TEL: +1 (206) 363-6056                                       FAX: +1 (419) 831-7185

http://students.washington.edu/wwv

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org