ujjain wrote:I hope that I am able to explain this correctly, because nobody was able to help me on #eggdrop at Freenode.
Eggdrop scripts like Bogustrivia and GTranslate do not show special characters correctly, but show question-marks on many computers of my channel's users. I have no issues with mIRC, but I do not see the characters correctly with Pidgin.
Code: Select all
(16:18:28) ujjain: !tr de I am a loner.
(16:18:30) OmeletBot: (en) Ich bin ein Einzelg?nger.
I never had issues with foreign characters before with Pidgin when users used utf-8,only when they used a regional charset. Eggdrop is set to use utf-8. I checked this by adding a line that prints encoding in eggdrop.conf
The sourcecode of the script can be viewed at:
http://www.codepad.eu/view/85674687.
When I have the bot talk in the channel via partyline, everything goes alright.
That script doesn't appear to make use of utf-8, either through encodings or http config settings. It's making huge assumptions. So....
<speechles> !tr @de I am a loner.
<sp33chy> Google: (auto->de) English to German translation
<sp33chy> Ich bin ein Einzelgänger.
Here is an alternative way to check. Try using my script:
here which includes google translations (among other things

). While mine doesn't use the API, mine does things a little differently. Google is given special queries with mine that set the input/output encodings correctly to utf-8 while making queries. Mine also properly makes use of the -urlencoding feature of http package 2.5+ which should be set to utf-8, default is iso8859-1. I suspect this is where your issues are coming from. Try my script and see if these issues magically disappear. If so I can give you some quick hacks to correct that scripts short comings and make it work correctly.
NOTE: Also, that script limits itself for no reason to these languages below:
set lngs { "fr" "en" "es" "de" "it" "nl" }
Why it does this is beyond me. Google supports language's on the fly. So mine doesn't care what you put. If google supports it, you will either see a message saying "It's not supported yet" or the translated text. Your script appears to limit itself severly, so much so that Russians/Serbians/Hindis/Arabs/etc can't use it at all (racist perhaps?). Mine doesn't have any limitations, as google supports more languages my script natively works with them, always.