Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default encoding for text frames is ISO 8859-1 #54

Closed
lazka opened this issue Jul 4, 2014 · 2 comments
Closed

Default encoding for text frames is ISO 8859-1 #54

lazka opened this issue Jul 4, 2014 · 2 comments
Labels
bug

Comments

@lazka
Copy link
Member

@lazka lazka commented Jul 4, 2014

Originally reported by: Christoph Reiter (Bitbucket: lazka, GitHub: lazka)


From cy...@home.se on January 18, 2010 11:10:15

When setting text frames (like the title) using EasyID3, the encoding is
set to ISO 8859-1 (or Latin 1).

id3 = EasyID3(filename)
id3['title'] = title

If the title contains characters that are not in ISO 8859-1, such as
en-dash (–), EncodedTextSpec.write() will throw a UnicodeEncodeError, which
is not caught.

Since the setter method in EasyID3.RegisterTextKey sets encoding = 3 on
KeyError, why not set encoding = 3 for known frames? There is probably a
better way to do this, but I fixed it by adding this line in the else
clause of the setter:

frame.encoding = 3

Also, maybe we should use an 'ignore' or 'replace' flag for value.encode()
in EncodedTextSpec.write()?

Original issue: http://code.google.com/p/mutagen/issues/detail?id=54


@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From joe.wreschnig@gmail.com on February 04, 2010 21:23:23

This issue was closed by revision r80 .

Status: Fixed
Mergedinto: -

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Jul 4, 2014

Original comment by Christoph Reiter (Bitbucket: lazka, GitHub: lazka):


From joe.wreschnig@gmail.com on January 18, 2010 04:25:13

No, the behavior should be to throw an error. This is a bug, and should be fixed -
the encoding should be set to UTF-16 as you suggest when you change the key.

Labels: -Type-Enhancement -Priority-Low Type-Defect Priority-High

@lazka lazka added trivial bug labels Apr 7, 2016
@lazka lazka closed this Apr 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.