Issue about unicode file path

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
sam24666806
Posts: 11
Joined: Tue, 2016-01-05, 15:23
Location: Taiwan

Issue about unicode file path

#1 Post by sam24666806 »

Hello,

As title, I try to read file with Unicode file path on Window OS.

But I fail.

After searching the problem, I find some clues about it and then I fix it.

It seems works fine. But I can't sure there are some details I ignore.

Let me explain how I fix it.

At first DcmInputFileStream use DCMFileProducer to open FILE* pointer by function fopen.

So we can't use wchar_t* to open file.(Unicode path is stored in wchar_t array)

Therefore, I simulate the classes DcmInputFileStream and DCMFileProducer (by c++ inherit class) and try to use OFFile::wfopen in my producer class.

But I have some questions when I simulate those.

I see a class named DCMTempFileStream and DCMTempFileHandler.

But I don't write classes inherit those classes.

Does it cause some error?

Thanks all.
Mail : sam24666806@gmail.com

J. Riesmeier
DCMTK Developer
Posts: 2501
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Issue about unicode file path

#2 Post by J. Riesmeier »

If you use the latest DCMTK snapshot and enable DCMTK_WIDE_CHAR_FILE_IO_FUNCTION during configure, you could use wchar_t* wherever an OFFilename parameter is specified.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest