aadsm / jsmediatags

Media Tags Reader (ID3, MP4, FLAC)
Other
745 stars 128 forks source link

Can I know the encoding of artist and title? #87

Closed ByungJoonChoi closed 6 years ago

ByungJoonChoi commented 6 years ago

Hello. I'm using jsmediatags in web browser.

I just read tag from local file. And then get artist by tag.tags.artist. But, I can't read this because the metadata (artist, title) are encoded by 'CP949'. When I check the hex code of the string(artist) and convert it to the unicode string, I can read this!!

So, I have a question. Is there a way to know the encoding of the artist by using this jsmediatags library? I want to apply my converting code to the artist string only if the encoding is 'CP949'.

stwktw commented 6 years ago

same problem

aadsm commented 6 years ago

IDv3 only supports utf and iso-8859-1. Some tag writers do use other encodings and declare them as iso-8859-1, hence the problem. This is exactly the reason why I created the https://github.com/aadsm/jschardet library, it detects the encoding given a string.