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 

Eggdrop vers 1.8x problems with ascii and latin characters

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Eggdrop Help
View previous topic :: View next topic  
Author Message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Sat Apr 22, 2017 6:14 am    Post subject: Eggdrop vers 1.8x problems with ascii and latin characters Reply with quote

Currently I use:
Quote:
Eggdrop v1.6.21, Configured with: '--with-handlen = 32'
Tcl library: /usr/share/tcl8.5
Tcl version: 8.5.13 (header version 8.5.13)
OS: Linux 3.10.23-xxxx-std-ipv6-64-vps
Tcl is threaded.

How did I solved so that the ascii characters, latin accents, and the letters could be visualized?
1) Modifying the binaries, see Bugs/Utf-8
2) Using the function [encoding convertfrom utf-8]
like this: set goodtext [encoding convertfrom utf-8 "$latintext"]

With versions 1.8x I can not solve it because:
1) Binaries are different from those published in the wiki solution, and I do not know what to modify and where.
2) Using the [encoding convertfrom utf-8] function nothing happens.

Examples of what is bad displayed:
Quote:
MyBoT: «» The song «» Cristian Castro - Buenos Dí-as Amor

When it should be showed like this:
Quote:
MyBoT: The song Cristian Castro - Buenos Das Amor


Anyone have any solutions to these problems?
_________________
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 Smile
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 204

PostPosted: Sat Apr 22, 2017 10:27 am    Post subject: Reply with quote

try running 1.8 wich has utf-8 fixed
Back to top
View user's profile Send private message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Sun Apr 23, 2017 1:41 pm    Post subject: Reply with quote

simo wrote:
try running 1.8 wich has utf-8 fixed

I tried it with all 1.8 versions and the results were the ones I showed previously.
_________________
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 Smile
Back to top
View user's profile Send private message
thommey
Halfop


Joined: 01 Apr 2008
Posts: 73

PostPosted: Sun Apr 23, 2017 7:24 pm    Post subject: Reply with quote

There are a lot of potential problem sources in this. Where are you getting the data from originally? If it's a script can you pastebin it somewhere or here?
Back to top
View user's profile Send private message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Mon Apr 24, 2017 2:34 pm    Post subject: Reply with quote

thommey wrote:
There are a lot of potential problem sources in this. Where are you getting the data from originally? If it's a script can you pastebin it somewhere or here?


I get the data per socket from the Shoutcast website, see Shoutcast TCL by domsen.

The name of the song is stored in the cursong variable.

As the data is not well coded in that web, I solve it with these commands:
Code:
regsub -all "{" $cursong "" cursong
   regsub -all "}" $cursong "" cursong
   regsub -all "Ñ" $cursong "" cursong
   regsub -all "Ó" $cursong "" cursong
   regsub -all "Ú" $cursong "" cursong
   regsub -all "á" $cursong "" cursong
   regsub -all "é" $cursong "" cursong
   regsub -all "í" $cursong "" cursong
   regsub -all "ó" $cursong "" cursong
   regsub -all "ú" $cursong "" cursong
   regsub -all "ñ" $cursong "" cursong
   regsub -all "±" $cursong "" cursong
   regsub -all "ç" $cursong "" cursong
   regsub -all " " $cursong "" cursong
   regsub -all "¡" $cursong "" cursong
   regsub -all "¢" $cursong "" cursong
   regsub -all "£" $cursong "" cursong
   more ..... more .......


I know these commands are obsolete (deprecated) in new versions and I would have to use something like:
Code:
set cursong [string map [list "Ñ" "Ó" "Ú" ......... more....more......] $cursong]



But I do not want to modify all my codes and recompile everything if I'm not 100% sure that I'll work fine coding for ascii characters and Latin accents.
_________________
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 Smile
Back to top
View user's profile Send private message
m4s
Voice


Joined: 30 Jan 2017
Posts: 23

PostPosted: Fri May 12, 2017 11:48 am    Post subject: Re: Eggdrop vers 1.8x problems with ascii and latin characte Reply with quote

Quote:
With versions 1.8x I can not solve it because:
1) Binaries are different from those published in the wiki solution, and I do not know what to modify and where.
2) Using the [encoding convertfrom utf-8] function nothing happens.

Examples of what is bad displayed:
Quote:
MyBoT: «» The song «» Cristian Castro - Buenos Dí-as Amor

When it should be showed like this:
Quote:
MyBoT: The song Cristian Castro - Buenos Das Amor


Anyone have any solutions to these problems?


Hello,

You should edit the tcl.c file (located in eggdrop-1.8.x/src) find this:
Code:

if (encoding == NULL) {
    encoding = "iso8859-1";
  }

And add the utf-8 coding.
Code:

if (encoding == NULL) {
    encoding = "iso8859-1";
    encoding = "utf-8";
  }

Recompile and install the bot! I hope this solves your problem! Smile
Good luck!
Back to top
View user's profile Send private message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Fri May 12, 2017 7:26 pm    Post subject: Re: Eggdrop vers 1.8x problems with ascii and latin characte Reply with quote

Ok, thanks ! Smile
_________________
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 Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Eggdrop 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