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

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



I had pygame-1.9.1.win32-py3.1
According to your advice I installed pygame-1.9.2pre.win32-py3.1
but the problem remains.


here is my code (sending also an attached zip with the images)


#!/usr/bin/python
# -*- coding: utf-8  -*-
import os, pygame

def loadImage(fullname):
    try:
        surface = pygame.image.load(fullname)
        print ("image loaded=", fullname)
    except:
        print( 'Cannot load image:', fullname)
              
loadImage(os.path.join("figuras", "carro.jpeg"))
loadImage(os.path.join("figuras", "maçã.jpeg")) #problem
loadImage(os.path.join("figuras", "árvore.jpeg")) #problem
loadImage(os.path.join("figuras", "canetas.jpeg"))



2011/2/9 Lenard Lindstrom <len-l@xxxxxxxxx>
Hi,

Which version of Pygame. Proper Unicode file name handling was added to 1.9.2. Before that only enough Unicode support was added to Pygame so it would build and run in Python 3.

Lenard Lindstrom


On 08/02/11 12:10 PM, Rodolfo Neu wrote:
I just tried it but the problem remains.
Thank you.

2011/2/8 Julian Marchant <onpon4@xxxxxxxxx <mailto:onpon4@xxxxxxxxx>>


   I doubt that this is related to your problem, but since you're
   using Python 3, shouldn't that shebang be "#!/usr/bin/python3"?

   ------------------------------------------------------------------------
   *From:* Rodolfo Neu <rneu2011@xxxxxxxxx <mailto:rneu2011@xxxxxxxxx>>
   *To:* pygame-users@xxxxxxxx <mailto:pygame-users@xxxxxxxx>

   *Sent:* Tue, February 8, 2011 1:41:32 PM
   *Subject:* [pygame] loading images with special characters on file
   name

   Hi,
   After installing Python 3.1.3, I have problems loading images
   whose file name contains special characters, like ã and ç

   Pygame.image.load doesn't work even with:
   #!/usr/bin/python
   # -*- coding utf-8 -*-


   Any help, please?





Attachment: figuras.zip
Description: Zip archive