Getting MS Excel's cell contents of Unicode text from Perl 
Author Message
 Getting MS Excel's cell contents of Unicode text from Perl

Hi,

I have an Excel file containing cells of Unicode text including
Simplified Chinese, Traditional Chinese and Japanese. The Windows98 I
am using is Traditional Chinese version. As I execute the following
Perl program, the text stored in $Sheet->Cells(74,4)->Value is
converted to Big5 Chinese. And all Japanese and Simplified Chinese
characters are all replaced with '?'. I'd like to get the Unicode or
the UTF-8 representation of the text stored in the cells and lose no
foreign characters. Can any one help?

------------------------------------------------------------
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Excel';
my $Excel = Win32::OLE->new("Excel.Application");
$Excel->{Visible} = 1;
my $Book = $Excel->Workbooks->Open('c:\home\ben\disp_haier.xls');
my $Sheet = $Book->Worksheets(1);
print $Sheet->Cells(74,4)->Value;

--
Yu-Jui Lee
Trinity Communications Inc.
Taipei Taiwan



Wed, 18 Jun 1902 08:00:00 GMT  
 Getting MS Excel's cell contents of Unicode text from Perl

Quote:

>I have an Excel file containing cells of Unicode text including
>Simplified Chinese, Traditional Chinese and Japanese. The Windows98 I
>am using is Traditional Chinese version. As I execute the following
>Perl program, the text stored in $Sheet->Cells(74,4)->Value is
>converted to Big5 Chinese. And all Japanese and Simplified Chinese
>characters are all replaced with '?'. I'd like to get the Unicode or
>the UTF-8 representation of the text stored in the cells and lose no
>foreign characters. Can any one help?

This is a bit off-topic, but...

Can you put in the Japanese and the Simplified Chinese by hand?

If so, it may all be simply a fact of setting the right font for the
cell. But don't ask me how.

--
        Bart.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. (Newbie question) Setting color of cell with TableMatrix based on contents of cell

2. WANTED: Perl packages for reading MS Excel, MS FoxPro

3. Perl calling MS Word, calling MS Excel

4. Can't format cells as text in Spreadsheet WriteExcel

5. module to convert text to MS EXCEL format

6. How to get cell value excel in perl

7. Excel/Perl syntax question on cell borders

8. Getting the content of Text widget

9. Please help with getting contents from the Text box

10. FILE MAKER Pro Compatibility with MS ACCESS, MS EXCEL

11. read one single cell of an excel sheet?

12. Spreadsheet::Excel different bg_color for different cell??

 

 
Powered by phpBB® Forum Software