Dev-Cpp icon indicating copy to clipboard operation
Dev-Cpp copied to clipboard

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

Open PorthWenny opened this issue 3 years ago • 2 comments
trafficstars

image

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

PorthWenny avatar Oct 12 '22 14:10 PorthWenny

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

pmcgee69 avatar Oct 20 '22 03:10 pmcgee69

(C++ language)

You should first save your file as UTF-8, then include <fcntl.h> and <io.h>. 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.

IPHundead avatar Nov 11 '22 15:11 IPHundead