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.

60 lines
1.4 KiB

  1. /****************************************************************************
  2. Hanja.cpp : declaration of Hanja definition and utility functions
  3. Copyright 2000 Microsoft Corp.
  4. History:
  5. 02-FEB-2000 bhshin created
  6. ****************************************************************************/
  7. #ifndef _HANJA_HEADER
  8. #define _HANJA_HEADER
  9. // CJK Unified Ideograph
  10. #define HANJA_CJK_START 0x4E00
  11. #define HANJA_CJK_END 0x9FA5
  12. // CJK Compatibility Ideograph
  13. #define HANJA_COMP_START 0xF900
  14. #define HANJA_COMP_END 0xFA2D
  15. // CJK Unified Ideograph Extension A
  16. #define HANJA_EXTA_START 0x3400
  17. #define HANJA_EXTA_END 0x4DB5
  18. // Pre-composed HANGUL
  19. #define HANGUL_PRECOMP_BASE 0xAC00
  20. #define HANGUL_PRECOMP_MAX 0xD7A3
  21. __inline
  22. BOOL fIsHangulSyllable(WCHAR wch)
  23. {
  24. return (wch >= HANGUL_PRECOMP_BASE && wch <= HANGUL_PRECOMP_MAX) ? TRUE : FALSE;
  25. }
  26. __inline
  27. BOOL fIsCJKHanja(WCHAR wch)
  28. {
  29. return (wch >= HANJA_CJK_START && wch <= HANJA_CJK_END) ? TRUE : FALSE;
  30. }
  31. __inline
  32. BOOL fIsCompHanja(WCHAR wch)
  33. {
  34. return (wch >= HANJA_COMP_START && wch <= HANJA_COMP_END) ? TRUE : FALSE;
  35. }
  36. __inline
  37. BOOL fIsExtAHanja(WCHAR wch)
  38. {
  39. return (wch >= HANJA_EXTA_START && wch <= HANJA_EXTA_END) ? TRUE : FALSE;
  40. }
  41. __inline
  42. BOOL fIsHanja(WCHAR wch)
  43. {
  44. return (fIsCJKHanja(wch) || fIsCompHanja(wch) || fIsExtAHanja(wch)) ? TRUE : FALSE;
  45. }
  46. #endif