#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
 
int main(int argc, char **argv) {
    wint_t  retval;
    FILE    *fp;
    wchar_t *pwcs;
  
    setlocale(LC_ALL, "");
 
    if ((fp = fopen("file", "r")) == NULL) {
        /* Error handling */
    } else {
        /* pwcs points to a wide character buffer of BUFSIZ. */
        while ((retval = fgetwc(fp)) != WEOF){
            *pwcs++ = (wchar_t)retval;
            /* break when buffer is full */
        }
    }
    /*  Process the wide characters in the buffer  */
    
    return (0);
}