dhowden / tag

ID3, MP4 and OGG/FLAC metadata parsing in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Encoding error reading file

blimmo opened this issue · comments

Running this code:

package main

import (
	"log"
	"os"

	"github.com/dhowden/tag"
)

func main() {
	f, err := os.Open("test.mp3")
	if err != nil {
		log.Fatal(err)
	}
	m, err := tag.ReadFrom(f)
	if err != nil {
		log.Fatal(err)
	}
	log.Println(m.Format())
}

On the attached file (in a zip to get github to accept it) test.zip

Gives this error:

error decoding tag description text: invalid encoding: expected even number of bytes for UTF-16 encoded text

The file has non-ASCII characters in the metadata.
I thought it might be a bad file but windows, foobar, etc. are fine with it and displaying its metadata.

Fixed by #36

I'm still getting this error with some of my files

Could you attach an example file?

Sorry for taking so long.
2CELLOS - Despacito.mp3.zip