Python: pygame.mixer.music and unicode filenames -


when try use pygame.mixer.music.open() filename string containing unicode characters, seems throw unicodeencodeerror time:

file "c:\testplayer.py", line 43, in <module> pygame.mixer.music.load(x) unicodeencodeerror: 'ascii' codec can't encode characters in position 12-19:  ordinal not in range(128) 

(lines broken viewing pleasure)

i checked x's existance using os.path.exists(x), returned true. doing wrong? if not, possible manually fix pygame's mixer (which .pyd file)?

i'm using python 2.6, , pygame 1.9.1.

i forgot add file tried opening mp3 file, pygame's website/wiki states pygame.mixer.music should work those. in fact, does, long filename contains ascii characters.

instead of passing filename, open file in unicode compatible way , pass file object pygame.mixer.music.load


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -