How to print Malayalam as c / C ++ program output?

I am trying to print Malayalam (South Indian language) as c / C ++ output, but it shows some unfamiliar characters in both the terminal and the user interface using WINAPI.

(The file "malayalam.txt" contains some Malayalam words.)

#include <stdio.h> #include <windows.h> main() { char s[100]; FILE *fp; fp = fopen("malayalam.txt", "r"); if (fp == NULL) { puts("Cannot open file"); } while (fgets(s, 100, fp) != NULL) { printf("%s", s); MessageBox(NULL, s, "Malayalam", MB_OK); } fclose(fp); } 
+5
source share
1 answer

An example from the following link can help you fix this issue for WINAPI.

You need to find the unicode equivalent of your Malayalam word in a .txt file from which you can convert it http://www.aksharangal.com

An example from the following page is http: // harikrishnanvs .blogspot.in / 2011/12 / printing-malayalam-as-c-program-output. HTML

WIN32 program to print my name in Malayalam -MessageBox

This works for Windows 7, but does not work in XP Create a new project in visual studio 2010. File → Create → Project → Win32 Project Name the project, click OK.

include the header files stdafx.h , tchar.h .

 int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance, PSTR szCommandline,int iCmdshow) { TCHAR c[4]; c[0]=3385; c[1]=3376; c[2]=3391; c[3]='\0'; TCHAR szbuffer[100]; _stprintf(szbuffer,_T("%ls"),c); MessageBox(NULL,szbuffer,TEXT("HELLO ALL"),0); return 0; } 

Make sure Configuration Properties ---> Character Set ---> Use Unicode Character Set Option is selected.

+4
source

All Articles