lordsll has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to process an Excel file with Chinese characters in one of the columns and then write out those characters to a file. I have reduced the code as much as I know how. The output file has "? ?" from "李 氏" input. I am fairly new to perl and would appreciate help. Thank you for your time.
#!/usr/bin/perl use warnings; use strict; use Win32::OLE; use Win32::OLE::Const 'Microsoft Excel'; use Win32::OLE qw(in with); use utf8; use Encode; my $editOWS_file = 'C:\\Users\\lordsll\\Downloads\\Chinese_output.out' +; open OUT1, ">:encoding(UTF-8)","$editOWS_file" or die "Can't write on +file $editOWS_file: $!\n"; my $Excel = Win32::OLE->new("Excel.Application"); $Excel->{Visible} = 1; my $Book = $Excel->Workbooks->Open("C:\\Users\\LordsLL\\Downloads\\pro +blem_sample.xlsx"); $Excel->Worksheets(1)->Activate(); my $cell = $Excel->Worksheets(1)->Range("A1")->{Value}; print OUT1 "$cell\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Read/Write Chinese Characters
by CountZero (Bishop) on Oct 15, 2012 at 21:22 UTC | |
Re: Read/Write Chinese Characters
by Anonymous Monk on Oct 15, 2012 at 20:22 UTC | |
Re: Read/Write Chinese Characters
by remiah (Hermit) on Oct 15, 2012 at 20:17 UTC | |
Re: Read/Write Chinese Characters
by nikosv (Deacon) on Oct 16, 2012 at 06:00 UTC | |
by remiah (Hermit) on Oct 16, 2012 at 07:52 UTC | |
by lordsll (Novice) on Oct 16, 2012 at 13:44 UTC | |
Re: Read/Write Chinese Characters
by lordsll (Novice) on Oct 15, 2012 at 21:31 UTC | |
Re: Read/Write Chinese Characters
by lordsll (Novice) on Oct 15, 2012 at 21:05 UTC | |
by remiah (Hermit) on Oct 15, 2012 at 21:15 UTC |
Back to
Seekers of Perl Wisdom