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

mid3v2 and unicode filenames (windows) #214

Closed
lazka opened this issue Feb 15, 2015 · 5 comments
Closed

mid3v2 and unicode filenames (windows) #214

lazka opened this issue Feb 15, 2015 · 5 comments
Labels
bug

Comments

@lazka
Copy link
Member

@lazka lazka commented Feb 15, 2015

Originally reported by: Brad Lanam (Bitbucket: bll123, GitHub: bll123)


The mid3v2 program does not appear to be able to process a unicode filename.
I get:
[Errno 22] invalid mode ('rb') or filename: './music dir/O.2.23 unicode...???.mp3'
(question marks are from cmd.exe).

(
chcp 65001
copy .\waltz.mp3 ".\O.2.23 unicode...ははは.mp3"
c:/Python27/python.exe "mid3v2" --TIT2 "O.2.23 unicode...ははは" "./O.2.23 unicode...ははは.mp3"
chcp 437
)


@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Feb 15, 2015

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


Yeah, python2 doesn't implement unicode argv handling on Windows. We probably need to access the windows api using ctypes/pywin32 instead.

Thanks for the report.

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Mar 6, 2015

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


tools: Add unicode filename support for Windows+Python2. (Fixes issue #214)

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Apr 24, 2015

Original comment by Brad Lanam (Bitbucket: bll123, GitHub: bll123):


Version 1.28
This seems to be worse.
It used to work on the á character.

C:\Users\bll\Desktop\BallroomDJ\test.dir\z>c:/Python27/python.exe "mid3v2" --TIT
2 "O.2.23 unicode...ははは" "./O.2.23 unicode...ははは.mp3"
Traceback (most recent call last):
File "mid3v2", line 349, in
main(sys.argv)
File "mid3v2", line 331, in main
write_files(parser.edits, args, options.escape)
File "mid3v2", line 132, in write_files
value = value.decode(enc)
File "c:\Python27\lib\encodings\cp1252.py", line 15, in decode
return codecs.charmap_decode(input,errors,decoding_table)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 17-19: ord
inal not in range(128)

C:\Users\bll\Desktop\BallroomDJ\test.dir\z>c:/Python27/python.exe "mid3v2" --TIT
2 "accent á test" "./accent á test.mp3"
Traceback (most recent call last):
File "mid3v2", line 349, in
main(sys.argv)
File "mid3v2", line 331, in main
write_files(parser.edits, args, options.escape)
File "mid3v2", line 132, in write_files
value = value.decode(enc)
File "c:\Python27\lib\encodings\cp1252.py", line 15, in decode
return codecs.charmap_decode(input,errors,decoding_table)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 7:
ordinal not in range(128)

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Apr 29, 2015

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


Should be fixed now. At least for passing in stuff. Printing unicode is still broken and I have no idea how to do it under Windows with either Python 2 or 3.

@lazka

This comment has been minimized.

Copy link
Member Author

@lazka lazka commented Apr 29, 2015

Original comment by Brad Lanam (Bitbucket: bll123, GitHub: bll123):


Output should be fine -- never had a problem with it. I actually am running mutagen-inspect and mid3v2 from tcl, so the output is handled correctly, unlike the cmd.exe display.

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.