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.

translate or quote command

Old posts that have not been replied to for several years.
Locked
e
eagla

Post by eagla »

How i can translate with tcl text from koi8 to cp1251 ? or how i can do command /quote for bot from tcl ?
please help me :smile:
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

I don't have koi8 on my tclsh, but I do have koi8-r, which I'm assuming is similar:

Code: Select all

set a [encoding convertfrom koi8-r $koi8text]
set b [encoding convertto cp1251 $a]
Be aware, though, that your $koi8text variable has to actually be in koi8 format. If you read it in with the 'source' command, it will be iso8859-1, always. Read the man page for "encoding" at tcl.activestate.com or dev.scriptics.com.
Locked