egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Issues with special characters in scripts.

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
ujjain
Voice


Joined: 11 Oct 2010
Posts: 12

PostPosted: Mon Oct 11, 2010 10:26 am    Post subject: Issues with special characters in scripts. Reply with quote

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:

(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.
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Mon Oct 11, 2010 6:13 pm    Post subject: Re: Issues with special characters in scripts. Reply with quote

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:

(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....

Quote:
<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 Very Happy). 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.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber