| View previous topic :: View next topic |
| Author |
Message |
FallFromGrace Voice
Joined: 28 Jul 2008 Posts: 17
|
Posted: Sat Oct 02, 2010 2:37 pm Post subject: Eggdrop + UTF8 |
|
|
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 |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Sat Oct 02, 2010 4:26 pm Post subject: |
|
|
| 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 |
|
 |
thommey Halfop
Joined: 01 Apr 2008 Posts: 73
|
Posted: Sat Oct 02, 2010 4:35 pm Post subject: |
|
|
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 |
|
 |
FallFromGrace Voice
Joined: 28 Jul 2008 Posts: 17
|
Posted: Sun Oct 03, 2010 7:58 am Post subject: |
|
|
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 |
|
 |
|