ANSI text via drawText


I’ve got a program that displays text files, and I’m having a slight problem in that certain characters in ANSI text files (mostly dashes and quotes) are showing up as boxes. The TextEdit component seems to handle it just fine, but calling drawText doesn’t, and for various reasons I have to do custom drawing.

What am I missing here?

Update: Got it working via a lookup table that does an extremely crude ANSI to Unicode translation. I’m still wondering if there isn’t a better (as in, more general) way to do it though.


The text editor and drawtext use the same mechanism, so you must be mangling it before it gets that far. If it’s an ansi string, you can convert it to unicode just by passing the char* to the String constructor. Most likely it’s getting messed up when you load it from the file, but I can’t tell from your description what’s going wrong.


Problem is essentially solved now. I can just save the file as Unicode instead of ANSI. This works well enough for me.