View previous topic :: View next topic |
Author |
Message |
CandyBar
Joined: 26 Aug 2007 Posts: 5
|
Posted: Sun Aug 26, 2007 11:01 pm Post subject: Would like the option of CDATA in xml for admin areas |
|
|
Due to the client being used and multiple languages, there are many times that icecast will have illegal xml characters in the status file in the admin area. This breaks the xml, the parser I use to display icecast data on my website fails horribly, and causes me all kinds of problems. It would be nice to have the option to wrap the data for title and yp_currently_playing in <![CDATA[ ]]> so that the xml parser I use would function at all times.
I'm actually very willling to do this myself/build from source and have looked through the source, but I haven't had any luck in figuring out where to make the change. So if someone would point me in the right direction I would appreciate that too
Thanks. |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Mon Aug 27, 2007 12:19 am Post subject: |
|
|
Many/Most mp3 source clients don't have a policy for specifying non-ascii characters. With our stats/YP engine (and therefore the xml as well) we assume UTF8 as that deals with multiple languages.
As many source clients don't tell us the character set, we have to assume something and in 2.3.1 it's UTF8 but In my branch work I assumed ISO8859-1 for non-ogg streams which can be changed to some other character set with the <charset> mount option. I've merged this code into trunk as well as the results have proved quite useful.
Either try my branch work at my website or the current trunk code to try it out. Use charset if it's some other character set.
karl. |
|
Back to top |
|
|
CandyBar
Joined: 26 Aug 2007 Posts: 5
|
Posted: Mon Aug 27, 2007 12:30 am Post subject: |
|
|
I will try, but I think the data has already been ruined by the client before it ever gets to icecast, so that the charset setting won't matter. |
|
Back to top |
|
|
CandyBar
Joined: 26 Aug 2007 Posts: 5
|
Posted: Mon Aug 27, 2007 10:33 am Post subject: |
|
|
Using your windows build from this link:
http://www.icecast.pwp.blueyonder.co.uk/icecast2_win32_v2.3.1-kh19_setup.exe
this is my mount setup:
Code: |
<mount>
<charset>UTF8</charset>
<mount-name>/testing</mount-name>
</mount>
|
This is the source I get from Firefox when the xml breaks:
Code: |
<?xml version="1.0" encoding="ISO-8859-1"?>
<icestats>
<admin>icemaster@localhost</admin>
<client_connections>241</client_connections>
<clients>2</clients>
<connections>243</connections>
<file_connections>119</file_connections>
<host>localhost</host>
<listener_connections>0</listener_connections>
<listeners>0</listeners>
<location>Earth</location>
<server>Icecast 2.3-kh19</server>
<server_start>Mon, 27 Aug 2007 04:23:59 Eastern Daylight Time</server_start>
<source_client_connections>1</source_client_connections>
<source_relay_connections>0</source_relay_connections>
<source_total_connections>1</source_total_connections>
<sources>1</sources>
<stats>0</stats>
<stats_connections>0</stats_connections>
<stream_kbytes_read>279015</stream_kbytes_read>
<stream_kbytes_sent>0</stream_kbytes_sent>
<source mount="/testing">
<audio_info>ice-samplerate=44100;ice-bitrate=320;ice-channels=2</audio_info>
<bitrate>320</bitrate>
<connected>7143</connected>
<genre>Various</genre>
<ice-bitrate>320</ice-bitrate>
<ice-channels>2</ice-channels>
<ice-samplerate>44100</ice-samplerate>
<incoming_bitrate>319</incoming_bitrate>
<listener_connections>0</listener_connections>
<listener_peak>0</listener_peak>
<listeners>0</listeners>
<listenurl>http://localhost:8000/testing</listenurl>
<max_listeners>unlimited</max_listeners>
<outgoing_bitrate>0</outgoing_bitrate>
<public>0</public>
<server_description>My station description</server_description>
<server_name>My Station name</server_name>
<server_type>audio/mpeg</server_type>
<server_url>http://www.audiorealm.com</server_url>
<slow_listeners>0</slow_listeners>
<source_ip>127.0.0.1</source_ip>
<stream_start>Mon, 27 Aug 2007 04:24:30 Eastern Daylight Time</stream_start>
<title>DREAMS COME TRUE - ¤ͤߤˤפ
|
This is what the browser shows:
Code: |
XML Parsing Error: no element found
Location: http://localhost:8000/admin/status.xml
Line Number 45, Column 58: <title>DREAMS COME TRUE - ¤ͤߤˤפ
---------------------------------------------------------^
|
error log:
Code: |
[2007-08-27 06:23:36] INFO admin/ processing file status.xml
[2007-08-27 06:23:36] WARN xmlEncodeEntitiesReentrant : input not UTF-8
[2007-08-27 06:23:36] WARN output conversion failed due to conv error, bytes 0xAB 0xC2 0x84 0xA4
[2007-08-27 06:23:36] WARN encoder error
|
I have no control over the encoding The stupid source client messes it up... |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Mon Aug 27, 2007 12:23 pm Post subject: |
|
|
Do you know what the encoding is, by default non-ogg assumes ISO-8859-1 not UTF8 as that is most common for mp3 type sources
karl. |
|
Back to top |
|
|
|