| View previous topic :: View next topic |
| Author |
Message |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Sat Apr 22, 2017 6:14 am Post subject: Eggdrop vers 1.8x problems with ascii and latin characters |
|
|
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 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  |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sat Apr 22, 2017 10:27 am Post subject: |
|
|
| try running 1.8 wich has utf-8 fixed |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Sun Apr 23, 2017 1:41 pm Post subject: |
|
|
| 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  |
|
| Back to top |
|
 |
thommey Halfop
Joined: 01 Apr 2008 Posts: 73
|
Posted: Sun Apr 23, 2017 7:24 pm Post subject: |
|
|
| 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 |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Mon Apr 24, 2017 2:34 pm Post subject: |
|
|
| 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  |
|
| Back to top |
|
 |
m4s Halfop

Joined: 30 Jan 2017 Posts: 97
|
Posted: Fri May 12, 2017 11:48 am Post subject: Re: Eggdrop vers 1.8x problems with ascii and latin characte |
|
|
| 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 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: |
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!
Good luck! |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Fri May 12, 2017 7:26 pm Post subject: Re: Eggdrop vers 1.8x problems with ascii and latin characte |
|
|
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  |
|
| Back to top |
|
 |
|