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 

Eggdrop + UTF8

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


Joined: 28 Jul 2008
Posts: 17

PostPosted: Sat Oct 02, 2010 2:37 pm    Post subject: Eggdrop + UTF8 Reply with quote

I have downloaded Eggdrop 1.6.20.

Then I have extracted it, and modified main.h and tcl.c: http://eggwiki.org/Utf-8

Then I have compiled and installed it.

But when i try to use unicode:
Quote:
set mes "дадада"
putquick "PRIVMSG $chan :\001ACTION $mes"


it says something in wrong codepage (cp1251).

I have found a way to fix it, but i think it's just a hack, not a solution:
Quote:
# it works
set mes "дадада"
set mes [encoding convertfrom cp1251 $mes]
putquick "PRIVMSG $chan :\001ACTION $mes"


I tried to save my script.tcl file in UTF8 codepage. It didn't help..
I tried to set 'encoding system utf-8", but it didnt work neither
Back to top
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Sat Oct 02, 2010 4:26 pm    Post subject: Reply with quote

Quote:
<@tvrsh> $$ encoding system
<+bionic> OK: utf-8 - 0.042 ms.
<@tvrsh> $$ $::version
<+bionic> Error: invalid command name "1.6.20 1062000" - 1.071 ms.
<@tvrsh> $$ set mes "дадада"; putquick "PRIVMSG $chan :\001ACTION $mes"
* +bionic дадада

Maybe you neednt use http://eggwiki.org/Utf-8 with 1.6.20?
_________________
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
thommey
Halfop


Joined: 01 Apr 2008
Posts: 73

PostPosted: Sat Oct 02, 2010 4:35 pm    Post subject: Reply with quote

It sounds to me as if what you did there (the encoding convertfrom) is not a hack, it's the way to convert cp1251 into unicode (tcl is unicode internally), which will then be converted to system encoding (utf-8 if you modified according to that wiki). The problem is that what YOU typed there into that file, is not utf-8, it's cp1251, the file is cp1251 (saving it as utf-8 doesn't change that), because your characters are entered that way (your terminal/system encoding).

To rule out your issues of getting utf-8 stuff into a file you can use Tcls unicode character substitutes: set a "\u0414\u0416\u041A"
Back to top
View user's profile Send private message
FallFromGrace
Voice


Joined: 28 Jul 2008
Posts: 17

PostPosted: Sun Oct 03, 2010 7:58 am    Post subject: Reply with quote

Thanks. Bot prints "\u0414\u0416\u041A" correctly.

How can i convert my whole script to UTF8? I use UltaEdit, but i have already tried to convert it without any success.
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 -> Eggdrop 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