Hello,
I have made a little program to create a playlist of all the mp3 's in a
folder. That work fine for me, but I have a problem with special characters
like é and ó.
In my playlist, they are good, but when I open the playlist in WinAmp, then
André becames: André
When I create a new playlist in WinAmp, and I open it again, then André
still is André.
When I open the playlists in Notepad, then the seems not different.
I use the code from this page:
http://www.codeproject.com/csharp/shellid3tagreader.asp to get the filename,
artist name and so on from the mp3.
I write my playlist with this code (with a little bit Dutch in it, but I
think you can understand):
public void Create()
{
DirectoryInfo dir = new DirectoryInfo(Pad);
FileInfo[] files = dir.GetFiles("*.mp3");
// Playlist opslaan
StreamWriter sw = new StreamWriter(dir.FullName + "\\" + fileName);
sw.WriteLine("#EXTM3U");
sw.WriteLine();
Mp3Bestand[] file = new Mp3Bestand[files.Length];
int t = 0;
foreach (FileInfo fi in files)
{
MP3File mp3File = ShellID3TagReader.ReadID3Tags(fi.FullName);
file[t] = new Mp3Bestand();
file[t].TrackNumber = mp3File.TrackNumber;
file[t].Length = mp3File.Lengte;
file[t].Artist = mp3File.ArtistName;
file[t].Title = mp3File.SongTitle;
file[t].FileName = mp3File.FileName;
t++;
}
Array.Sort(file);
foreach (Mp3Bestand file in file)
{
sw.WriteLine("#EXTINF:" + file.Length + "," + file.Artist + " - " +
file.Title);
sw.WriteLine(file.FileName);
sw.WriteLine();
}
sw.Close();
}
Does do you know a solution for this problem?
Martin Honnen - 19 Nov 2006 14:19 GMT
> StreamWriter sw = new StreamWriter(dir.FullName + "\\" + fileName);
Can you try
StreamWriter sw = new StreamWriter(dir.FullName + "\\" + fileName,
System.Text.Encoding.Default);
instead?
Your current code writes an UTF-8 encoded file, perhaps WinAmp expects
the file encoded as e.g. Windows-1252 or the system's default code page.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Gerrit - 19 Nov 2006 20:47 GMT
>> StreamWriter sw = new StreamWriter(dir.FullName + "\\" + fileName);
>
[quoted text clipped - 4 lines]
> Your current code writes an UTF-8 encoded file, perhaps WinAmp expects the
> file encoded as e.g. Windows-1252 or the system's default code page.
Ok, I 've tryed and I think this is the solution
Thank you!