Problème d'accent avec shoutcast.tcl
#1
Bonjour à tous ,
comme le titre l'indique j'ai un problème d'accent dans les titres sortie par le bot exemple d'un titre :
En ce moment à l'antenne >> christophe maã© - ne ten fais pas

le tcl que j'ai pris c'est celui de djkenny http://scripts.eggdrop.fr/details-shoutcast-s128.html

je pense que ça vient de cette portion de code mais je ne vois pas comment modifier celas .
tcl
proc sc::clean arg {
	string map [list \
		"&#x3C;" < \
		"&#x3E;" > \
		"&#x26;" + \
		"&#x22;" \" \
		"&#x27;" ' \
		"&#x96;" - \
		"&#xB7;" · \
		"&#xDF;" ß \
		"&#xE1;" á \
		"&#xE0;" à \
		"&#xE2;" â \
		"&#xE4;" ä \
		"&#xC0;" À \
		"&#xC3;" Ã \
		"&#xC4;" Ä \
		"&#xE9;" é \
		"&#xE8;" è \
		"&#xEA;" ê \
		"&#xEB;" ë \
		"&#xEE;" î \
		"&#xEF;" ï \
		"&#xED;" í \
		"&#xF4;" ô \
		"&#xF6;" ö \
		"&#xD4;" Ô \
		"&#xD6;" Ö \
		"&#xF9;" ù \
		"&#xFB;" û \
		"&#xFC;" ü \
		"&#xDB;" Û \
		"&#xDC;" Ü \
		"&#xFF;" ÿ \
		"&#xE7;" ç \
		"&#xC7;" Ç \
		"&#xc9;" É \
		"&#xb0;" ° \
		"&#039;" \' \
		"&#39;" \' \
		"&#34;" \' \
		"&#38;" & \
		"&#91;" ( \
		"&#92;" / \
		"&#93;" ) \
		"&#123;" ( \
		"&#125;" ) \
		"&#163;" £ \
		"&#168;" ¨ \
		"&#169;" © \
		"&#171;" « \
		"&#173;" "­" \
		"&#174;" ® \
		"&#180;" ´ \
		"&#183;" · \
		"&#185;" ¹ \
		"&#187;" » \
		"&#188;" ¼ \
		"&#189;" ½ \
		"&#190;" ¾ \
		"&#192;" À \
		"&#193;" Á \
		"&#194;" Â \
		"&#195;" Ã \
		"&#196;" Ä \
		"&#197;" Å \
		"&#198;" Æ \
		"&#199;" Ç \
		"&#200;" È \
		"&#201;" É \
		"&#202;" Ê \
		"&#203;" Ë \
		"&#204;" Ì \
		"&#205;" Í \
		"&#206;" Î \
		"&#207;" Ï \
		"&#208;" Ð \
		"&#209;" Ñ \
		"&#210;" Ò \
		"&#211;" Ó \
		"&#212;" Ô \
		"&#213;" Õ \
		"&#214;" Ö \
		"&#215;" × \
		"&#216;" Ø \
		"&#217;" Ù \
		"&#218;" Ú \
		"&#219;" Û \
		"&#220;" Ü \
		"&#221;" Ý \
		"&#222;" Þ \
		"&#223;" ß \
		"&#224;" à \
		"&#225;" á \
		"&#226;" â \
		"&#227;" ã \
		"&#228;" ä \
		"&#229;" å \
		"&#230;" æ \
		"&#231;" ç \
		"&#232;" è \
		"&#233;" é \
		"&#234;" ê \
		"&#235;" ë \
		"&#236;" ì \
		"&#237;" í \
		"&#238;" î \
		"&#239;" ï \
		"&#240;" ð \
		"&#241;" ñ \
		"&#242;" ò \
		"&#243;" ó \
		"&#244;" ô \
		"&#245;" õ \
		"&#246;" ö \
		"&#247;" ÷ \
		"&#248;" ø \
		"&#249;" ù \
		"&#250;" ú \
		"&#251;" û \
		"&#252;" ü \
		"&#253;" ý \
		"&#254;" þ \
		"&lt;" < \
		"&gt;" > \
		"&agrave;" à \
		"&agrave;" à \
		"&aacute;" á \
		"&acirc;" â \
		"&eacute;" ã \
		"&auml;" ä \
		"&aring;" å \
		"&aelig;" æ \
		"&ccedil;" ç \
		"&egrave;" è \
		"&eacute;" é \
		"&ecirc;" ê \
		"&euml;" ë \
		"&igrave;" ì \
		"&iacute;" í \
		"&icirc;" î \
		"&iuml;" ï \
		"&eth;" ð \
		"&ntilde;" ñ \
		"&ograve;" ò \
		"&oacute;" ó \
		"&ocirc;" ô \
		"&otilde;" õ \
		"&ouml;" ö \
		"&divide;" ÷ \
		"&oslash;" ø \
		"&ugrave;" ù \
		"&uacute;" ú \
		"&ucirc;" û \
		"&uuml;" ü \
		"&yacute;" ý \
		"&thorn;" þ \
		"&yuml;" ÿ \
		"&quot;" \" \
		"&amp;" & \
		"&euro;" \€ \
		"&oelig;" œ \
		"&Yuml;" Ÿ \
		"&nbsp;" " " \
		"&iexcl;" ¡ \
		"&cent;" ¢ \
		"&pound;" £ \
		"&curren;" ¤ \
		"&yen;" ¥ \
		"&brvbar;" ¦ \
		"&brkbar;" ¦ \
		"&sect;" § \
		"&uml;" ¨ \
		"&die;" ¨ \
		"&copy;" © \
		"&ordf;" ª \
		"&laquo;" « \
		"&not;" ¬ \
		"&shy;" ­- \
		"&reg;" ® \
		"&macr;" ¯ \
		"&hibar;" ¯ \
		"&deg;" ° \
		"&plusmn;" ± \
		"&sup2;" ² \
		"&sup3;" ³ \
		"&acute;" ´ \
		"&micro;" µ \
		"&para;" ¶ \
		"&middot;" · \
		"&cedil;" ¸ \
		"&sup1;" ¹ \
		"&ordm;" º \
		"&raquo;" » \
		"&frac14;" ¼ \
		"&frac12;" ½ \
		"&frac34;" ¾ \
		"&iquest;" ¿ \
		"&Agrave;" À \
		"&Aacute;" Á \
		"&Acirc;" Â \
		"&Atilde;" Ã \
		"&Auml;" Ä \
		"&Aring;" Å \
		"&AElig;" Æ \
		"&Ccedil;" Ç \
		"&Egrave;" È \
		"&Eacute;" É \
		"&Ecirc;" Ê \
		"&Euml;" Ë \
		"&Igrave;" Ì \
		"&Iacute;" Í \
		"&Icirc;" Î \
		"&Iuml;" Ï \
		"&ETH;" Ð \
		"&Dstrok;" Ð \
		"&Ntilde;" Ñ \
		"&Ograve;" Ò \
		"&Oacute;" Ó \
		"&Ocirc;" Ô \
		"&Otilde;" Õ \
		"&Ouml;" Ö \
		"&times;" × \
		"&Oslash;" Ø \
		"&Ugrave;" Ù \
		"&Uacute;" Ú \
		"&Ucirc;" Û \
		"&Uuml;" Ü \
		"&Yacute;" Ý \
		"&THORN;" Þ \
		"&szlig;" "ß"
	] $arg
}



Merci pour votre aide apportée .

conf:
SHOUTcast Server Version 0.2.0.0 0.0.19.0/posix(linux x86)
SHOUTcast Transcoder Version 2
Répondre Avertir
#2
J'ai tenté de suivre le wiki http://wiki.eggdrop.fr/Utf-8 j'ai donc modifier main.h et tcl.c et recompilé celas ne fonctionne toujours pas pour ce qui est de la partie canaux utf-8 je ne comprends pas ce qu'il faut faire merci pour votre aide donné .
Répondre Avertir
#3
Je ne pense pas que ton souci soit un problème avec les canaux en utf-8.

Pour t'aider un peu plus il faudrait savoir ce que lit l'eggdrop et comment il l'affiche, et surtout l'encodage au niveau de shoutcast.
Répondre
#4
Bonjour CrazyCat ,
l'eggdrop lit les titres de la shoutcast sur la page admin et les ressorts sur mon #chan je met le code au cas ou :

tcl
# shoutcast.tcl --
#
# Copyright (C) 2010 - 2011 Dj_KennY
# 
# The shoutcast.tcl V0.9.3 is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
# 
# The shoutcast.tcl is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with the shoutcast.tcl. If not,
#    see <http://www.gnu.org/licenses/>.
# 
# 
# 
# Contact (2011)
#   - Dj_KennY   <guillaume@djkenny.net>
 
 
namespace eval ::sc {
	package require http
	package require msgcat
	variable sc

	# Configuration mot de passe/ip/port du serveur 
	# annonce:
	# 1- le bot annonce les morceaux sur le salon. 
	# 0- le bot n'annonce pas les morceaux.
	# il est important de laisser le "\" à la fin de chaque lignes!!
	# kpl: faut-il kicker la pl 1-oui / 0-non
	array set sc [list\
		adminpass monpasse \
		ip monip \
		port leport \
		lien url \
		annonce 1 \
		kpl 1 \
	]

	# Salon d'administration de la radio
	variable achan #radio

	# Salons par défaut ou le bot annonce les morceaux
	# Seulement pour le premier lancement!!
	# les salons seront stocker dans le fichier shoutcast.chan 
	variable rchan "#radios"

	# Méssages
	# Auditeurs
	::msgcat::mcset fr m0 "auditeurs %d (%d)"
	# Lancement de la radio
	::msgcat::mcset fr m1 "La radio vient d'être lancée."
	# Arret de la radio
	::msgcat::mcset fr m2 "La radio vient d'être arretée."
	# Annonces
	::msgcat::mcset fr m3 "En ce moment à l'antenne >> %s"
	# Biterate
	::msgcat::mcset fr m4 "bitrate: %d kb/s"
	# dédicaces
	::msgcat::mcset fr m5 "Tu as oublié de mettre ta dédicace"
	::msgcat::mcset fr m6 "La radio est arretée."
	::msgcat::mcset fr m7 "Ta dédicace à bien été enregistrée. Elle sera diffusée d'ici quelques instants."
	::msgcat::mcset fr m8 "\[Shoutcast\] dédicace de %s : %s"
	::msgcat::mcset fr m9 "dédicace de %s - %s"
	# !dj
	::msgcat::mcset fr m10 "Actuellement, l'Animateur est >> %s"
	::msgcat::mcset fr m11 "Actuellement, tu écoutes la Playlist."
	# !offair
	::msgcat::mcset fr m12 "\[Animateur\] %s vient de quitter les platines \[Animateur\]"
	::msgcat::mcset fr m13 "Le dj est déjà %s"
	# !onair
	::msgcat::mcset fr m14 "Bonne Anime."
	::msgcat::mcset fr m15 "%s vient de prendre le contrôle des platines"
	::msgcat::mcset fr m16 "\[Animateur\] %s vient de prendre le controle des platines \[Animateur\]"
	# !titre
	::msgcat::mcset fr m17 "Vous écoutez >> %s"
	# !radio
	::msgcat::mcset fr m18 "Pour nous écouter >> %s"

 
	# Binds
	bind time - "* * * * *" [namespace current]::controle
	bind pub A !onair [namespace current]::setdjp
	bind msg A onair [namespace current]::setdjm
	bind pub A !offair [namespace current]::unsetdjp
	bind msg A offair [namespace current]::unsetdjm
 
