Hello all,
I am trying to port a Turbo Pascal DOS program I wrote over 20 years ago to FPC (using v3.0.2 on OSX). For screen manipulation and special characters I am using ncurses and the
oCrt unit. But special characters aren't quite working as advertised: nFrame() and nDrawBox() draw boxes with no top and bottom borders (highlighting them shows they actually consist of invisible � characters); nHLine() shows the same behavior, unsurprisingly. Most of the "alternate character" functions also yield (visible) �s when printed with nWriteAC(), and the few that don't yield characters completely different from what they should.
I've already tried to forgo the ACS entirely and rely on UTF-8 instead, but couldn't quite figure out the right way to do so. It seems to me I should convert a Unicode string literal like '█' (U+2588) to pwchar_t (how?), use setcchar() to further convert it to pcchar_t and finally use mvwadd_wch to print it, but without documentation I'm not even sure if I'm just doing it incorrectly or if I've got the completely wrong idea.
Any help - with either ACS or UTF-8 - would be greatly appreciated.
Edit: And just like that, progress! I found out how to do Unicode without all the conversion stuff - I was just missing the 'uses cwstring' declaration. Now I can have as many █s as I want.
I guess I could use that to roll my own version of nDrawBox() as well, but I'd still like to know if there's an easier way.