|
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.
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 = "\xa5\xef\xa1\xbc\xa5\xaf\xa5\xb7\xa1\xbc\xa5\xc8";
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;
}
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.
|