3

Is it possible to print Bengali Language with C in console? If it can be done, how can I do it?

I tried:

wprintf (L"Character: %lc %lc \n", L'ঈ', 2440);

This does not work. It just shows an unknown symbol. What is the best formula for working with UTF-8 format data in console? If it is possible with C++, I want to know that.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Istiyak
  • 693
  • 6
  • 15

1 Answers1

5

To use a language & display it is very much an OS dependent task and below are few generic possible ways to do it.

On linux :

  1. Set Locale,

In your case it should be : setlocale(LC_ALL, 'bn_IN.utf8');

Refer : (http://www.linuxquestions.org/questions/linux-newbie-8/displaying-hindi-in-linux-command-prompt-terminal-4175448642/)

  1. Download appropriate font & install in your system. Check your : cd /usr/share/fonts/ for the font. edit your .bashrc file and add your font like this:

    export LANG=bn_IN.UTF-8

    (Side effect your whole os may start using this font if it supports).

On Windows :

Necessary criteria for fonts to be available in a command window

How to print a unicode string to console?

Refer

Note : Your Terminal must support Unicode for any of this to work.

Community
  • 1
  • 1
Ani Menon
  • 27,209
  • 16
  • 105
  • 126