Hi, I'm trying to use set_header() method in order to
describe in the multi-byte string(Japanese), but garbling
occurs. The following codes is what I tried.
I'd like to know the correct way.
<code>use strict;
use Encode;
use Unicode::String qw(utf8 utf16);
use Spreadsheet::WriteExcel;
use Jcode;
my $string;
# multi-byte string in euc-jp
my $str1 =
"xa5xefxa1xbcxa5xafxa5xb7xa1xbcxa5xc8"
;
my $workbook =
Spreadsheet::WriteExcel->new("sample.xls");
my $sheet = $workbook->add_worksheet(to_utf16($str1), 1);
$sheet->set_header("&L&"MS
PGothic"".to_utf16($str1)."&R&P /
&N", 0.51);
sub to_utf16 {
return utf8( encode("utf-8",
decode("cp932",
Jcode->new($_[0],"euc")->sjis)) )->utf16;
}
</code>
Another incident, it can be possible to vertical writing
using the vertical fonts
of MS PGothic in the cell formatting? The vertical writing
is different from
the rotation, which is in the horizontal writing, from the
top to the bottom.
I'm sorry for my poor English.
To write a respons, access
http://ww
w.cpanforum.com/response_form/3982
To see the full thread, access
http://www.cpan
forum.com/threads/3982
--
You are getting this messages from www.cpanforum.com
To change your subscription information visit http://www.cpanforum.
com/mypan/
|