I’m trying to extract International Phonetic Alphabet (IPA) symbols from html source code. Internet Explorer’s View > Source console displays the symbols as symbols (ie, not in any utf form); moreover, from this console I can copy these symbols and paste them into Notepad as unformatted Arial-font text without utf code taking their place.

However, when I ask Perl to extract such symbols from html source and write them to Excel via Spreadsheet::WriteExcel, I get junk. (Spreadsheet::WriteExcel’s default ‘write’ font is Arial. Having opened the resulting Excel file, it makes no difference what font – including IPA-specific fonts – I choose to display a given cell's contents: it’s still junk.)

Can you explain to me what’s going on? Is there a fix? I’m not familiar with utf-8 programming in Perl, though I suspect I’ll need to go there.

The website I’m trying to use is www.dictionary.com. Search on a word like ‘hello’ and click Show IPA. The returned stuff between the slashes – that’s the stuff I wish to extract and have Perl write to a spreadsheet.

Many thanks!


In reply to Writing International Phonetic Alphabet symbols to Excel? by cypress

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.