ANSI text via drawText


#1

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.


#2

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.


#3

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


#4