	bind msg B radioadd [namespace current]::addchan
	bind msg B radiodel [namespace current]::delchan
	bind msg B radiolist [namespace current]::listchan
 
	bind pub - !dj [namespace current]::djp
	bind msg - dj [namespace current]::djm
	bind pub - !dedi [namespace current]::dedip
	bind msg - dedi [namespace current]::dedim
	bind pub - !titre [namespace current]::titre
	bind pub - !radio [namespace current]::url
 
	bind nick - * [namespace current]::nkchg
 
	bind evnt - save [namespace current]::savechan
 
	::msgcat::mclocale fr
	
	# Ne pas modifier
	variable file [file join [pwd] [file dirname [info script]] shoutcast.chan]
	if ![file exists $file] {
		catch {open $file w} a
		catch {close $a}
	} else {
		set a [open $file r+]
		set c [gets $a]
		close $a
		if ![string equal $c ""] {set rchan $c}
	}
 
}
 
proc sc::savechan event {
	variable file
	variable rchan
	if [string equal $rchan ""] return
	set a [open $file w+]
	puts $a [join $rchan]
	close $a
	putlog "\[Shoutcast\] Sauvegarde de la liste des salons"
}
 
proc sc::addchan {nick host hand arg} {
	variable rchan
	set chan [string tolower [lindex $arg 0]]
	if {$chan==""} {putserv "NOTICE $nick :\002Syntaxe:\002 /msg $::botnick radioadd #salon";return}
	if {[lsearch -nocase $rchan $chan]!=-1} {putserv "NOTICE $nick :Ce salon est déjà dans la liste.";return}
	lappend rchan $chan
	if ![validchan $chan] {channel add $chan;savechannels}
	putserv "NOTICE $nick :Salon ajouté avec succès."
	return 1
}
 
proc sc::delchan {nick host hand arg} {
	variable rchan
	set chan [string tolower [lindex $arg 0]]
	if {$chan==""} {putserv "NOTICE $nick :\002Syntaxe:\002 /msg $::botnick radiodel #salon";return}
	if {[set a [lsearch -nocase $rchan $chan]]==-1} {putserv "NOTICE $nick :Ce salon n'est pas dans la liste.";return}
	set rchan [lreplace $rchan $a $a]
	if [validchan $chan] {channel remove $chan;savechannels}
	putserv "NOTICE $nick :Salon supprimé avec succès."
	return 1
}
 
proc sc::listchan {nick host hand arg} {
	variable rchan
	putserv "notice $nick :[join $rchan]"
	return 1
}
 
proc sc::url {nick host hand chan arg} {
	variable sc
	putserv "PRIVMSG $chan :[::msgcat::mc m18 $sc(lien)]"
}
 
proc sc::nkchg {nick host hand chan nnick} {
	variable dj
	if {[info exists dj] && [string equal -nocase $dj $nick]} {
		set dj $nnick
	}
}
 
proc sc::send {type arg} {
	variable rchan
	if [string equal $rchan ""] {set rchan [channels]}
	putserv "PRIVMSG [join $rchan ,] :$arg"
#	foreach c $rchan {
#		putserv "PRIVMSG $c :$arg"
#	}
}
 
proc sc::equal {vname1 vname2} {
	upvar 1 $vname1 v1
	upvar 1 $vname2 v2
	expr {[info exists v1] && [string equal $v1 $v2]}
}
 
proc sc::getinfo {type varname} {
	upvar info info
	uplevel 1 [list regexp "<$type>*(\[^<\]*)" $info _all_ $varname]
}
 
