This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Eggdrop + UTF8

General support and discussion of Eggdrop bots.
Post Reply
F
FallFromGrace
Voice
Posts: 17
Joined: Mon Jul 28, 2008 8:52 am

Eggdrop + UTF8

Post by FallFromGrace »

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:
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:
# 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
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

<@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/
t
thommey
Halfop
Posts: 76
Joined: Tue Apr 01, 2008 2:59 pm

Post by thommey »

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"
F
FallFromGrace
Voice
Posts: 17
Joined: Mon Jul 28, 2008 8:52 am

Post by FallFromGrace »

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.
Post Reply