I just want to read read unicode text file in normal c. Following code is not working for same,
#include
int main()
{
FILE *ptr_file;
Try this:
#include <locale.h>
#include <stdio.h>
#include <wchar.h>
int main()
{
FILE *input;
wchar_t buf[1000];
setlocale(LC_CTYPE,"it_IT.UTF-8"); // put your locale here
if ((input = fopen("input.txt","r")) == NULL)
return 1;
while (fgetws(buf,1000,input)!=NULL)
wprintf(L"%s",buf);
fclose(input);
}