Hi!
As Win32::PowerPoint is not based on Unicode, I would suggest that you use Win32::OLE to create your PowerPoint file.
You can set the encoding to UTF8 as described in Convert PowerPoint Presentation to Word Document with Win32::OLE and then create your PowerPoint file as described in Re: Using Win32::OLE and Excel - Tips and Tricks.
Here's my own primitive example using information from the samples above and the Win32::PowerPoint source code:
use strict; use utf8; use warnings; use File::Spec qw(rel2abs); use Win32::OLE qw( in CP_UTF8 ); Win32::OLE->Option( CP => CP_UTF8 ); $Win32::OLE::Warn = 3; # used File::Spec to save the file in my local directory # as Windows 7 is more restrictive about # users' file writing permissions than Windows XP my $filename = File::Spec->rel2abs("./unicode_example.ppt"); print( "Starting Powerpoint Object\n" ); my $power = Win32::OLE->GetActiveObject('Powerpoint.Application') || Win32::OLE->new('Powerpoint.Application', 'Quit'); my $ppt = $power->Presentations->Add(); # 12 = blank layout my $slide = $ppt->Slides->Add(1,12); # 1 = text in horizontal direction, the next two numbers describe the +position # and the last numbers the width and height of the box my $new_textbox = $slide->Shapes->AddTextbox(1,30,30,600,200); my $text_frame = $new_textbox->TextFrame; my $text_range = $text_frame->TextRange; $text_range->{Text} = "Please print \x{03B1},\x{03B2},\x{03B3}"; $ppt->SaveAs($filename);
Hope this helps - I've successfully tested this under Windows 7, using Strawberry Perl 5.12.3 and Powerpoint 2010.

In reply to Re: Unicode characters in Win32::Powerpoint by angiehope
in thread Unicode characters in Win32::Powerpoint by iaw4

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.