I have modified a program called edict to work with online language dictionaries. While the process for this may be completely obvious, I will enumerate it:

1. get user input
2. send the input to the web site for the search
3. parse the output from the website
4. print the translation to the screen.

Now for the problem. Sending a word with no accents works beautifully. However, words with accented characters never get a hit.

I have tried:

use Encode;
....
$_ = encode("iso-8859-1", $_);

before sending input to the website because I have read that the internet is mostly written using iso-8859, so I thought the web site might need iso input. That didn't work.

I am working at a Spanish site, so I entered the word 'araņa' and did a search manually. The site found the word in its database and gave me all the possible translations. I then used that word for input using edict and no results were returned. (this is getting kind of long, eh?)

So, the question is: where in this process are the characters getting muttled and what can I do about it?

In reply to text encoding by bhcesl

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.