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 

Why a " ² " become " ? "

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


Joined: 15 Apr 2004
Posts: 28
Location: France

PostPosted: Sun Feb 26, 2006 2:00 am    Post subject: Why a " ² " become " ? " Reply with quote

Hello, i have a weird bug about a character, the " ² ", when i write it in a text file, it make it " ? ", and i don't really understand why, i can't find any thread about this, maybe i didn't used the correct key-words to find it but well.

Someone have any clue about this ?

I guess the " ² " isn't the only character who is affected.
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Sun Feb 26, 2006 10:49 am    Post subject: Reply with quote

read about character tables and character encodings.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
Caribou
Voice


Joined: 15 Apr 2004
Posts: 28
Location: France

PostPosted: Sun Feb 26, 2006 3:40 pm    Post subject: Reply with quote

Thanks De Kus,

I did a search about encoding and i find out a solution, i used fconfigure command, i don't really know where to had it, so i made it just before writing in my text file. and now when i open the .txt file i got the " ² " instead of " ? " Very Happy

Code:
 if {![catch {set fileWri [open nick2.txt w]}]} {
   fconfigure $fileWri -encoding binary
   puts $fileWri "$arg"
   close $fileWri
 }


But re-using fconfigure each times i write in my .txt is the right thing to do i hope?
Back to top
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Sun Feb 26, 2006 4:31 pm    Post subject: Reply with quote

yes, unless you can change the default encoding thats used. I dont know if the default is the eggdrops default or the systems default. Because eggdrop should use iso-8659-1 which supports these characters your shell probably uses us-ascii which is not that good imho. But maybe its also strict UTF-8 which of course does not recognize single byte values over 127.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting 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