Page 1 of 1

Ohm and Mho Symbols

Posted: Sat Oct 28, 2017 1:12 am
by spflanze
I desire to use the Greek capital omega glyph for resistance units, and the upside down capital omega glyph for conductance units. I looked up the character codes for these symbols and attempted implement them this way:

Code: Select all

// Ref: http://www.fileformat.info/info/unicode/char/2126/index.htm
const char* ResistUnits[] =  { "u\u2126", "m\u2126", " \u2126", "k\u2126", "M\u2126" };

// Ref: http://www.fileformat.info/info/unicode/char/2127/index.htm
const char* CondUnits[] =  { "u\u2127", "m\u2127", " \u2127", "k\u2127", "M\u2127" };
When I installed these strings as choices in a wxGridCellChoiceEditor type object I did not get the hoped for result. What is the right way to do this?

Re: Ohm and Mho Symbols

Posted: Sat Oct 28, 2017 8:09 am
by xaviou
Hi

You can try with the following :

Code: Select all

const wxChar* ResistUnits[] =  { _T("u\u2126"), _T("m\u2126"), _T(" \u2126"), _T("k\u2126"), _T("M\u2126") };
const wxChar* CondUnits[] =  { _T("u\u2127"), _T("m\u2127"), _T(" \u2127"), _T("k\u2127"), _T("M\u2127") };
If you just specify simples quotation marks, this means "char" but you gives unicode chars so the conversion (done internally by the framework) can't works.

Regards
Xav'