wfopen() — Open Files

Format

#include <ifs.h>
FILE * wfopen(const wchar_t *filename,const wchar_t *mode);

Language Level

ILE C Extension

Threadsafe

Yes

Locale Sensitive

This function is only available when LOCALETYPE(*LOCALEUCS2) or LOCALETYPE(*LOCALEUTF) is specified on the compilation command. For more information, see Understanding CCSIDs and Locales.

Integrated File System Interface

This function is not available when SYSIFCOPT(*NOIFSIO) is specified on the compilation command.

Wide Character Function

See Wide Characters for more information.

Description

The wfopen() function works like the fopen() function, except:
  • wfopen() accepts file name and mode as wide characters.
  • The default CCSID for files opened with wfopen() (used when the ccsid=value, o_ccsid=value, and codepage=value keywords are not specified) is UCS2 when LOCALETYPE(*LOCALEUCS2) is specified on the compilation command. The default CCSID is UTF-32 when LOCALETYPE(*LOCALEUTF) is specified on the compilation command.