thegooglecodearchive / id3-to-unicode

Automatically exported from code.google.com/p/id3-to-unicode
0 stars 0 forks source link

Problem converting Russian Cyrillic encoding to Unicode #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
I have a sample song from Philip Kirkorov, and due to its russian filename, I 
couldnt transfer it with winscp, so used 1.zip to transfer to linux server, on 
which I installed the python packages, then unzipped it, and done as follows:

hot-ftp:~# ls *.mp3
01 ?? ???? ???????????+??.mp3
hot-ftp:~# python id3_to_unicode.py
= id3_to_unicode.py = change encoding of mp3 iD3 tags to unicode, '-h' for help
. : several encodings are possible:
1. windows-1251 (69.15%)
2. MacCyrillic (30.85%)
select encoding (1..2): 1
windows-1251 selected
Traceback (most recent call last):
  File "id3_to_unicode.py", line 210, in <module>
    convert( os.path.join( root, name ), encoding )
  File "id3_to_unicode.py", line 96, in convert
    print unicode( file_name, "utf-8" ),
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 5-8: invalid 
data
hot-ftp:~# python id3_to_unicode.py
= id3_to_unicode.py = change encoding of mp3 iD3 tags to unicode, '-h' for help
. : several encodings are possible:
1. windows-1251 (69.15%)
2. MacCyrillic (30.85%)
select encoding (1..2): 2
MacCyrillic selected
Traceback (most recent call last):
  File "id3_to_unicode.py", line 210, in <module>
    convert( os.path.join( root, name ), encoding )
  File "id3_to_unicode.py", line 96, in convert
    print unicode( file_name, "utf-8" ),
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 5-8: invalid 
data

What is the expected output? What do you see instead?
Success, converted file :)

What version of the product are you using? On what operating system?
Latest, just downloaded - 227 2010-11-21 07:29:48Z lenik

Please provide any additional information below.

File is attached, please try it.

Original issue reported on code.google.com by carmageddon on 22 Jun 2011 at 8:56

Attachments:

GoogleCodeExporter commented 9 years ago
if you see you file name as ??????+????.mp3 in linux, it means the character 
encoding for your file name is somehow wrong and you'd better rename the file 
to the proper file name for proper results. for example, you may use the 
command:

hot-ftp:~# mv 01*.mp3 01\ Я\ Не\ Рафаэль.mp3

(backslashes are added to protect the following spaces, otherwise you have to 
enclose the resulting file name in quotes, like '01 Я Не 
Рафаэль.mp3').

or, even better, you may create directory structure like:

./Филипп Киркоров/Название альбома 2011/01 Я Не 
Рафаэль.mp3

and use '-o   overwrite tags from directory structure' option.

Original comment by lenik.terenin on 6 Sep 2011 at 10:55