简体   繁体   中英

Printing special characters in console (C++/C#/SWIG)

I am attempting to port a library over from C++ to C# with SWIG. I was able to successfully generate the interface and got the basic progress bar working. Now the only problem is getting the other progress bars to work.The code, which can be found here , includes special characters used in the "progress" animation of the other bars. However, I have no idea to print these characters in the console window.

I tried setting Console.OutputEncoding = Encoding.UTF8 in my C# tester project but it didn't help. Any help would be appreciated. Thanks!

If i understand you correctly, you will probably need to change the font in the console itself.

More so, if the console shows question marks ? you will most likely need to set the console font to a TrueType font (eg Consolas or Lucida Console ). The console tries to convert everything into the OEM character set, characters that cannot be converted become question marks. I suggest playing around in there

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM