forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with non ascii filename

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Wed Apr 09, 2008 9:29 pm    Post subject: Problem with non ascii filename Reply with quote

Hi! :)

I'm trying to use fat.c (from pmplayer-advance) to read file with non ascii names.
All seems to work (I can read the name without the problems found using readdir() function) but I'm unable to correctly print the name to screen.


[filenames are: àèìòù, così and Perché]

Once I red the directory I try to output the names (I'm using OSLib):
Code:
oslDrawString(0, 20 + 15 * i, finfo[i].longname);
oslDrawString(240, 20 + 15 * i, finfo[i].filename);


I can see the difference: finfo[i].filename has all non ascii characters converted to the same sequence, while finfo[i].longname makes difference between characters.
The problem is I don't see the correct name on screen.
With OSLib I have no problem to print a string like "àèìòù" but the filenames have these characters "converted"

Do I have to write my own conversion function mapping all characters or there's a "standard" function to do this?

Can someone please help me?

Many thanks. :)

Ciaooo
Sakya
Back to top
View user's profile Send private message Visit poster's website
PosX100



Joined: 15 Aug 2007
Posts: 98

PostPosted: Thu Apr 10, 2008 12:38 am    Post subject: Reply with quote

If you're using oft fonts(oslib fonts) , then probably that's the problem.

Try to print text without custom fonts(using debug screen) .
Back to top
View user's profile Send private message
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Thu Apr 10, 2008 12:59 am    Post subject: Reply with quote

Hi! :)
PosX100 wrote:
If you're using oft fonts(oslib fonts) , then probably that's the problem.

Try to print text without custom fonts(using debug screen) .

Thanks, I'll try, but I don't think this is the problem.
I have no problems displaying things like:
Code:
oslDrawString(0, 10, "àèìòù");


I think the problem is the string (is this ANSI?).

Ciaooo
Sakya
Back to top
View user's profile Send private message Visit poster's website
PosX100



Joined: 15 Aug 2007
Posts: 98

PostPosted: Thu Apr 10, 2008 1:41 am    Post subject: Reply with quote

Then you should try to create your own character map , and map each character based on index..
Back to top
View user's profile Send private message
alexp



Joined: 17 Apr 2007
Posts: 39

PostPosted: Thu Apr 10, 2008 11:29 pm    Post subject: Reply with quote

i don't know how fat.c access files, but psp filesystem calls, like sceIoDread, has a strange way of returning non ASCII filenames and uses some Devctl eand ioctls calls too. You can take a look at my previous work a http://forums.ps2dev.org/viewtopic.php?t=8590.
This was valid under CF 3.40 OE, but i think it's still ok.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group