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 

Need help, problem with sceIoDread

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



Joined: 31 Aug 2007
Posts: 4

PostPosted: Fri Sep 14, 2007 6:02 am    Post subject: Need help, problem with sceIoDread Reply with quote

Hi there,

I made a program that list directories files and subfolders. Now I have a problem with file names that contains characters in the range from 0x80 to 0xFF. sceIoDread don't return the correct file name. The function replaces these characters by two bytes: 0x81 0xA1, no matter the character value.

for example, the file:

"mão.ogg" (0x6D 0xE3 0x6F 0x2E 0x6F 0x67 0x67)

returns "m??o.ogg" (0x6D 0x81 0xA1 0x6F 0x2E 0x6F 0x67 0x67)

How can I list file names correctly??
Back to top
View user's profile Send private message MSN Messenger
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Fri Sep 14, 2007 6:26 am    Post subject: Reply with quote

you will have to create your own font for these
characters ...that is your first step
then you will have to convert to a format more easier
to handle like utf8 or ucs internally
_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
botrops



Joined: 31 Aug 2007
Posts: 4

PostPosted: Fri Sep 14, 2007 9:15 am    Post subject: problem with sceIoDread Reply with quote

No, you didn't understand. I already created my custom font, but sceIoDread always return the same value for the character (0x81 0xA1), no matter the character value.
Back to top
View user's profile Send private message MSN Messenger
saulotmalo2



Joined: 10 Sep 2007
Posts: 43

PostPosted: Fri Sep 14, 2007 9:22 am    Post subject: Reply with quote

i think you have to map the caracters because it is not reading them... could it be a codification problem?
Back to top
View user's profile Send private message
botrops



Joined: 31 Aug 2007
Posts: 4

PostPosted: Fri Sep 14, 2007 8:39 pm    Post subject: sceIoDread problem Reply with quote

Thanks everybody for replying.

I can't map the characters in range from 0x80 to 0xFF, because all characters in that range are always converted to the same two byte value: 0x81 0xA1. I can't know witch character is. When I try to open the returned file name with sceIoOpen, everything goes fine. I have a problem to display the correct file name. No problem with my fonts, they can handle these characters.

Is there any other functions than sceIoDopen and sceIoDread to list directories contents? Is there any unicode version for these functions? Or is there a way to enable these characters in sceIoDread?
Back to top
View user's profile Send private message MSN Messenger
alexp



Joined: 17 Apr 2007
Posts: 39

PostPosted: Fri Sep 14, 2007 10:06 pm    Post subject: Reply with quote

Hi, I've worked a lot with filesystem API, while trying to develop my own filesystem, i think that SceIoDread API is valid only for ASCII names, UTF-8 names have to be read using some special IoCtls and DevCtl, in this thread http://forums.ps2dev.org/viewtopic.php?t=8590 i've posted the code i've developed for my filesystem, maybe you can use it to understand how to forge your requests.
Back to top
View user's profile Send private message
botrops



Joined: 31 Aug 2007
Posts: 4

PostPosted: Sat Sep 15, 2007 2:13 am    Post subject: Reply with quote

alexp wrote:
Hi, I've worked a lot with filesystem API, while trying to develop my own filesystem, i think that SceIoDread API is valid only for ASCII names, UTF-8 names have to be read using some special IoCtls and DevCtl, in this thread http://forums.ps2dev.org/viewtopic.php?t=8590 i've posted the code i've developed for my filesystem, maybe you can use it to understand how to forge your requests.


I saw your source, it's really cool. Later I'll take a more detailed look.
Back to top
View user's profile Send private message MSN Messenger
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