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.

Eggdrop vers 1.8x problems with ascii and latin characters

General support and discussion of Eggdrop bots.
Post Reply
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Eggdrop vers 1.8x problems with ascii and latin characters

Post by juanamores »

Currently I use:
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:
MyBoT: «» The song «» Cristian Castro - Buenos Dí-as Amor
When it should be showed like this:
MyBoT: «» The song «» Cristian Castro - Buenos Días 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 :)
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

try running 1.8 wich has utf-8 fixed
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Post by juanamores »

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 :)
t
thommey
Halfop
Posts: 76
Joined: Tue Apr 01, 2008 2:59 pm

Post by thommey »

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?
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Post by juanamores »

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: Select all

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: Select all

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 :)
User avatar
m4s
Halfop
Posts: 97
Joined: Mon Jan 30, 2017 3:24 pm

Re: Eggdrop vers 1.8x problems with ascii and latin characte

Post by m4s »

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:
MyBoT: «» The song «» Cristian Castro - Buenos Dí-as Amor
When it should be showed like this:
MyBoT: «» The song «» Cristian Castro - Buenos Días 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: Select all

if (encoding == NULL) {
    encoding = "iso8859-1";
  }
And add the utf-8 coding.

Code: Select all

if (encoding == NULL) {
    encoding = "iso8859-1";
    encoding = "utf-8";
  }
Recompile and install the bot! I hope this solves your problem! :)
Good luck!
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Re: Eggdrop vers 1.8x problems with ascii and latin characte

Post by juanamores »

Ok, thanks ! :)
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 :)
Post Reply