Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: icu52/patches/uconv.patch

Issue 224943002: icu local change part1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: fix typos in uconfig.h and putil.patch Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: icu52/patches/uconv.patch
===================================================================
--- icu52/patches/uconv.patch (revision 0)
+++ icu52/patches/uconv.patch (revision 0)
@@ -0,0 +1,184 @@
+Index: source/common/ucnv2022.cpp
+===================================================================
+--- source/common/ucnv2022.cpp (revision 259715)
++++ source/common/ucnv2022.cpp (working copy)
+@@ -167,13 +167,19 @@
+ * all versions, not just JIS7 and JIS8.
+ * - ICU does not distinguish between different versions of JIS X 0208.
+ */
++#if UCONFIG_NO_NON_HTML5_CONVERSION
++enum { MAX_JA_VERSION=0 };
++#else
+ enum { MAX_JA_VERSION=4 };
++#endif
+ static const uint16_t jpCharsetMasks[MAX_JA_VERSION+1]={
+ CSM(ASCII)|CSM(JISX201)|CSM(JISX208)|CSM(HWKANA_7BIT),
++#if !UCONFIG_NO_NON_HTML5_CONVERSION
+ CSM(ASCII)|CSM(JISX201)|CSM(JISX208)|CSM(HWKANA_7BIT)|CSM(JISX212),
+ CSM(ASCII)|CSM(JISX201)|CSM(JISX208)|CSM(HWKANA_7BIT)|CSM(JISX212)|CSM(GB2312)|CSM(KSC5601)|CSM(ISO8859_1)|CSM(ISO8859_7),
+ CSM(ASCII)|CSM(JISX201)|CSM(JISX208)|CSM(HWKANA_7BIT)|CSM(JISX212)|CSM(GB2312)|CSM(KSC5601)|CSM(ISO8859_1)|CSM(ISO8859_7),
+ CSM(ASCII)|CSM(JISX201)|CSM(JISX208)|CSM(HWKANA_7BIT)|CSM(JISX212)|CSM(GB2312)|CSM(KSC5601)|CSM(ISO8859_1)|CSM(ISO8859_7)
++#endif
+ };
+
+ typedef enum {
+@@ -361,14 +367,25 @@
+ };
+
+
++/* Enable ISO-2022-{KR,CN,CN-Ext} for now.
++ * TODO(jshin): Disable it when we know what to do about 'replacement'
++ * encodings. See http://crbug.com/277037 and
++ * https://codereview.chromium.org/145973021/
++ */
++#ifndef U_ENABLE_ISO_2022_KR_CN
++#define U_ENABLE_ISO_2022_KR_CN 1
++#endif
++
+ /* Type def for refactoring changeState_2022 code*/
+ typedef enum{
+ #ifdef U_ENABLE_GENERIC_ISO_2022
+ ISO_2022=0,
+ #endif
+ ISO_2022_JP=1,
++#ifdef U_ENABLE_ISO_2022_KR_CN
+ ISO_2022_KR=2,
+ ISO_2022_CN=3
++#endif
+ } Variant2022;
+
+ /*********** ISO 2022 Converter Protos ***********/
+@@ -485,24 +502,28 @@
+ /* prevent indexing beyond jpCharsetMasks[] */
+ myConverterData->version = version = 0;
+ }
++#if !UCONFIG_NO_NON_HTML5_CONVERSION
+ if(jpCharsetMasks[version]&CSM(ISO8859_7)) {
+ myConverterData->myConverterArray[ISO8859_7] =
+ ucnv_loadSharedData("ISO8859_7", &stackPieces, &stackArgs, errorCode);
+ }
++#endif
+ myConverterData->myConverterArray[JISX208] =
+ ucnv_loadSharedData("Shift-JIS", &stackPieces, &stackArgs, errorCode);
++#if !UCONFIG_NO_NON_HTML5_CONVERSION
+ if(jpCharsetMasks[version]&CSM(JISX212)) {
+ myConverterData->myConverterArray[JISX212] =
+ ucnv_loadSharedData("jisx-212", &stackPieces, &stackArgs, errorCode);
+ }
+ if(jpCharsetMasks[version]&CSM(GB2312)) {
+ myConverterData->myConverterArray[GB2312] =
+- ucnv_loadSharedData("ibm-5478", &stackPieces, &stackArgs, errorCode); /* gb_2312_80-1 */
++ ucnv_loadSharedData("noop-gb2312_gl", &stackPieces, &stackArgs, errorCode); /* gb_2312_80-1 */
+ }
+ if(jpCharsetMasks[version]&CSM(KSC5601)) {
+ myConverterData->myConverterArray[KSC5601] =
+ ucnv_loadSharedData("ksc_5601", &stackPieces, &stackArgs, errorCode);
+ }
++#endif
+
+ /* set the function pointers to appropriate funtions */
+ cnv->sharedData=(UConverterSharedData*)(&_ISO2022JPData);
+@@ -513,6 +534,7 @@
+ myConverterData->name[len]=(char)(myConverterData->version+(int)'0');
+ myConverterData->name[len+1]='\0';
+ }
++#ifdef U_ENABLE_ISO_2022_KR_CN
+ else if(myLocale[0]=='k' && (myLocale[1]=='o'|| myLocale[1]=='r') &&
+ (myLocale[2]=='_' || myLocale[2]=='\0'))
+ {
+@@ -558,13 +580,13 @@
+
+ /* open the required converters and cache them */
+ myConverterData->myConverterArray[GB2312_1] =
+- ucnv_loadSharedData("ibm-5478", &stackPieces, &stackArgs, errorCode);
++ ucnv_loadSharedData("noop-gb2312_gl", &stackPieces, &stackArgs, errorCode);
+ if(version==1) {
+ myConverterData->myConverterArray[ISO_IR_165] =
+- ucnv_loadSharedData("iso-ir-165", &stackPieces, &stackArgs, errorCode);
++ ucnv_loadSharedData("noop-iso-ir-165", &stackPieces, &stackArgs, errorCode);
+ }
+ myConverterData->myConverterArray[CNS_11643] =
+- ucnv_loadSharedData("cns-11643-1992", &stackPieces, &stackArgs, errorCode);
++ ucnv_loadSharedData("noop-cns-11643", &stackPieces, &stackArgs, errorCode);
+
+
+ /* set the function pointers to appropriate funtions */
+@@ -582,6 +604,7 @@
+ (void)uprv_strcpy(myConverterData->name,"ISO_2022,locale=zh,version=2");
+ }
+ }
++#endif // U_ENABLE_ISO_2022_KR_CN
+ else{
+ #ifdef U_ENABLE_GENERIC_ISO_2022
+ myConverterData->isFirstBuffer = TRUE;
+Index: source/common/ucnvbocu.cpp
+===================================================================
+--- source/common/ucnvbocu.cpp (revision 259715)
++++ source/common/ucnvbocu.cpp (working copy)
+@@ -19,7 +19,7 @@
+
+ #include "unicode/utypes.h"
+
+-#if !UCONFIG_NO_CONVERSION
++#if !UCONFIG_NO_CONVERSION && !UCONFIG_NO_NON_HTML5_CONVERSION
+
+ #include "unicode/ucnv.h"
+ #include "unicode/ucnv_cb.h"
+Index: source/common/ucnvisci.c
+===================================================================
+--- source/common/ucnvisci.c (revision 259715)
++++ source/common/ucnvisci.c (working copy)
+@@ -17,7 +17,7 @@
+
+ #include "unicode/utypes.h"
+
+-#if !UCONFIG_NO_CONVERSION && !UCONFIG_NO_LEGACY_CONVERSION
++#if !UCONFIG_NO_CONVERSION && !UCONFIG_NO_LEGACY_CONVERSION && !UCONFIG_NO_NON_HTML5_CONVERSION
+
+ #include "unicode/ucnv.h"
+ #include "unicode/ucnv_cb.h"
+Index: source/common/ucnvscsu.c
+===================================================================
+--- source/common/ucnvscsu.c (revision 259715)
++++ source/common/ucnvscsu.c (working copy)
+@@ -21,7 +21,7 @@
+
+ #include "unicode/utypes.h"
+
+-#if !UCONFIG_NO_CONVERSION
++#if !UCONFIG_NO_CONVERSION && !UCONFIG_NO_NON_HTML5_CONVERSION
+
+ #include "unicode/ucnv.h"
+ #include "unicode/ucnv_cb.h"
+Index: source/common/ucnv_u7.c
+===================================================================
+--- source/common/ucnv_u7.c (revision 259715)
++++ source/common/ucnv_u7.c (working copy)
+@@ -16,7 +16,7 @@
+
+ #include "unicode/utypes.h"
+
+-#if !UCONFIG_NO_CONVERSION
++#if !UCONFIG_NO_CONVERSION && !UCONFIG_NO_NON_HTML5_CONVERSION
+
+ #include "unicode/ucnv.h"
+ #include "ucnv_bld.h"
+Index: source/common/unicode/uconfig.h
+===================================================================
+--- source/common/unicode/uconfig.h (revision 259715)
++++ source/common/unicode/uconfig.h (working copy)
+@@ -265,6 +265,14 @@
+ #endif
+
+ /**
++ * This switch turns off all the converters NOT listed in
++ * the encoding standard : http://encoding.spec.whatwg.org
++ */
++#if UCONFIG_NO_NONHTML5_CONVERSION
++#define UCONFIG_NO_NON_HTML5_CONVERSION 1
++#endif
++
++/**
+ * \def UCONFIG_NO_LEGACY_CONVERSION
+ * This switch turns off all converters except for
+ * - Unicode charsets (UTF-7/8/16/32, CESU-8, SCSU, BOCU-1)
Property changes on: icu52/patches/uconv.patch
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698