Re: The Down Arrow
- Posted by jimcbrown (admin) Oct 27, 2012
- 1274 views
You would need to use Unicode functions to get symbols like that to display; its possible there aren't any in..win32lib.ew?, its been a long while since I've used Windows.. The documentation should say, but its not available online.
On Linux/GNU, on my UTF-8 terminal, I just do this:
puts(1, {226,134,147})
Since Windoze is UTF-16, it's possible you could get away with this:
puts(1, {255,254,147,33,10})
I haven't tried this, however.
Alternatively, you could grab the raw bytes that make up the down arrow (you can get these from the text file you made with Notepad), poke them into memory along with a NUL terminator, and then wrap and call WriteConsoleOutputCharacterU from the w32api. That's a bit more work but guaranteed to work (assuming you do it right).
I get the same problem with down arrow (ascii 281) and up arrow (ascii 280).
Where are you getting these codes, btw? ASCII (actually, I think Windows uses Windows-1252) is 32-255 (with a few left out in the middle).
These extended non-ASCII keycodes are internal to EU, and are used to represent keys that don't return a single ASCII character or a single control character. (On a *nix, these are converted via some sort of table from the multi-character escape sequence.) Obviously, you can't use these values for drawing.
Unicode supports many, many more (including arrows, snowmen, hotels, monochrome blue hearts, etc), but my current understanding is that Eu has very limited support for it..
I've always felt the UTF-8 support on Linux/GNU was adaquate, even back in the 2.3 days! (But of course I've never had to convert to UTF-16 or UTF-32, etc.)