How to print Unicode text on console window using C/C++

preview_player
Показать описание
In this video, I will show you how to print out unicode text using console applications on Windows in C/C++

For more videos on C/C++, please checkout my Udemy courses:
Thank you for your support!
Рекомендации по теме
Комментарии
Автор

Words cannot express how grateful I am to you for this. EXACTLY what I needed. Thank you thank you thank you!!

yakinbama
Автор

Thanks a lot. I watched so many videos but none could give me the solution. This video gave me the exact process! <3

mohammadismailhossain
Автор

Great video! I went through countless forums and no one could give a good answer. You are great.

zenor
Автор

Thank you so much... so much nonsense on the internet it's unbelievable... Finally an explanation which is to the point and actually works.

roy
Автор

Thanks a lot brother, just what i need for my project. Fantastic Video

Mackarrao
Автор

Thanks a loooot bro! I've been searching how to do this for hours

leonardo
Автор

This video was helpful, but...when i tried some other character like for example cyrylic 'В' which is U+0412, it gives me '?' on the output, why is that so, i tried some other letters and they don't work as well, i thought this should work for every character, is there a way to fix this so it does work?

VJ-tdoc
Автор

is it possible to switch back from unicode to the normal character?

anguslam
Автор

Hey guys! This helped me a lot! But I've still got an issue. How can I print those characters in a file? (As we would do with fprintf...)

eduardooliveira
Автор

Thanks a lot. It was very helpful to me.. :)

theheight
Автор

Was wondering how can I go back (in the same program) to using the regular


printf("blahblah");


after I declare


_setmode(_fileno(stdout), _O_U16TEXT);


This would help me switch back and forth between special unicode characters and the standard c++ characters.

swagnikroychoudhury
Автор

for me nothing prints out, it's odd cuz this started happening out of nowhere, I used the exact same code and it still does it, I know I didn't do anything wrong

departition
Автор

Thank you very much for your help. Why is this so difficult to find? Just subscribed to you.

FiftiesDad
Автор

Just now bought your course on Udemy, include this lecture in that course

asheeshmathur
Автор

who else got defeated by the telegram noise xD

slawclips
Автор

Unicode ist not what Windows prints! No OS ever printed Unicode. What will be printed as a "wide character" is just UTF-16 and UTF-16 is not Unicode. UTF-16 is a (loosely translated) Unicode Transformation Format!

jenselstner
Автор

It's not working for 5 digit unicode.
Please give some solution.
By the way thank you for these amazing video ... 👍🙂🙂🙂

subhajitdey
Автор

why we can't use cha16_t and char32_t to store multibyte charcters it seems only works with wchar-t

justcurious
Автор

This example was useful, but for some unknown reasons I was unable to print some unicode characters, like this one 🚗. I tried with several options but I never could, the same program worked fine on Mac and Linux but on Windows it just did not. Then I found this API on MSDN

SetConsoleOutputCP(CP_UTF8);

and after that it worked well even with the standard output stream (Non wide-characters).
SetConsoleOutputCP(CP_UTF8);
const auto hearth=u8"\u2764";
std::cout << "Unicode!!" << hearth << "\n";
const char* s1 = "😇 = ";
const auto smile1=u8"\U0001F607";
const char* s2 = "😉 = ";
const auto smile2=u8"\U0001F609";
const auto car= u8"\U0001F697";
std::cout << car << "\n";
std::cout << s1 << smile1 <<"\n";
std::cout << s2 << smile2 << "\n";
std::cout << "Kangi characters: " << u8"\u5200 \u5201 \u5202 \u5203 \u5204 \u5205 \u5206 \u5207\n";
std::cout << "Corazones " << u8"\u2766 \u2661 \u2665 \u2764 \u2767 \u2619 \u2765 \u2763\n";
Produces this output at the console and also at wsl.
Unicode!!❤
🚗
😇 = 😇
😉 = 😉
Kangi characters: 刀 刁 刂 刃 刄 刅 分 切
Corazones ❦ ♡ ♥ ❤ ❧ ☙ ❥ ❣
Hope this information will be usuful to someone

VictorPeraltaGomez
Автор

Then How can I print Unicode characters by value?

mndeokyi
welcome to shbcf.ru