0

I would like to show the non-ASCII "ohm" character in my dialog window. I thought I would be able to do this through the resource file, but that didn't work.

STRINGTABLE
BEGIN
    IDS_OHM                 "Ω"
END

and then later in the program

CString thermUnits = LoadString(IDS_OHM);

However, it just shows up as a '?' character. Does anybody have any other ideas?

Thank you in advance!

user1152584
  • 51
  • 2
  • 4

4 Answers4

2

That character is a capital Greek Omega, and all Greek characters are found in the Symbol font.

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
0

What character code is that? It might not be represention in the font you're using for the dialog window.

0

This may be a font related issue, are you sure the font being used for the dialog includes the ohm character?

Or Perhaps

IDS_OHM        "\u03A9"

Will work?? With unicode

Graham
  • 318
  • 1
  • 16
  • \u03A9 is Greek capital omega. The ohm sign is \u2126. – MRAB Jan 24 '12 at 01:35
  • @mrab my bad, you are correct, im on my ipad just now so working with limited resources. – Graham Jan 24 '12 at 01:41
  • Thank you for answering, but that didn't seem to work... Changing the font face helped out a lot. – user1152584 Jan 24 '12 at 01:47
  • @BenVoigt: Actually, the ohm sign is a symbol on its own ([U+2126](http://www.fileformat.info/info/unicode/char/2126/index.htm)), though it says "preferred representation is U+03A9. – MikMik Jan 24 '12 at 10:03
  • It might be that Unicode distinguishes between omega and ohm because omega is case-sensitive but ohm isn't. Similarly, capital pi \u03A0 vs product \u220F and capital sigma \u03A3 vs sum \u2211. – MRAB Jan 24 '12 at 18:06
0

I've had similar problems in the past, and it was caused by the *.rc file being saved as ANSI text, not Unicode. So anything non-ANSI in the STRINGTABLE disappeared when the file was saved.

The solution that worked for me was to open the rc file in an external editor and save it as Unicode. After that, it all worked fine.

MikMik
  • 3,426
  • 2
  • 23
  • 41