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.

55 lines
1.3 KiB

  1. /***
  2. *mbtokata.c - Converts character to katakana.
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Converts a character from hiragana to katakana.
  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 _ismbchira 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 short _mbctokata(c) - Converts character to katakana.
  25. *
  26. *Purpose:
  27. * If the character c is hiragana, convert to katakana.
  28. *
  29. *Entry:
  30. * unsigned int c - Character to convert.
  31. *
  32. *Exit:
  33. * Returns converted character.
  34. *
  35. *Exceptions:
  36. *
  37. *******************************************************************************/
  38. unsigned int __cdecl _mbctokata(
  39. unsigned int c
  40. )
  41. {
  42. if (_ismbchira(c)) {
  43. c += 0xa1;
  44. if (c >= 0x837f)
  45. c++;
  46. }
  47. return(c);
  48. }
  49. #endif /* _MBCS */