Source code of Windows XP (NT5)
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.

108 lines
2.2 KiB

  1. // Copyright (c) 1995 Microsoft Corpration
  2. //
  3. // File Name : fechrcnv.h
  4. // Owner : Tetsuhide Akaishi
  5. // Revision : 1.00 07/20/'95 Tetsuhide Akaishi
  6. //
  7. #include "festrcnv.h"
  8. // Shift JIS Kanji Code Check
  9. #define SJISISKANJI(c) ( ( (UCHAR)(c) >= 0x81 && (UCHAR)(c) <= 0x9f ) || \
  10. ( (UCHAR)(c) >= 0xe0 && (UCHAR)(c) <= 0xfc ) )
  11. // Shift JIS Kana Code Check
  12. #define SJISISKANA(c) ( (UCHAR)(c) >= 0xa1 && (UCHAR)(c) <= 0xdf )
  13. #define ESC 0x1b
  14. #define SO 0x0e
  15. #define SI 0x0f
  16. // Define for JIS Code Kanji and Kana IN/OUT characters
  17. #define KANJI_IN_1ST_CHAR '$'
  18. #define KANJI_IN_2ND_CHAR1 'B'
  19. #define KANJI_IN_2ND_CHAR2 '@'
  20. #define KANJI_IN_STR "$B"
  21. #define KANJI_IN_LEN 3
  22. #define KANJI_OUT_1ST_CHAR '('
  23. #define KANJI_OUT_2ND_CHAR1 'J'
  24. #define KANJI_OUT_2ND_CHAR2 'B'
  25. #define KANJI_OUT_LEN 3
  26. #define KANJI_OUT_STR "(J"
  27. #ifdef DBCS_DIVIDE
  28. typedef struct _dbcs_status
  29. {
  30. int nCodeSet;
  31. UCHAR cSavedByte;
  32. BOOL fESC;
  33. } DBCS_STATUS;
  34. #endif
  35. //--------------------------------
  36. // Internal Functions for Japanese
  37. //--------------------------------
  38. // Detect Japanese Code
  39. int DetectJPNCode ( UCHAR *string, int len );
  40. // Convert from Shift JIS to JIS
  41. int ShiftJIS_to_JIS (
  42. UCHAR *pShiftJIS,
  43. int ShiftJIS_len,
  44. UCHAR *pJIS,
  45. int JIS_len
  46. );
  47. // Convert from Shift JIS to EUC
  48. int ShiftJIS_to_EUC (
  49. UCHAR *pShiftJIS,
  50. int ShiftJIS_len,
  51. UCHAR *pJIS,
  52. int JIS_len
  53. );
  54. // Convert from JIS to EUC
  55. int JIS_to_EUC (
  56. UCHAR *pJIS,
  57. int JIS_len,
  58. UCHAR *pEUC,
  59. int EUC_len
  60. );
  61. // Convert from JIS to Shift JIS
  62. int JIS_to_ShiftJIS (
  63. UCHAR *pShiftJIS,
  64. int ShiftJIS_len,
  65. UCHAR *pJIS,
  66. int JIS_len
  67. );
  68. // Convert from EUC to JIS
  69. int EUC_to_JIS (
  70. UCHAR *pJIS,
  71. int JIS_len,
  72. UCHAR *pEUC,
  73. int EUC_len
  74. );
  75. // Convert from EUC to Shift JIS
  76. int EUC_to_ShiftJIS (
  77. UCHAR *pEUC,
  78. int EUC_len,
  79. UCHAR *pShiftJIS,
  80. int ShiftJIS_len
  81. );
  82. #ifdef IEXPLORE
  83. void FCC_Init( void );
  84. int FCC_GetCurrentEncodingMode( void );
  85. #endif // IEXPLORE
  86. #ifdef INETSERVER
  87. UCHAR
  88. SJISCheckLastChar( UCHAR *pShiftJIS, int len );
  89. #endif // INETSERVER