#188 Can't open drawings located in folders with non-ASCII chars

v0.9.21c
open
nobody
7
2013-10-08
2012-01-12
No

See https://sourceforge.net/mailarchive/forum.php?thread_name=20120112173347.GD15958%40sonic.net&forum_name=tuxpaint-users for background.

Some thouths:
According to the user, Tuxpaint can write files at those paths.
Tuxpaint can read the file currentid.txt which most likely is located at a similar path.
SDL_Image can't open the file located at the path described by currenid.txt

This makes me think that either we have a problem encoding/decoding currentid.txt or SDL_Image has a problem with some paths,
If it is SDL_Image, a workaround I am seeing right now is to to open the file via RWops as we do for kpx images.

Discussion

  • Another user has reported the same issue, with a username with an accented-E, on Windows 7.

     
  • A possible workaround not specific to w32

     
    Attachments
  • The attached file RWopsdiff.diff fixes this problem, is mainly a copy of load_kpx() with small modifications like passing
    "rb" to fopen as per w32 needs, note that the fopen call in the original load_kpx is too changed in this way.

    The patch tryes to load the file first with IMG_Load, then if it fails goes with RWops, it does the same in linux and windows, linux doesn't need it, but I think the code is more clear like this rather than filling with #ifdef(s), of course it is just a fix, the real solution will be at the SDL level