Re: CAtlRegExp crashes with pound sign!

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 09/15/04


Date: Wed, 15 Sep 2004 09:38:57 -0400


"Patty O'Dors" <PattyODors@discussions.microsoft.com> wrote in message
news:F47EB0F6-D687-4E90-A897-60F392B13358@microsoft.com
> The pound sign is in my experience the only common character that
> causes unicode beef. Presumably it's because we're considered
> 'foreign'.

No, it's because it has an Ascii code in the upper half of the table
(above 0x7F). When this code is treated as signed char, it becomes
negative. When cast to a larger type, it gets sign-expanded and turned
into a very large unsigned value. Read about sign expansion in your
favorite C or C++ textbook.

This would happen to any character in the upper Ascii, not just a pound
sign. Try A or  or ¿, for example.

-- 
With best wishes,
    Igor Tandetnik
"On two occasions, I have been asked [by members of Parliament], 'Pray,
Mr. Babbage, if you put into the machine wrong figures, will the right
answers come out?' I am not able to rightly apprehend the kind of
confusion of ideas that could provoke such a question." -- Charles
Babbage


Relevant Pages

  • Re: CAtlRegExp crashes with pound sign!
    ... >> The pound sign is in my experience the only common character that ... >> causes unicode beef. ... it's because it has an Ascii code in the upper half of the table ...
    (microsoft.public.vc.atl)
  • Re: fortran character set
    ... Alternatively, the ASCII code might be interpreted in a non-standard variant as the pound sign, so if I send you £ and say it is pound, you might see # and call it the pound sign. ... That is probably why character sets are processor-dependent. ... called "display codes" and varying from hardware to hardware ...
    (comp.lang.fortran)
  • Re: fortran character set
    ... Alternatively, the ASCII code might be interpreted in a non-standard variant as the pound sign, so if I send you £ and say it is pound, you might see # and call it the pound sign. ... That is probably why character sets are processor-dependent. ... called "display codes" and varying from hardware to hardware ...
    (comp.lang.fortran)