home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / mbtohira.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  1KB  |  49 lines

  1. /***
  2. *mbtohira.c - Convert character from katakana to hiragana (Japanese).
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       defines _jtohira() - convert character to hiragana.
  8. *
  9. *******************************************************************************/
  10.  
  11. #ifdef _MBCS
  12.  
  13. #include <cruntime.h>
  14. #include <mbdata.h>
  15. #include <mbstring.h>
  16. #include <mbctype.h>
  17.  
  18.  
  19. /***
  20. *unsigned int _mbctohira(c) - Converts character to hiragana.
  21. *
  22. *Purpose:
  23. *       Converts the character c from katakana to hiragana, if possible.
  24. *
  25. *Entry:
  26. *       unsigned int c - Character to convert.
  27. *
  28. *Exit:
  29. *       Returns the converted character.
  30. *
  31. *Exceptions:
  32. *
  33. *******************************************************************************/
  34.  
  35. unsigned int __cdecl _mbctohira(
  36.     unsigned int c
  37.     )
  38. {
  39.         if (_ismbckata(c) && c <= 0x8393) {
  40.                 if (c < 0x837f)
  41.                         c -= 0xa1;
  42.                 else
  43.                         c -= 0xa2;
  44.         }
  45.         return(c);
  46. }
  47.  
  48. #endif  /* _MBCS */
  49.