Displaying Special Characters.

I’m trying to display the degree symbol in a PtLabel widget. To create the
string I use:

sprintf( buffer, “%dº %d’”, degree, minute);

However when I change the text resource of the label, only the first number
shows up. If I remove the degree symbol, both numbers and the apostrophe
show up.

I’m using Photon 1.14C. How do I get around this?

Carey Duran

Hello Carey

If you read the Appendix: Unicode Multilingual Support section in the helpviewer it
will outline the functions that you need to use in order to create this symbol. You
will need to use the hexadecimal value for the degree sign. That value in unicode is
0xb0.

Thanks
Rodney

Carey Duran <cduran@harscotrack.com> wrote:

I’m trying to display the degree symbol in a PtLabel widget. To create the
string I use:

sprintf( buffer, “%dº %d’”, degree, minute);

However when I change the text resource of the label, only the first number
shows up. If I remove the degree symbol, both numbers and the apostrophe
show up.

I’m using Photon 1.14C. How do I get around this?

Carey Duran

Hello Carey

Just find out some more information from a developer so I thought that
I would post it. The degree symbold is actually a two-byte sequence in
UTF-8: “\xC2\xB0”.

If you take a look at the “Photon compose sequences” section in the
Appendix was mentioned, you’ll see that the degree symbol can be entered
from the keyboard by typing , <0>, <^>. Of course, you can’t use a
text-mode editor if you want the character saved as UTF-8; use ped
instead.


Thanks
Rodney


Gui Group <gui@qnx.com> wrote:

Hello Carey

If you read the Appendix: Unicode Multilingual Support section in the helpviewer it
will outline the functions that you need to use in order to create this symbol. You
will need to use the hexadecimal value for the degree sign. That value in unicode is
0xb0.

Thanks
Rodney

Carey Duran <> cduran@harscotrack.com> > wrote:
I’m trying to display the degree symbol in a PtLabel widget. To create the
string I use:

sprintf( buffer, “%dº %d’”, degree, minute);

However when I change the text resource of the label, only the first number
shows up. If I remove the degree symbol, both numbers and the apostrophe
show up.

I’m using Photon 1.14C. How do I get around this?

Carey Duran

Rodney,

“Gui Group” <gui@qnx.com> wrote in message news:9sbn46$eaq$1@nntp.qnx.com

Hello Carey

Just find out some more information from a developer so I thought that
I would post it. The degree symbold is actually a two-byte sequence in
UTF-8: “\xC2\xB0”.

Thanks for the clue… I had figured this out last night, and was going to
post it. I used the compose sequence to fill in the degree symbol in the
widget and the read it back in code to get the hex values (Now theres a geek
for yah!).

Carey