proc ::sc::controle {1 2 3 4 5} {
	variable sc
	variable title
	variable listeners
	variable rlisteners
	variable status
	variable bitrate
	variable stitle
	variable sgenre
	variable lastmusic
	variable achan

#	putlog "\00310shoutcast: vérification du stream"
 
	set url "http://[set sc(ip)]:[set sc(port)]/admin.cgi?pass=[set sc(adminpass)]&mode=viewxml&page=0&sid=1"
	set httpconfig [::http::config -useragent "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"]
	set marque [http::geturl $url -timeout 30000]
	set info [http::data $marque]
	http::cleanup $marque
	set info [sc::clean $info]
 
	if [getinfo STREAMSTATUS s] {
		if ![equal status s] {
			set status $s
			if $s {
				putserv "PRIVMSG $achan :[::msgcat::mc m1]"
			} else {
				putserv "PRIVMSG $achan :[::msgcat::mc m2]"
			}
		}
		if !$s return
	}
 
	if {[getinfo SONGTITLE t] && ![equal title t]} {
		set title $t
		lappend lastmusic $t
		if {[llength $lastmusic]>3} {
			set lastmusic [lreplace $lastmusic 0 0]
		}
		if [set sc(annonce)] {send PRIVMSG [::msgcat::mc m3 [string tolower $t]]}
	}
	set x 0
	if {[getinfo CURRENTLISTENERS l] && ![equal listeners l]} {
		set listeners $l
		set x 1
	}
	if {[getinfo REPORTEDLISTENERS rl] && ![equal rlisteners rl]} {
		set rlisteners $rl
		set x 1
	}
	if $x {
		putserv "PRIVMSG $achan :[::msgcat::mc m0 $l $rl]"
	}
	if {[getinfo BITRATE br] && ![equal bitrate br]} {
		set bitrate $br
		putserv "PRIVMSG $achan :[::msgcat::mc m4 $br]"
	}
	if {[getinfo SERVERTITLE st] && ![equal stitle st]} {
		set stitle $st
		set x 1
	}
	if {[getinfo SERVERGENRE sg] && ![equal sgenre sg]} {
		set sgenre $sg
		set x 1
	}
}
 
proc sc::titre {nick host hand chan arg} {
	variable status
	variable title
	variable rchan
	if {[info exists status] && !$status} return
	if {$rchan!="" && [lsearch -nocase $rchan $chan]==-1} return
	putserv "NOTICE $nick :[::msgcat::mc m17 $title]"
}
 
proc sc::dedim {nick host hand arg} {
	dedi $nick $arg
}
 
proc sc::dedip {nick host hand chan arg} {
	variable rchan
	if {$rchan!="" && [lsearch -nocase $rchan $chan]==-1} return
	dedi $nick $arg
}
 
proc sc::dedi {nick arg} {
	variable dj
	variable status
	if {$arg == ""} { putserv "NOTICE $nick :[::msgcat::mc m5]";return}
	if {[info exists status] && !$status} {putserv "NOTICE $nick :[::msgcat::mc m6]";return}
	putserv "NOTICE $nick :[msgcat::mc m7]"
	putlog [::msgcat::mc m8 $nick $arg]
	putserv "PRIVMSG $dj :[::msgcat::mc m9 $nick $arg]" 
}
 
proc sc::djm {nick host hand arg} {
	dj $nick
}
 
proc sc::djp {nick host hand chan arg} {
	variable rchan
#	if {$rchan!="" && [lsearch -nocase $rchan $chan]==-1} return
	dj $nick
}
 
proc sc::dj nick {
	variable dj
	if [info exists dj] {
		putserv "NOTICE $nick :[::msgcat::mc m10 $dj]"
	} else {
		putserv "NOTICE $nick :[::msgcat::mc m11]"
	}
}
 
proc sc::unsetdjm {nick host hand arg} {
	unsetdj $nick [lindex $arg 0]
}
 
proc sc::unsetdjp {nick host hand chan arg} {
	unsetdj $nick [lindex $arg 0]
}
 
proc sc::unsetdj {nick {djnick {}}} {
	variable dj
	send PRIVMSG [::msgcat::mc m12 $dj]
	unset -nocomplain dj
}
 
