Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.4 KiB

  1. /***
  2. *mbtohira.c - Convert character from katakana to hiragana (Japanese).
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * defines _jtohira() - convert character to hiragana.
  8. *
  9. *Revision History:
  10. * 11-19-92 KRS Ported from 16-bit sources.
  11. * 08-20-93 CFW Change short params to int for 32-bit tree.
  12. * 09-24-93 CFW Removed #ifdef _KANJI
  13. * 09-29-93 CFW Return c unchanged if not Kanji code page.
  14. * 10-06-93 GJF Replaced _CRTAPI1 with __cdecl.
  15. * 04-15-94 CFW _ismbckata already tests for code page.
  16. *
  17. *******************************************************************************/
  18. #ifdef _MBCS
  19. #include <cruntime.h>
  20. #include <mbdata.h>
  21. #include <mbstring.h>
  22. #include <mbctype.h>
  23. /***
  24. *unsigned int _mbctohira(c) - Converts character to hiragana.
  25. *
  26. *Purpose:
  27. * Converts the character c from katakana to hiragana, if possible.
  28. *
  29. *Entry:
  30. * unsigned int c - Character to convert.
  31. *
  32. *Exit:
  33. * Returns the converted character.
  34. *
  35. *Exceptions:
  36. *
  37. *******************************************************************************/
  38. unsigned int __cdecl _mbctohira(
  39. unsigned int c
  40. )
  41. {
  42. if (_ismbckata(c) && c <= 0x8393) {
  43. if (c < 0x837f)
  44. c -= 0xa1;
  45. else
  46. c -= 0xa2;
  47. }
  48. return(c);
  49. }
  50. #endif /* _MBCS */