Need help, problem with sceIoDread

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
botrops
Posts: 4
Joined: Fri Aug 31, 2007 9:18 am

Need help, problem with sceIoDread

Post by botrops »

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??
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

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
botrops
Posts: 4
Joined: Fri Aug 31, 2007 9:18 am

problem with sceIoDread

Post by botrops »

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.
saulotmalo2
Posts: 43
Joined: Mon Sep 10, 2007 9:32 am

Post by saulotmalo2 »

i think you have to map the caracters because it is not reading them... could it be a codification problem?
botrops
Posts: 4
Joined: Fri Aug 31, 2007 9:18 am

sceIoDread problem

Post by botrops »

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?
alexp
Posts: 39
Joined: Tue Apr 17, 2007 12:06 am

Post by alexp »

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.
botrops
Posts: 4
Joined: Fri Aug 31, 2007 9:18 am

Post by botrops »

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.
Post Reply