Index: source/common/ucnvmbcs.cpp |
diff --git a/source/common/ucnvmbcs.cpp b/source/common/ucnvmbcs.cpp |
index f03f8a88c077ef83b8aa325108dab43a850cf4b3..dfed2da8fb36ad637650f6bfc7f5092d37433ee4 100644 |
--- a/source/common/ucnvmbcs.cpp |
+++ b/source/common/ucnvmbcs.cpp |
@@ -552,7 +552,8 @@ gb18030Ranges[14][4]={ |
}; |
/* bit flag for UConverter.options indicating GB 18030 special handling */ |
-#define _MBCS_OPTION_GB18030 0x8000 |
+#define _MBCS_OPTION_GB18030_TOU 0x08000 |
+#define _MBCS_OPTION_GB18030_FROMU 0x10000 |
/* bit flag for UConverter.options indicating KEIS,JEF,JIF special handling */ |
#define _MBCS_OPTION_KEIS 0x01000 |
@@ -1069,7 +1070,7 @@ ucnv_MBCSGetUnicodeSet(const UConverter *cnv, |
const USetAdder *sa, |
UConverterUnicodeSet which, |
UErrorCode *pErrorCode) { |
- if(cnv->options&_MBCS_OPTION_GB18030) { |
+ if(cnv->options&_MBCS_OPTION_GB18030_FROMU) { |
sa->addRange(sa->set, 0, 0xd7ff); |
sa->addRange(sa->set, 0xe000, 0x10ffff); |
} else { |
@@ -1119,7 +1120,7 @@ _extFromU(UConverter *cnv, const UConverterSharedData *sharedData, |
} |
/* GB 18030 */ |
- if((cnv->options&_MBCS_OPTION_GB18030)!=0) { |
+ if((cnv->options&_MBCS_OPTION_GB18030_FROMU)!=0) { |
const uint32_t *range; |
int32_t i; |
@@ -1184,7 +1185,7 @@ _extToU(UConverter *cnv, const UConverterSharedData *sharedData, |
} |
/* GB 18030 */ |
- if(length==4 && (cnv->options&_MBCS_OPTION_GB18030)!=0) { |
+ if(length==4 && (cnv->options&_MBCS_OPTION_GB18030_TOU)!=0) { |
const uint32_t *range; |
uint32_t linear; |
int32_t i; |
@@ -1931,7 +1932,10 @@ ucnv_MBCSOpen(UConverter *cnv, |
if(uprv_strstr(pArgs->name, "18030")!=NULL) { |
if(uprv_strstr(pArgs->name, "gb18030")!=NULL || uprv_strstr(pArgs->name, "GB18030")!=NULL) { |
/* set a flag for GB 18030 mode, which changes the callback behavior */ |
- cnv->options|=_MBCS_OPTION_GB18030; |
+#if !UCONFIG_NO_NON_HTML5_CONVERSION |
+ cnv->options|=_MBCS_OPTION_GB18030_FROMU; |
+#endif |
+ cnv->options|=_MBCS_OPTION_GB18030_TOU; |
} |
} else if((uprv_strstr(pArgs->name, "KEIS")!=NULL) || (uprv_strstr(pArgs->name, "keis")!=NULL)) { |
/* set a flag for KEIS converter, which changes the SI/SO character sequence */ |