Resend: implement _ismbcalpha, _ismbcalnum

Greg Turner gmturner007 at ameritech.net
Tue Nov 12 21:58:58 CST 2002


On Tuesday 12 November 2002 06:43 pm, Dmitry Timoshkov wrote:
> "Greg Turner" <gmturner007 at ameritech.net> wrote:
> > +int _ismbcalpha(unsigned int ch)
> > +{
> > +  if (ch < 0x100)
> > +    return ((0x41 <= ch && ch <= 0x5a) ||
> > +            (0x61 <= ch && ch <= 0x7a) ||
> > +            /* Japanese/Katakana, CP 932 */
> > +            (0xa6 <= ch && ch <= 0xdf));
> > +  else
> > +    {
> > +      FIXME("Handle MBC chars\n");
> > +      return 0;
> > +    }
> > +}
>
> It's better to create a correct multibyte character pair and call
> GetStringType then.

you mean this beast?

BOOL GetStringTypeW(
  DWORD dwInfoType,  // information-type options
  LPCWSTR lpSrcStr,  // source string
  int cchSrc,        // number of characters in string
  LPWORD lpCharType  // output buffer
);

You are probably far better informed on these issues than I, but this 
seems slightly excessive to me -- or, perhaps I'm suffering from sour 
grapes syndrome, since I'm somewhat out of my element here (I seem to 
be saying that a lot lately don't I?  When, I wonder, will I start to 
feel that I am /in/ my element?? (Probably not until wine is written in 
Kylix ... man, that's embarassing!!))

My patch was intended to be a clone of the similar implementations I saw 
in the same unit, not a full implementation.  

But... since I seem to be volunteering to implement the function, I 
guess I should do it right... 

So, on second thought, merged or no, I'll try to whip up a better 
version of _ismbc* and maybe, if I'm feeling especially cool, some 
others in the vicinity, using GetStringType as you reccomend.

thanks for your advice,

-- 
gmt

"War is an ugly thing, but not the ugliest of things;
the decayed and degraded state of moral and patriotic
feeling which thinks that nothing is worth war is much
worse. A man who has nothing for which he is willing
to fight; nothing he cares about more than his own
personal safety; is a miserable creature who has no
chance of being free, unless made and kept so by the
exertions of better persons than himself."

-- John Stuart Mill




More information about the wine-devel mailing list