[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] loading images with special characters on file name



On Wed, Feb 9, 2011 at 4:49 PM, Rodolfo Neu <rneu2011@xxxxxxxxx> wrote:
> You have to create a Python module named sitecustomize.py, with the lines:
> import sys
> sys.setfilesystemencoding('utf-8')
>
> Now my program is working again.

As another data-point, I tried your program and it works for me on
Ubuntu without needing a call to setfilesystemencoding. However, when
I unzipped the files in your archive they had very garbled names. I
had to manually rename them to maçã.jpeg and árvore.jpeg. I'm not sure
if that's a problem on your end or mine.

Can you open files normally in Python? E.g. does this work?:

pygame.image.load(open(filename, "rb"), filename)