proc sc::setdjm {nick host hand arg} {
	setdj $nick [lindex $arg 0]
}
 
proc sc::setdjp {nick host hand chan arg} {
	setdj $nick [lindex $arg 0]
}
 
proc sc::setdj {nick {djnick {}}} {
	variable sc
	variable dj
	variable achan
 
	if [string equal $djnick ""] {set djnick $nick}
	if {[info exists dj] && [string equal -nocase $dj $djnick]} {
		putserv "NOTICE $nick :[::msgcat::mc m13 $dj]"
		return
	}
	set dj $djnick
 
	if [set sc(kpl)] {
		set url "http://[set sc(ip)]:[set sc(port)]/admin.cgi?pass=[set sc(adminpass)]&mode=kicksrc"
		set httpconfig [::http::config -useragent "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"]
		set marque [http::geturl $url -timeout 30000]
		http::cleanup $marque
	}
 
	putserv "NOTICE $djnick :[::msgcat::mc m14]"
	putserv "PRIVMSG $achan :[::msgcat::mc m15 $dj]"
	send PRIVMSG [::msgcat::mc m16 $dj]
}
 
proc sc::clean arg {
	string map [list \
		"&#x3C;" < \
		"&#x3E;" > \
		"&#x26;" + \
		"&#x22;" \" \
		"&#x27;" ' \
		"&#x96;" - \
		"&#xB7;" · \
		"&#xDF;" ß \
		"&#xE1;" á \
		"&#xE0;" à \
		"&#xE2;" â \
		"&#xE4;" ä \
		"&#xC0;" À \
		"&#xC3;" Ã \
		"&#xC4;" Ä \
		"&#xE9;" é \
		"&#xE8;" è \
		"&#xEA;" ê \
		"&#xEB;" ë \
		"&#xEE;" î \
		"&#xEF;" ï \
		"&#xED;" í \
		"&#xF4;" ô \
		"&#xF6;" ö \
		"&#xD4;" Ô \
		"&#xD6;" Ö \
		"&#xF9;" ù \
		"&#xFB;" û \
		"&#xFC;" ü \
		"&#xDB;" Û \
		"&#xDC;" Ü \
		"&#xFF;" ÿ \
		"&#xE7;" ç \
		"&#xC7;" Ç \
		"&#xc9;" É \
		"&#xb0;" ° \
		"'" \' \
		"'" \' \
		""" \' \
		"&" & \
		"[" ( \
		"\" / \
		"]" ) \
		"{" ( \
		"}" ) \
		"£" £ \
		"¨" ¨ \
		"©" © \
		"«" « \
		"­" "­" \
		"®" ® \
		"´" ´ \
		"·" · \
		"¹" ¹ \
		"»" » \
		"¼" ¼ \
		"½" ½ \
		"¾" ¾ \
		"À" À \
		"Á" Á \
		"Â" Â \
		"Ã" Ã \
		"Ä" Ä \
		"Å" Å \
		"Æ" Æ \
		"Ç" Ç \
		"È" È \
		"É" É \
		"Ê" Ê \
		"Ë" Ë \
		"Ì" Ì \
		"Í" Í \
		"Î" Î \
		"Ï" Ï \
		"Ð" Ð \
		"Ñ" Ñ \
		"Ò" Ò \
		"Ó" Ó \
		"Ô" Ô \
		"Õ" Õ \
		"Ö" Ö \
		"×" × \
		"Ø" Ø \
		"Ù" Ù \
		"Ú" Ú \
		"Û" Û \
		"Ü" Ü \
		"Ý" Ý \
		"Þ" Þ \
		"ß" ß \
		"à" à \
		"á" á \
		"â" â \
		"ã" ã \
		"ä" ä \
		"å" å \
		"æ" æ \
		"ç" ç \
		"è" è \
		"é" é \
		"ê" ê \
		"ë" ë \
		"ì" ì \
		"í" í \
		"î" î \
		"ï" ï \
		"ð" ð \
		"ñ" ñ \
		"ò" ò \
		"ó" ó \
		"ô" ô \
		"õ" õ \
		"ö" ö \
		"÷" ÷ \
		"ø" ø \
		"ù" ù \
		"ú" ú \
		"û" û \
		"ü" ü \
		"ý" ý \
		"þ" þ \
		"&lt;" < \
		"&gt;" > \
		"&agrave;" à \
		"&agrave;" à \
		"&aacute;" á \
		"&acirc;" â \
		"&eacute;" ã \
		"&auml;" ä \
		"&aring;" å \
		"&aelig;" æ \
		"&ccedil;" ç \
		"&egrave;" è \
		"&eacute;" é \
		"&ecirc;" ê \
		"&euml;" ë \
		"&igrave;" ì \
		"&iacute;" í \
		"&icirc;" î \
		"&iuml;" ï \
		"&eth;" ð \
		"&ntilde;" ñ \
		"&ograve;" ò \
		"&oacute;" ó \
		"&ocirc;" ô \
		"&otilde;" õ \
		"&ouml;" ö \
		"&divide;" ÷ \
		"&oslash;" ø \
		"&ugrave;" ù \
		"&uacute;" ú \
		"&ucirc;" û \
		"&uuml;" ü \
		"&yacute;" ý \
		"&thorn;" þ \
		"&yuml;" ÿ \
		"&quot;" \" \
		"&amp;" & \
		"&euro;" \€ \
		"&oelig;" œ \
		"&Yuml;" Ÿ \
		"&nbsp;" " " \
		"&iexcl;" ¡ \
		"&cent;" ¢ \
		"&pound;" £ \
		"&curren;" ¤ \
		"&yen;" ¥ \
		"&brvbar;" ¦ \
		"&brkbar;" ¦ \
		"&sect;" § \
		"&uml;" ¨ \
		"&die;" ¨ \
		"&copy;" © \
		"&ordf;" ª \
		"&laquo;" « \
		"&not;" ¬ \
		"&shy;" ­- \
		"&reg;" ® \
		"&macr;" ¯ \
		"&hibar;" ¯ \
		"&deg;" ° \
		"&plusmn;" ± \
		"&sup2;" ² \
		"&sup3;" ³ \
		"&acute;" ´ \
		"&micro;" µ \
		"&para;" ¶ \
		"&middot;" · \
		"&cedil;" ¸ \
		"&sup1;" ¹ \
		"&ordm;" º \
		"&raquo;" » \
		"&frac14;" ¼ \
		"&frac12;" ½ \
		"&frac34;" ¾ \
		"&iquest;" ¿ \
		"&Agrave;" À \
		"&Aacute;" Á \
		"&Acirc;" Â \
		"&Atilde;" Ã \
		"&Auml;" Ä \
		"&Aring;" Å \
		"&AElig;" Æ \
		"&Ccedil;" Ç \
		"&Egrave;" È \
		"&Eacute;" É \
		"&Ecirc;" Ê \
		"&Euml;" Ë \
		"&Igrave;" Ì \
		"&Iacute;" Í \
		"&Icirc;" Î \
		"&Iuml;" Ï \
		"&ETH;" Ð \
		"&Dstrok;" Ð \
		"&Ntilde;" Ñ \
		"&Ograve;" Ò \
		"&Oacute;" Ó \
		"&Ocirc;" Ô \
		"&Otilde;" Õ \
		"&Ouml;" Ö \
		"&times;" × \
		"&Oslash;" Ø \
		"&Ugrave;" Ù \
		"&Uacute;" Ú \
		"&Ucirc;" Û \
		"&Uuml;" Ü \
		"&Yacute;" Ý \
		"&THORN;" Þ \
		"&szlig;" "ß"
	] $arg
}
 
