Discussion:
[Audiere-users] Unicode for audiere OpenFile?
g***@gmx.at
2005-11-28 19:15:02 UTC
Permalink
Hi,

when I'm using a FilePtr to open a sound from a file I use the OpenSound
function:
File* OpenFile(const char* filename, bool writeable)

unfortunately this function only accepts char arrays. We are using unicode
strings through the whole application and it's quite annoying that we have
to convert these strings to chars - so unicode filenames won't work. Any
solutions?

best regards,
Alex
--
Telefonieren Sie schon oder sparen Sie noch?
NEU: GMX Phone_Flat http://www.gmx.net/de/go/telefonie
Chad Austin
2005-12-01 04:48:01 UTC
Permalink
That function is merely a convenience, and it only supports 8-byte character
filenames, as you said. The "correct" solution would involve writing your own
function, OpenFileW, perhaps, with the following definition:

class MyFile : public Audiere::File {
// copy the implementation of File from Audiere
};

File* OpenFileW(const wchar_t* filename, bool writeable) {
// Copy OpenFile's definition, but use _wfopen instead.
}

Then you could submit it back to Audiere. :)

Cheers,
Chad
Post by g***@gmx.at
Hi,
when I'm using a FilePtr to open a sound from a file I use the OpenSound
File* OpenFile(const char* filename, bool writeable)
unfortunately this function only accepts char arrays. We are using unicode
strings through the whole application and it's quite annoying that we have
to convert these strings to chars - so unicode filenames won't work. Any
solutions?
best regards,
Alex
Loading...