- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Microsoft uses unicode filenames in NTFS. http://msdn.microsoft.com/en-us/library/windows/desktop/dd317748%28v=vs.85%29.aspx
My attempts to open a file with a unicode name have proven unsuccessful. I am passing the unicode in from C++, when the program comes to the open statement is fails with a file not found. If I force the C++ to convert the filename to ANSI characters, it works. With the Unicode name being passed, I have tried doubling the length of the string being passed to the Fotran from the C++. The results show below are from this case.
OPEN ( UNIT = IOINP, FILE = INFILE, ACTION = 'READ', FORM = 'FORMATTED', IOSTAT = IOS, ERR = 998 )
...
998 CONTINUE
WRITE (16, *) 'IOS = ', IOS, LEN ( INFILE ), INFILE
The output looks like
IOS = 29 42 B a k k e n H o r i z o n t a l . d a t
The intell help file states: "The name can be any pathname allowed by the operating system. Any trailing blanks in the name are ignored."
My experience indicates that the Intel Fortran statement only accepts ANSI characters, Microsoft documentation states that MS uses Unicode file names. In countries which use a unicode character set, how does one use the Intel Fortran OPEN statement?
Clayton Evans
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are correct that the compiler does not support unicode. We do support multibyte characters though. You can use MBConvertUnicodeToMB to convert the unicode file name to multibyte.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So if one has a filename with Unicode characters, Intel Fortran cannot open the file. Correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Correct, unless it is converted to multibyte.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could also open the file using the USEROPEN extension and the underlying CreateFileW api.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page