putlog "ShoutcastCharger"



j'ai modifier une lignes pour que le bot puisse lire les titres:

tcl
set url "http://[set sc(ip)]:[set sc(port)]/admin.cgi?pass=[set sc(adminpass)]&mode=viewxml&page=0"



qui j'ai remplacé pas celle ci :

tcl
set url "http://[set sc(ip)]:[set sc(port)]/admin.cgi?pass=[set sc(adminpass)]&mode=viewxml&page=0&sid=1"




Après pour l'encodage au niveau de la shoutcast je ne vois pas comment voir ça , regarder le code source sur la page admin depuis mon navigateur peut être ?
Répondre Avertir
#5
Non mais ça va, je connais encore le principe de ce genre de système.
Donc, je repose la question de manière plus précise:

Peux tu voir exactement ce qu'il y a comme texte dans ton XML, par exemple en faisant un wget lorsque l'eggdrop décode mal, afin de savoir si le souci provient du tcl ou de la source ?
Parce que même s'il est très facile de mettre en cause le tcl (ce qui est une possibilité que je n'exclue pas), il est aussi possible que l'encodage soit mauvais au départ mais que cela ne se voit pas sur un navigateur web car il est capable de s'adapter.
Répondre
#6
Dans mon calendar.xml j'ai que ça dedans :

Code :
<?xml version="1.0" encoding="UTF-8"?>
<!--Calendar configuration file-->
<!--Made with the SHOUTcast 2 Configuration Builder-->
<eventlist>
    <event type="dj">
        <dj archive="inherit">dj1</dj>
        <calendar />
    </event>
    <event type="dj">
        <dj archive="inherit">dj2</dj>
        <calendar />
    </event>
</eventlist>

Pour ce qui est de faire un wget lorsque l'eggdrop décode mal tu peux m'expliqué comment faire ? je vois pas du tout .
Répondre Avertir
#7
ça vient bien de la shoutcast enfin je pense

Code :
2013-08-04 14:30:53     I       msg:[SRC ip:48795 sid=1] Got complete metadata message type=14594 id=1 span=1 content=
<?xml version="1.0" encoding="UTF-8" ?>
<metadata>
<TIT2>Christophe Maé - A l&apos;abri</TIT2>
</metadata>
2013-08-04 14:34:52     I       msg:[SRC ip:48795 sid=1] Got complete metadata message type=14594 id=1 span=1 content=
<?xml version="1.0" encoding="UTF-8" ?>
<metadata>
<TIT2>Christophe Maé - L&apos;automne</TIT2>
</metadata>

Merci de m'avoir mis sur la voie CrazyCat j'ai rajouté un caractère dans le code est ça fonctionne pour l'apostrophe peut être que pour les accents celas fonctionneras j'ai rajouté comme ceci "&apos;" ' \ par contre je ne sais pas a quoi correspond l'encodage tu as une idée ?
Répondre Avertir
#8
Déjà, le &apos; c'est du pur xhtml, donc effectivement il fait l'ajouter à la table de mappage.

Ensuite, à mon avis, shoutcast reçoit des infos en encodage windows (cp1252 ?) et en fait un espèce d'utf-8. Tu ne pourras pas faire grand-chose au niveau du tcl qui que c'est ce que l'eggdrop lit qui est mauvais.
Tu peux essayer de transformer en un truc plus juste, par exemple en disant que les à sont en fait des "é", mais c'est vraiment du chipotage pour ton shoutcast et tes mp3.

Pour info, une table des entités HTML : http://www.madore.org/~david/computers/u...mlent.html
Répondre
#9
Pour ceux qui ont le même problème que moi voila la solution ( y'a pas tout les caractères )

tcl
proc sc::clean arg {
	string map [list \
	  "&amp;" & \
	  "&apos;" \' \
	  "ó" ó \
	  "ç" ç \
	  "ê" ê \
	  "è" "è"	  
   ] $arg
}



Merci de m'avoir mis sur la voie CrazyCat.

[Problème résolu]
Répondre Avertir


Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté