in reply to Re^2: Writing International Phonetic Alphabet symbols to Excel?
in thread Writing International Phonetic Alphabet symbols to Excel?
The main (Unicode) problem is that perl doesn't know that the strings that you are extracting from the Html source are UTF-8. You can either explicitly convert them, as graff shows, or better still use decoded_content() instead of content() in your LWP code:
This will get you most of the way there if you view the output file. However, you will notice that the backquote-like (inflection?) character doesn't display in the default Arial font (the other Unicode characters do).... if ( $response -> is_success ) { $htmlsource = $response -> decoded_content(); $writestring = parse( $htmlsource ); } ...
The solution in this case is to switch to a full Unicode font in Excel such as 'Arial Unicode MS'
... my $arial_unicode = $workbook -> add_format(font => 'Arial Unicode + MS'); $sheet -> write ( 0, 0, $writestring, $arial_unicode ); ...
--
John.
|
|---|