1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| #include <stdio.h>
#include <wchar.h>
#include <locale.h>
#include <wctype.h>
#include<stdlib.h>
#include<tchar.h>
#define UNICODE
#define _UNICODE
int main(){
FILE *file;
printf("coucou\n");
wchar_t const * chaine = L"\u03B5";
wchar_t mot[100];
setlocale (LC_ALL,"fr_FR.UTF-8");
MessageBoxW (NULL,chaine, L"unicode1", MB_OK);
file = fopen("C:/file/test_IDD.txt", "r,ccs=UTF-8");
if (file==NULL) {
printf("erreur ouverture\n");
}
else{
printf("le fichier a été èèààùù ouvert fopen fonctionne\n");
fgetws(mot,100, file);
MessageBoxW (NULL,mot, L"unicode2", MB_OK);
system("pause");
fclose(file);
}
printf("fermeture du fichier\n");
system("pause");
return 0;
} |