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: ?
Updated on: 2019-07-30T22:30:26+05:30

6K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements