Embarcadero / Dev-Cpp

A fast, portable, simple, and free C/C++ IDE
https://www.embarcadero.com/free-tools/dev-cpp
GNU General Public License v2.0
2.53k stars 276 forks source link

does not read ASCII art. please fix if you can... #247

Open PorthWenny opened 1 year ago

PorthWenny commented 1 year ago

image

It can't read ASCII art like other compilers do. It doesn't even show up on the code. Please fix, thank you...

pmcgee69 commented 1 year ago

Do you have a file or link to a file that has an example ?

IPHundead commented 1 year ago

(C++ language)

You should first save your file as UTF-8, then include and . before couting your ASCII art you should do "_setmode(_fileno(stdout), _O_U16TEXT);" and after you output your ascii art using "wcout << L"INSERT ART HERE";" , do "_setmode(_fileno(stdout), _O_TEXT);"

EXAMPLE :



#include <iostream>
#include <fcntl.h>
#include <io.h>

using namespace std;

int main (){

cout << "Hello" << endl;
_setmode(_fileno(stdout), _O_U16TEXT);

wcout << L"██████╗░" << endl;
wcout << L"╚════██╗" << endl;
wcout << L"░█████╔╝" << endl;
wcout << L"░╚═══██╗" << endl;
wcout << L"██████╔╝" << endl;
wcout << L"╚═════╝░" << endl;

_setmode(_fileno(stdout), _O_TEXT);
cout << "Hello again";
}

Worked for me.