Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Displaying special symbols in a PtText widget
Ref. No. QNX.000009897
Category(ies) Development
Issue We need to display longitude/latitude data in a PtText widget. The text is formatted to include a degree symbol(0xF8). Under QNX Windows this character is correctly displayed. Under Photon the PtText widget truncates the text at the degree character (using helv12 as the font).
Solution If you are doing something like this:
x09sprintf(string, "%dxF8", degrees);
-then you are generating invalid UTF. PtText truncates its string on an invalid character. Your code works under QNX Windows because it does not use UTF-8 or Unicode.

The Unicode value for the degree symbol is 0x00B0.
The UTF encoding of it is "xC2xB0". Change your code to something like this:
x09sprintf(string, "%dxC2xB0",degrees);
or simply load the C code into ped and enter the degree character (Alt-0-^).

NOTE: Keep in mind though that the UTF sequences that ped inserts into your code will not be displayed correctly in text-mode editors, especially in the QNX mode.