View previous topic :: View next topic |
Author |
Message |
Anonymous Guest
|
Posted: Tue Jun 28, 2005 4:51 am Post subject: Character Encoding Problem |
|
|
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
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Tue Jun 28, 2005 1:06 pm Post subject: Re: Character Encoding Problem |
|
|
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 |
|
|
Anonymous Guest
|
Posted: Wed Jun 29, 2005 3:19 am Post subject: |
|
|
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
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Jun 29, 2005 3:17 pm Post subject: |
|
|
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 |
|
|
Anonymous Guest
|
Posted: Thu Jun 30, 2005 3:34 am Post subject: |
|
|
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
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Jun 30, 2005 11:26 am Post subject: |
|
|
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 |
|
|
Anonymous Guest
|
Posted: Fri Jul 01, 2005 5:30 am Post subject: |
|
|
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 |
|
|
|