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.
Help for those learning Tcl or writing their own scripts.
juanamores
Master
Posts: 317 Joined: Sun Mar 15, 2015 9:59 am
Post
by juanamores » Sun May 08, 2016 2:48 am
I use:
Code: Select all
set liveme [encoding convertfrom utf-8 "[lrange $cursong 1 [llength $cursong]]"]
set temp [open "livesong.txt" w+]
puts $temp "$liveme"
close $temp
But, the livesong.txt file is saved with ANSI encoding.
I need the BoT save it with UTF-8 encoding.
It can?
Last edited by
juanamores on Thu May 12, 2016 6:24 pm, edited 1 time in total.
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Sun May 08, 2016 8:13 am
You could use the fconfigure command to set the desired encoding of the channelId (in this case, the opened file).
Try something like this:
Code: Select all
set liveme [encoding convertfrom utf-8 "[lrange $cursong 1 [llength $cursong]]"]
set temp [open "livesong.txt" w+]
fconfigure $temp -encoding utf-8
puts $temp "$liveme"
close $temp
NML_375
juanamores
Master
Posts: 317 Joined: Sun Mar 15, 2015 9:59 am
Post
by juanamores » Sun May 08, 2016 6:22 pm
Thanks nml375 , works!
EDIT
Not work
Code: Select all
[juan@vps92318 eggdrop]$ file -bi livesong.txt
text/plain; charset=us-ascii
I try
Code: Select all
[juan@vps92318 eggdrop]$ iconv -f us-ascii -t UTF-8 livesong.txt
[juan@vps92318 eggdrop]$ file -bi livesong.txt
text/plain; charset=us-ascii
The Bot does NOT save the file with UTF-8 encoding format and the system did not change the encoding.....
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks
juanamores
Master
Posts: 317 Joined: Sun Mar 15, 2015 9:59 am
Post
by juanamores » Thu May 12, 2016 1:05 am
I edited the post , encoding not work.
Final Edit :
I fixed it!!
Instead of utf-8 the encoding was iso-8859, because my web client works with Windows system.
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks