Creating a ifstream for a Unicode filename?

M

Mohit

Hi all,

I wish to make a piece of code Unicode compatible. The code has calls
like

TCHAR filename[255];
ifstream stm;
stm.open(filename, mode);

I could not find any way of providing a unicode filename in the open
method of stm. I wish to do a single byte i/o on a file whose filename
is to be given in unicode. Is it possible at all? I cannot use the
constructor for creating the ifstream otherwise I could have used

ifstream stm(_wfopen(filename, mode)); //A workaround in vc7 i guess

Any solutions to my problem?

Thanks.
Mohit
 
J

JH Trauntvein

I don'tr believe that there is any standard solution other than to
convert your unicode file name into a multi-byte representation or to
use a compiler/library specific solution like you are doing. I recall
asking this same question on this group some time ago and getting this
answer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top