- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When file is located inside a folder name with Japanese character, INQUIRE / OPEN fails when called only with file name. They work fine when using full path. This issue is only in Japanese OS. Chinese and other OS works fine. C calls are working fine (_access, CreateFile, etc.)
OS: Win 7 & 10 Japanese, System Locale: Japanese
Any suggestions to resolve this?
Sample Code:
program ExampleFOR USE IFPORT implicit none CHARACTER(260) CMD, FName, FulPath INTEGER(4) ISTATUS LOGICAL exists ISTATUS = GETCWD(CMD) ! INQUIRE(DIRECTORY=CMD, EXIST=exists) ! PASS FNAME = 'A.TXT' INQUIRE(FILE=FNAME, EXIST=exists) ! FAIL FulPath = TRIM(CMD)//'\'//TRIM(FNAME) INQUIRE(FILE=FulPath, EXIST=exists) ! PASS end program ExampleFOR
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check the Intel Fortran compiler documentation on using the National Language Support Library. Your failure is probably due to the multi-byte character set needed for Japanese.
This sample routine demonstrates what you will need to do, I think.
subroutine test_file_open(filename,len) USE IFNLS integer :: len !DIR$ ATTRIBUTES VALUE :: len integer(2)::filename(len) ! array contains the Unicode file name integer(4):: res character*100:: ffname res = MBConvertUnicodeToMB(filename,ffname) ! do the conversion, return the result string length write(*,*) ffname(1:res) open (8, file=ffname(1:res), action='WRITE') ! pass result MB string to OPEN statement write (8,*) 'Testing file writing' close (8) end subroutine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for looking into this. But in my case, names are already handled as Multibyte (not Unicode).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've seen issues in the past with the I/O library having difficulty with files in paths that have multibyte/Unicode characters. I thought that had been fixed a while ago - which compiler version are you using? If it is current (19.0.2), I recommend that you submit this through the Intel Online Service Center.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are using 15.0.0127.12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please try a newer version then. That is more than four years old and may still have the bug.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried this in IVF 19.0 and it is working correctly. Thanks.

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