Re: CAtlRegExp crashes with pound sign!

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Patty O'Dors (PattyODors_at_discussions.microsoft.com)
Date: 09/15/04


Date: Wed, 15 Sep 2004 01:27:02 -0700

The pound sign is in my experience the only common character that causes
unicode beef. Presumably it's because we're considered 'foreign'.

"Alexander Nickolov" wrote:

> Ah, I didn't pay attention where needed... Yes, you are right,
> the cast to size_t is the problem, not as I thought the right shift.
> If one does (size_t)(WORD)(tchar_val), we get a value in the
> range 0-0xffff, but that still won't be correct for non-UNICODE
> builds. And IIRC "unsigned wchar_t" is simply not a valid type,
> so "unsigned TCHAR" is out of question too...
>
> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD
> email: agnickolov@mvps.org
> MVP VC FAQ: http://www.mvps.org/vcfaq
> =====================================
>
> "Igor Tandetnik" <itandetnik@mvps.org> wrote in message
> news:uK55y4omEHA.3396@tk2msftngp13.phx.gbl...
> > "Brian Muth" <bmuth@mvps.org> wrote in message
> > news:%232OMlvomEHA.2616@tk2msftngp13.phx.gbl
> >> Curious...
> >>
> >> and size_t x = (size_t)(unsigned char)('\x80');
> >>
> >> works correctly
> >>
> >> I wonder what the C++ language police would say?
> >
> > It would point you to C++ standard 4.7/2: If the destination type is
> > unsigned, the resulting value is the least unsigned integer congruent to
> > the source integer (modulo 2^n where n is the number of bits used to
> > represent the unsigned type).
> >
> > In particular, '\x80' == -128 == 0xFFFFFF80 (modulo 2^32)
> > --
> > 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
> >
> >
>
>
>