Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Character Encoding Problem

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Tue Jun 28, 2005 4:51 am    Post subject: Character Encoding Problem Reply with quote

I have set up an Icecast server on my computer. I feed it a stream using icegenerator. I use the comment tag in my mp3 files to store preformatted META data in a format like the following:
«Mad About You» by «Sting» from the album «The Soul Cages»

This shows up fine in RealPlayer, but it shows up in the status page as:
«Mad About You? by ?Sting? from the album ?The Soul Cages?

It seems that only the first of the extended characters is being properly encoded to UTF-8, while the rest are not. If I change the encoding specified in the xsl file to iso-8859-1, it shows up as the following:
«Mad About You» by «Sting» from the album «The Soul Cages»

How can I get all of the characters encoded into UTF-8? (Or, as an alternative, none of them, so it will show up properly as iso-8859-1)

Any help would be appreciated
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Tue Jun 28, 2005 1:06 pm    Post subject: Re: Character Encoding Problem Reply with quote

rkjnsn wrote:
I have set up an Icecast server on my computer. I feed it a stream using icegenerator. I use the comment tag in my mp3 files to store preformatted META data in a format like the following:
«Mad About You» by «Sting» from the album «The Soul Cages»


is that metadata in the mp3 file stored as UTF-8 ?

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Wed Jun 29, 2005 3:19 am    Post subject: Reply with quote

I do not think it is in UTF-8. I encode my mp3s with the following script:
Code:

#!/bin/bash

ENC_OPTIONS="--preset cbr 96"
for file in "$@"
do
  newname="`basename "$file" .flac`.mp3"
  echo Encoding `basename "$file"` to $newname
  TITLE=`metaflac --show-tag=TITLE "$file" | cut -b 7-`
  ARTIST=`metaflac --show-tag=ARTIST "$file" | cut -b 8-`
  ALBUM=`metaflac --show-tag=ALBUM "$file" | cut -b 7-`
  TRACK=`metaflac --show-tag=TRACKNUMBER "$file" | cut -b 13-`
  YEAR=`metaflac --show-tag=DATE "$file" | cut -b 6-9`
  COMMENT="Random Music - «${TITLE}» by «${ARTIST}» from the album «${ALBUM}»"
  flac -d -c "$file" | lame $ENC_OPTIONS --tt "$TITLE" --ta "$ARTIST" --tl "$ALBUM" --tn "$TRACK" --ty "$YEAR" --tc "$COMMENT" - "$newname"
  mp3gain -r -c "$newname"
done


Unless lame is UTF-8 encoding it, it is not.
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Wed Jun 29, 2005 3:17 pm    Post subject: Reply with quote

rkjnsn wrote:
I do not think it is in UTF-8. I encode my mp3s with the following script:
....
Unless lame is UTF-8 encoding it, it is not.


your mp3 files are getting details based on your flac files, so are you writing utf-8 strings to the flac files? you need to check where the tags come from and if it is not ascii then which charset is it in

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Thu Jun 30, 2005 3:34 am    Post subject: Reply with quote

karlH wrote:
your mp3 files are getting details based on your flac files, so are you writing utf-8 strings to the flac files? you need to check where the tags come from and if it is not ascii then which charset is it in

karl.


The flac files are encoded by Exact Audio Copy calling the flac executible, passing the tag info on the command line. The only characters which need any special encoding are the double angle quotes, however, and these are not from the flac file, but instead added by the shell script.

If you like, I can test it with a manually tagged mp3 file, instead of one with information pulled from a flac file.
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Thu Jun 30, 2005 11:26 am    Post subject: Reply with quote

rkjnsn wrote:
The flac files are encoded by Exact Audio Copy calling the flac executible, passing the tag info on the command line. The only characters which need any special encoding are the double angle quotes, however, and these are not from the flac file, but instead added by the shell script.

If you like, I can test it with a manually tagged mp3 file, instead of one with information pulled from a flac file.


If it's just those odd few chars then I suspect that the charset is defined by the editor used to insert them into the shell script.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Anonymous
Guest





PostPosted: Fri Jul 01, 2005 5:30 am    Post subject: Reply with quote

Quote:
If it's just those odd few chars then I suspect that the charset is defined by the editor used to insert them into the shell script.

karl.


The editor (vim) is not using utf-8. The odd thing is that the first odd character gets converted to utf-8, while the others do not. I will test tagging one mp3 manually to see what results I get.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
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


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber