On Monday 31 August 2009 03:30:11 pm Jim Cunning wrote:
Hmmm. Michal suggests you might be using iso8850-1 and utf-8 in different places. I suspect something like that too, but I also wonder if you transposed digits of the character code you reported above. "man iso_8859-1" shows the DEGREE SIGN code to be 176, not 167. A signed integer byte value of 176 (hex B0) would be printed as -80.
Yep, fat fingers...
The fact that your program output included -62 (hex C2) immediately before the -80 leads me to believe that the encoding for the degree symbol in the C source is UTF-8. The byte sequence 0xc2 0xb0 would be the UTF-8 encoding for the degree symbol.
If you want to reduce some of your confusion when dealing with 8-bit character codes in C, you might consider always using "unsigned char" in place of "char". That way greater than or less than comparisons will work in a less confusing manner (though not necessarily exactly the same as lexical order, depending on character coding).
Thanks Jim: With the unsigned char, the numbers get bigger ;-) � 4294967234 � 4294967216 -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org