How to print Unicode character in C++?



To print the Unicode characters, the process is very similar to the actual printing process in C++.

We can put the Unicode value with the prefix \u. Thus we can successfully print the Unicode character.

Note: If the console does not support Unicode, then you cannot get the correct result. Here we have used the Linux system to solve this problem.

Example

#include <iostream>
using namespace std;
int main() {
   cout << "Character: \u092E\n";
   cout << "Character: \u0938\n";
   cout << "Character: \u0915\n";
}

Output

Character: म
Character: म
Character: म
karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know


Advertisements