I am trying to display characters based on their ASCII code, but after 127 display some kind of nonsense, what can this be connected with?

ubuntu 14.04 64 bit Geany

#include <iostream> using namespace std; int main(int argc, char **argv) { for(int i = 32; i < 256; ++i) cout << (char)i << " - " << i << endl; return 0; } 
  • 2
    Do you have a console in what encoding? Just don't say that UTF8, where all characters are> 127 double bytes and must be correctly encoded - Mike

1 answer 1

Under ubuntu, the default character table is utf8. In it, characters older than 127 should be at least double bytes.