Index: apps/metadata.c
===================================================================
RCS file: /cvsroot/rockbox/apps/metadata.c,v
retrieving revision 1.52
diff -u -r1.52 metadata.c
--- apps/metadata.c	11 Oct 2006 17:42:33 -0000	1.52
+++ apps/metadata.c	11 Oct 2006 22:27:28 -0000
@@ -26,6 +26,7 @@
 #include "metadata.h"
 #include "mp3_playback.h"
 #include "logf.h"
+#include "rbunicode.h"
 #include "atoi.h"
 #include "replaygain.h"
 #include "debug.h"
@@ -1430,39 +1563,39 @@
     
 
     if ((lseek(fd, 0, SEEK_SET) < 0) 
-        || ((read_bytes = read(fd, buf, sizeof(id3->path))) < 44))
+         || ((read_bytes = read(fd, buf, 0x80)) < 0x80))
     {
         return false;
     }
     
-    if ((memcmp(buf, "PSID",4) != 0))
+    if ((memcmp(buf, "PSID",4) != 0))        
     {
         return false;
     }
 
     p = id3->id3v2buf;
 
-    /* Copy Title (assumed max 0x1f letters + 1 zero byte) */
-    strncpy(p, (char *)&buf[0x16], 0x20);
-    p[0x1f]=0; /* make sure it is zero terminated */
+    /* Copy Title */
     id3->title = p;
-    p += strlen(p)+1;
+    p = iso_decode(&buf[0x16], p, 0, strlen(&buf[0x16])+1);
 
-    /* Copy Artist (assumed max 0x1f letters + 1 zero byte) */
-    strncpy(p, (char *)&buf[0x36], 0x20);
-    p[0x1f]=0; /* make sure it is zero terminated */
+    /* Copy Artist */
     id3->artist = p;
+    p = iso_decode(&buf[0x36], p, 0, strlen(&buf[0x36])+1);
+
+    /* Copy Year */
+    id3->year = atoi(&buf[0x56]);
+
+    /* Copy Album */
+    id3->album = p;
+    p = iso_decode(&buf[0x5b], p, 0, strlen(&buf[0x5b])+1);
 
     id3->bitrate = 706;
     id3->frequency = 44100;
     /* New idea as posted by Marco Alanen (ravon):
      * Set the songlength in seconds to the number of subsongs
      * so every second represents a subsong.
-     * Users can then skip the current subsong by seeking
-     *
-     * Note: the number of songs is a 16bit value at 0xE, so this code only
-     * uses the lower 8 bits of the counter.
-    */
+     * Users can then skip the current subsong by seeking */
     id3->length = (buf[0xf]-1)*1000;
     id3->vbr = false;
     id3->filesize = filesize(fd);

