A while back, I had some help with translating German umlaut letters (ü, ö, ä) so that they were seen correctly by web browsers when automating internet searches.
I’ve just used a site this morning I haven’t accessed in a while and found that the conversion “function” that I have isn’t working any more.
Here is the code:
set searchEncoded to do shell script "/bin/echo -n " & quoted form of search & " | iconv -f utf8 -t iso-8859-1 | php -r '$handle = fopen (\"php://stdin\",\"r\"); $line = fgets($handle);echo urlencode($line);'"
To give you a short example, I did this:
set search to "Über"
set searchEncoded to do shell script "/bin/echo -n " & quoted form of search & " | iconv -f utf8 -t iso-8859-1 | php -r '$handle = fopen (\"php://stdin\",\"r\"); $line = fgets($handle);echo urlencode($line);'"
The result that then appeared in the Result pane was:
“%DCber”
I guess something must have changed when I upgraded to Lion as this always used to work before.
Can anyone advise how to fix this?
Regards,
Bowjest