bug 210501 - implement case-folding support (ToUpper/Lower/Titlecase) for non-BMP characters (Unicode plane 1 and above). r=smontagu
authorJonathan Kew <jfkthame@gmail.com>
Wed, 14 Mar 2012 06:45:00 +0000
changeset 93109 edc0871b4e5b4230a27c3726ab95459fa1a46175
parent 93108 c1c473ede6289b53e4df543e0b3b5985e7ad7ff1
child 93110 6913a9ff86e1290334679ec96754edb2b1b0c91f
push id160
push userlsblakk@mozilla.com
push dateFri, 13 Jul 2012 18:18:57 +0000
treeherdermozilla-release@228ba1a111fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmontagu
bugs210501
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 210501 - implement case-folding support (ToUpper/Lower/Titlecase) for non-BMP characters (Unicode plane 1 and above). r=smontagu
intl/unicharutil/public/Makefile.in
intl/unicharutil/public/nsUnicodeProperties.h
intl/unicharutil/public/nsUnicodeScriptCodes.h
intl/unicharutil/src/Makefile.in
intl/unicharutil/src/casetable.h
intl/unicharutil/src/nsUnicodeProperties.cpp
intl/unicharutil/src/nsUnicodePropertyData.cpp
intl/unicharutil/tools/genUnicodePropertyData.pl
intl/unicharutil/tools/gencasetable.pl
intl/unicharutil/util/Makefile.in
intl/unicharutil/util/nsUnicharUtils.cpp
intl/unicharutil/util/nsUnicharUtils.h
intl/unicharutil/util/nsUnicodeProperties.cpp
intl/unicharutil/util/nsUnicodeProperties.h
intl/unicharutil/util/nsUnicodePropertyData.cpp
intl/unicharutil/util/nsUnicodeScriptCodes.h
intl/unicharutil/util/objs.mk
--- a/intl/unicharutil/public/Makefile.in
+++ b/intl/unicharutil/public/Makefile.in
@@ -44,14 +44,12 @@ include $(DEPTH)/config/autoconf.mk
 
 MODULE		= unicharutil
 
 EXPORTS		= \
 		nsICaseConversion.h \
 		nsIUGenCategory.h \
 		nsUnicharUtilCIID.h \
 		nsUnicodeNormalizer.h \
-		nsUnicodeProperties.h \
-		nsUnicodeScriptCodes.h \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
--- a/intl/unicharutil/src/Makefile.in
+++ b/intl/unicharutil/src/Makefile.in
@@ -42,20 +42,17 @@ VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= unicharutil
 LIBRARY_NAME	= ucharucomp_s
 FORCE_STATIC_LIB = 1
 LIBXUL_LIBRARY = 1
 
-DEFINES += -DHB_DONT_DEFINE_STDINT
-
 CPPSRCS		= \
 		nsCaseConversionImp2.cpp \
 		nsCategoryImp.cpp \
 		nsEntityConverter.cpp \
 		nsSaveAsCharset.cpp \
 		nsUnicodeNormalizer.cpp \
-		nsUnicodeProperties.cpp \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/intl/unicharutil/src/casetable.h
+++ /dev/null
@@ -1,388 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1999
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-/* 
-    DO NOT EDIT THIS DOCUMENT !!! THIS DOCUMENT IS GENERATED BY
-    mozilla/intl/unicharutil/tools/gencasetable.pl
- */
-#include "nscore.h" 
-
-static const PRUnichar gUpperToTitle[] = { 
-   0x01F1,    0x01F2, 
-   0x01C7,    0x01C8, 
-   0x01CA,    0x01CB, 
-   0x01C4,    0x01C5, 
-};
-
-static const PRUint32 gUpperToTitleItems = 4;
-
-static const PRUint16 gToUpper[] = 
-{ /*   From    To             Every   Diff   */ 
-       0x0061, ((0x19 << 8) | 0x01), 0xffe0  ,
-       0x00b5, ((0x00 << 8) | 0x00), 0x02e7  ,
-       0x00e0, ((0x16 << 8) | 0x01), 0xffe0  ,
-       0x00f8, ((0x06 << 8) | 0x01), 0xffe0  ,
-       0x00ff, ((0x00 << 8) | 0x00), 0x0079  ,
-       0x0101, ((0x2e << 8) | 0x02), 0xffff  ,
-       0x0131, ((0x00 << 8) | 0x00), 0xff18  ,
-       0x0133, ((0x04 << 8) | 0x02), 0xffff  ,
-       0x013a, ((0x0e << 8) | 0x02), 0xffff  ,
-       0x014b, ((0x2c << 8) | 0x02), 0xffff  ,
-       0x017a, ((0x04 << 8) | 0x02), 0xffff  ,
-       0x017f, ((0x00 << 8) | 0x00), 0xfed4  ,
-       0x0180, ((0x00 << 8) | 0x00), 0x00c3  ,
-       0x0183, ((0x02 << 8) | 0x02), 0xffff  ,
-       0x0188, ((0x04 << 8) | 0x04), 0xffff  ,
-       0x0192, ((0x00 << 8) | 0x00), 0xffff  ,
-       0x0195, ((0x00 << 8) | 0x00), 0x0061  ,
-       0x0199, ((0x00 << 8) | 0x00), 0xffff  ,
-       0x019a, ((0x00 << 8) | 0x00), 0x00a3  ,
-       0x019e, ((0x00 << 8) | 0x00), 0x0082  ,
-       0x01a1, ((0x04 << 8) | 0x02), 0xffff  ,
-       0x01a8, ((0x05 << 8) | 0x05), 0xffff  ,
-       0x01b0, ((0x04 << 8) | 0x04), 0xffff  ,
-       0x01b6, ((0x03 << 8) | 0x03), 0xffff  ,
-       0x01bd, ((0x00 << 8) | 0x00), 0xffff  ,
-       0x01bf, ((0x00 << 8) | 0x00), 0x0038  ,
-       0x01c5, ((0x00 << 8) | 0x00), 0xffff  ,
-       0x01c6, ((0x00 << 8) | 0x00), 0xfffe  ,
-       0x01c8, ((0x00 << 8) | 0x00), 0xffff  ,
-       0x01c9, ((0x00 << 8) | 0x00), 0xfffe  ,
-       0x01cb, ((0x00 << 8) | 0x00), 0xffff  ,
-       0x01cc, ((0x00 << 8) | 0x00), 0xfffe  ,
-       0x01ce, ((0x0e << 8) | 0x02), 0xffff  ,
-       0x01dd, ((0x00 << 8) | 0x00), 0xffb1  ,
-       0x01df, ((0x10 << 8) | 0x02), 0xffff  ,
-       0x01f2, ((0x00 << 8) | 0x00), 0xffff  ,
-       0x01f3, ((0x00 << 8) | 0x00), 0xfffe  ,
-       0x01f5, ((0x04 << 8) | 0x04), 0xffff  ,
-       0x01fb, ((0x24 << 8) | 0x02), 0xffff  ,
-       0x0223, ((0x10 << 8) | 0x02), 0xffff  ,
-       0x023c, ((0x00 << 8) | 0x00), 0xffff  ,
-       0x023f, ((0x01 << 8) | 0x01), 0x2a3f  ,
-       0x0242, ((0x05 << 8) | 0x05), 0xffff  ,
-       0x0249, ((0x06 << 8) | 0x02), 0xffff  ,
-       0x0250, ((0x00 << 8) | 0x00), 0x2a1f  ,
-       0x0251, ((0x00 << 8) | 0x00), 0x2a1c  ,
-       0x0252, ((0x00 << 8) | 0x00), 0x2a1e  ,
-       0x0253, ((0x00 << 8) | 0x00), 0xff2e  ,
-       0x0254, ((0x00 << 8) | 0x00), 0xff32  ,
-       0x0256, ((0x01 << 8) | 0x01), 0xff33  ,
-       0x0259, ((0x00 << 8) | 0x00), 0xff36  ,
-       0x025b, ((0x00 << 8) | 0x00), 0xff35  ,
-       0x0260, ((0x00 << 8) | 0x00), 0xff33  ,
-       0x0263, ((0x00 << 8) | 0x00), 0xff31  ,
-       0x0265, ((0x00 << 8) | 0x00), 0xa528  ,
-       0x0266, ((0x00 << 8) | 0x00), 0xa544  ,
-       0x0268, ((0x00 << 8) | 0x00), 0xff2f  ,
-       0x0269, ((0x00 << 8) | 0x00), 0xff2d  ,
-       0x026b, ((0x00 << 8) | 0x00), 0x29f7  ,
-       0x026f, ((0x00 << 8) | 0x00), 0xff2d  ,
-       0x0271, ((0x00 << 8) | 0x00), 0x29fd  ,
-       0x0272, ((0x00 << 8) | 0x00), 0xff2b  ,
-       0x0275, ((0x00 << 8) | 0x00), 0xff2a  ,
-       0x027d, ((0x00 << 8) | 0x00), 0x29e7  ,
-       0x0280, ((0x03 << 8) | 0x03), 0xff26  ,
-       0x0288, ((0x00 << 8) | 0x00), 0xff26  ,
-       0x0289, ((0x00 << 8) | 0x00), 0xffbb  ,
-       0x028a, ((0x01 << 8) | 0x01), 0xff27  ,
-       0x028c, ((0x00 << 8) | 0x00), 0xffb9  ,
-       0x0292, ((0x00 << 8) | 0x00), 0xff25  ,
-       0x0345, ((0x00 << 8) | 0x00), 0x0054  ,
-       0x0371, ((0x02 << 8) | 0x02), 0xffff  ,
-       0x0377, ((0x00 << 8) | 0x00), 0xffff  ,
-       0x037b, ((0x02 << 8) | 0x01), 0x0082  ,
-       0x03ac, ((0x00 << 8) | 0x00), 0xffda  ,
-       0x03ad, ((0x02 << 8) | 0x01), 0xffdb  ,
-       0x03b1, ((0x10 << 8) | 0x01), 0xffe0  ,
-       0x03c2, ((0x00 << 8) | 0x00), 0xffe1  ,
-       0x03c3, ((0x08 << 8) | 0x01), 0xffe0  ,
-       0x03cc, ((0x00 << 8) | 0x00), 0xffc0  ,
-       0x03cd, ((0x01 << 8) | 0x01), 0xffc1  ,
-       0x03d0, ((0x00 << 8) | 0x00), 0xffc2  ,
-       0x03d1, ((0x00 << 8) | 0x00), 0xffc7  ,
-       0x03d5, ((0x00 << 8) | 0x00), 0xffd1  ,
-       0x03d6, ((0x00 << 8) | 0x00), 0xffca  ,
-       0x03d7, ((0x00 << 8) | 0x00), 0xfff8  ,
-       0x03d9, ((0x16 << 8) | 0x02), 0xffff  ,
-       0x03f0, ((0x00 << 8) | 0x00), 0xffaa  ,
-       0x03f1, ((0x00 << 8) | 0x00), 0xffb0  ,
-       0x03f2, ((0x00 << 8) | 0x00), 0x0007  ,
-       0x03f5, ((0x00 << 8) | 0x00), 0xffa0  ,
-       0x03f8, ((0x03 << 8) | 0x03), 0xffff  ,
-       0x0430, ((0x1f << 8) | 0x01), 0xffe0  ,
-       0x0450, ((0x0f << 8) | 0x01), 0xffb0  ,
-       0x0461, ((0x20 << 8) | 0x02), 0xffff  ,
-       0x048b, ((0x34 << 8) | 0x02), 0xffff  ,
-       0x04c2, ((0x0c << 8) | 0x02), 0xffff  ,
-       0x04cf, ((0x00 << 8) | 0x00), 0xfff1  ,
-       0x04d1, ((0x56 << 8) | 0x02), 0xffff  ,
-       0x0561, ((0x25 << 8) | 0x01), 0xffd0  ,
-       0x1d79, ((0x00 << 8) | 0x00), 0x8a04  ,
-       0x1d7d, ((0x00 << 8) | 0x00), 0x0ee6  ,
-       0x1e01, ((0x94 << 8) | 0x02), 0xffff  ,
-       0x1e9b, ((0x00 << 8) | 0x00), 0xffc5  ,
-       0x1ea1, ((0x5e << 8) | 0x02), 0xffff  ,
-       0x1f00, ((0x07 << 8) | 0x01), 0x0008  ,
-       0x1f10, ((0x05 << 8) | 0x01), 0x0008  ,
-       0x1f20, ((0x07 << 8) | 0x01), 0x0008  ,
-       0x1f30, ((0x07 << 8) | 0x01), 0x0008  ,
-       0x1f40, ((0x05 << 8) | 0x01), 0x0008  ,
-       0x1f51, ((0x06 << 8) | 0x02), 0x0008  ,
-       0x1f60, ((0x07 << 8) | 0x01), 0x0008  ,
-       0x1f70, ((0x01 << 8) | 0x01), 0x004a  ,
-       0x1f72, ((0x03 << 8) | 0x01), 0x0056  ,
-       0x1f76, ((0x01 << 8) | 0x01), 0x0064  ,
-       0x1f78, ((0x01 << 8) | 0x01), 0x0080  ,
-       0x1f7a, ((0x01 << 8) | 0x01), 0x0070  ,
-       0x1f7c, ((0x01 << 8) | 0x01), 0x007e  ,
-       0x1f80, ((0x07 << 8) | 0x01), 0x0008  ,
-       0x1f90, ((0x07 << 8) | 0x01), 0x0008  ,
-       0x1fa0, ((0x07 << 8) | 0x01), 0x0008  ,
-       0x1fb0, ((0x01 << 8) | 0x01), 0x0008  ,
-       0x1fb3, ((0x00 << 8) | 0x00), 0x0009  ,
-       0x1fbe, ((0x00 << 8) | 0x00), 0xe3db  ,
-       0x1fc3, ((0x00 << 8) | 0x00), 0x0009  ,
-       0x1fd0, ((0x01 << 8) | 0x01), 0x0008  ,
-       0x1fe0, ((0x01 << 8) | 0x01), 0x0008  ,
-       0x1fe5, ((0x00 << 8) | 0x00), 0x0007  ,
-       0x1ff3, ((0x00 << 8) | 0x00), 0x0009  ,
-       0x214e, ((0x00 << 8) | 0x00), 0xffe4  ,
-       0x2170, ((0x0f << 8) | 0x01), 0xfff0  ,
-       0x2184, ((0x00 << 8) | 0x00), 0xffff  ,
-       0x24d0, ((0x19 << 8) | 0x01), 0xffe6  ,
-       0x2c30, ((0x2e << 8) | 0x01), 0xffd0  ,
-       0x2c61, ((0x00 << 8) | 0x00), 0xffff  ,
-       0x2c65, ((0x00 << 8) | 0x00), 0xd5d5  ,
-       0x2c66, ((0x00 << 8) | 0x00), 0xd5d8  ,
-       0x2c68, ((0x04 << 8) | 0x02), 0xffff  ,
-       0x2c73, ((0x03 << 8) | 0x03), 0xffff  ,
-       0x2c81, ((0x62 << 8) | 0x02), 0xffff  ,
-       0x2cec, ((0x02 << 8) | 0x02), 0xffff  ,
-       0x2cf3, ((0x00 << 8) | 0x00), 0xffff  ,
-       0x2d00, ((0x25 << 8) | 0x01), 0xe3a0  ,
-       0x2d27, ((0x06 << 8) | 0x06), 0xe3a0  ,
-       0xa641, ((0x2c << 8) | 0x02), 0xffff  ,
-       0xa681, ((0x16 << 8) | 0x02), 0xffff  ,
-       0xa723, ((0x0c << 8) | 0x02), 0xffff  ,
-       0xa733, ((0x3c << 8) | 0x02), 0xffff  ,
-       0xa77a, ((0x02 << 8) | 0x02), 0xffff  ,
-       0xa77f, ((0x08 << 8) | 0x02), 0xffff  ,
-       0xa78c, ((0x05 << 8) | 0x05), 0xffff  ,
-       0xa793, ((0x0e << 8) | 0x0e), 0xffff  ,
-       0xa7a3, ((0x06 << 8) | 0x02), 0xffff  ,
-       0xff41, ((0x19 << 8) | 0x01), 0xffe0   
-};
-
-static const PRUint32 gToUpperItems = 154;
-
-static const PRUint16 gToLower[] = 
-{ /*   From    To             Every   Diff   */ 
-       0x0041, ((0x19 << 8) | 0x01), 0x0020  ,
-       0x00c0, ((0x16 << 8) | 0x01), 0x0020  ,
-       0x00d8, ((0x06 << 8) | 0x01), 0x0020  ,
-       0x0100, ((0x2e << 8) | 0x02), 0x0001  ,
-       0x0130, ((0x00 << 8) | 0x00), 0xff39  ,
-       0x0132, ((0x04 << 8) | 0x02), 0x0001  ,
-       0x0139, ((0x0e << 8) | 0x02), 0x0001  ,
-       0x014a, ((0x2c << 8) | 0x02), 0x0001  ,
-       0x0178, ((0x00 << 8) | 0x00), 0xff87  ,
-       0x0179, ((0x04 << 8) | 0x02), 0x0001  ,
-       0x0181, ((0x00 << 8) | 0x00), 0x00d2  ,
-       0x0182, ((0x02 << 8) | 0x02), 0x0001  ,
-       0x0186, ((0x00 << 8) | 0x00), 0x00ce  ,
-       0x0187, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x0189, ((0x01 << 8) | 0x01), 0x00cd  ,
-       0x018b, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x018e, ((0x00 << 8) | 0x00), 0x004f  ,
-       0x018f, ((0x00 << 8) | 0x00), 0x00ca  ,
-       0x0190, ((0x00 << 8) | 0x00), 0x00cb  ,
-       0x0191, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x0193, ((0x00 << 8) | 0x00), 0x00cd  ,
-       0x0194, ((0x00 << 8) | 0x00), 0x00cf  ,
-       0x0196, ((0x00 << 8) | 0x00), 0x00d3  ,
-       0x0197, ((0x00 << 8) | 0x00), 0x00d1  ,
-       0x0198, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x019c, ((0x00 << 8) | 0x00), 0x00d3  ,
-       0x019d, ((0x00 << 8) | 0x00), 0x00d5  ,
-       0x019f, ((0x00 << 8) | 0x00), 0x00d6  ,
-       0x01a0, ((0x04 << 8) | 0x02), 0x0001  ,
-       0x01a6, ((0x00 << 8) | 0x00), 0x00da  ,
-       0x01a7, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x01a9, ((0x00 << 8) | 0x00), 0x00da  ,
-       0x01ac, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x01ae, ((0x00 << 8) | 0x00), 0x00da  ,
-       0x01af, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x01b1, ((0x01 << 8) | 0x01), 0x00d9  ,
-       0x01b3, ((0x02 << 8) | 0x02), 0x0001  ,
-       0x01b7, ((0x00 << 8) | 0x00), 0x00db  ,
-       0x01b8, ((0x04 << 8) | 0x04), 0x0001  ,
-       0x01c4, ((0x00 << 8) | 0x00), 0x0002  ,
-       0x01c5, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x01c7, ((0x00 << 8) | 0x00), 0x0002  ,
-       0x01c8, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x01ca, ((0x00 << 8) | 0x00), 0x0002  ,
-       0x01cb, ((0x10 << 8) | 0x02), 0x0001  ,
-       0x01de, ((0x10 << 8) | 0x02), 0x0001  ,
-       0x01f1, ((0x00 << 8) | 0x00), 0x0002  ,
-       0x01f2, ((0x02 << 8) | 0x02), 0x0001  ,
-       0x01f6, ((0x00 << 8) | 0x00), 0xff9f  ,
-       0x01f7, ((0x00 << 8) | 0x00), 0xffc8  ,
-       0x01f8, ((0x26 << 8) | 0x02), 0x0001  ,
-       0x0220, ((0x00 << 8) | 0x00), 0xff7e  ,
-       0x0222, ((0x10 << 8) | 0x02), 0x0001  ,
-       0x023a, ((0x00 << 8) | 0x00), 0x2a2b  ,
-       0x023b, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x023d, ((0x00 << 8) | 0x00), 0xff5d  ,
-       0x023e, ((0x00 << 8) | 0x00), 0x2a28  ,
-       0x0241, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x0243, ((0x00 << 8) | 0x00), 0xff3d  ,
-       0x0244, ((0x00 << 8) | 0x00), 0x0045  ,
-       0x0245, ((0x00 << 8) | 0x00), 0x0047  ,
-       0x0246, ((0x08 << 8) | 0x02), 0x0001  ,
-       0x0370, ((0x02 << 8) | 0x02), 0x0001  ,
-       0x0376, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x0386, ((0x00 << 8) | 0x00), 0x0026  ,
-       0x0388, ((0x02 << 8) | 0x01), 0x0025  ,
-       0x038c, ((0x00 << 8) | 0x00), 0x0040  ,
-       0x038e, ((0x01 << 8) | 0x01), 0x003f  ,
-       0x0391, ((0x10 << 8) | 0x01), 0x0020  ,
-       0x03a3, ((0x08 << 8) | 0x01), 0x0020  ,
-       0x03cf, ((0x00 << 8) | 0x00), 0x0008  ,
-       0x03d8, ((0x16 << 8) | 0x02), 0x0001  ,
-       0x03f4, ((0x00 << 8) | 0x00), 0xffc4  ,
-       0x03f7, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x03f9, ((0x00 << 8) | 0x00), 0xfff9  ,
-       0x03fa, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x03fd, ((0x02 << 8) | 0x01), 0xff7e  ,
-       0x0400, ((0x0f << 8) | 0x01), 0x0050  ,
-       0x0410, ((0x1f << 8) | 0x01), 0x0020  ,
-       0x0460, ((0x20 << 8) | 0x02), 0x0001  ,
-       0x048a, ((0x34 << 8) | 0x02), 0x0001  ,
-       0x04c0, ((0x00 << 8) | 0x00), 0x000f  ,
-       0x04c1, ((0x0c << 8) | 0x02), 0x0001  ,
-       0x04d0, ((0x56 << 8) | 0x02), 0x0001  ,
-       0x0531, ((0x25 << 8) | 0x01), 0x0030  ,
-       0x10a0, ((0x25 << 8) | 0x01), 0x1c60  ,
-       0x10c7, ((0x06 << 8) | 0x06), 0x1c60  ,
-       0x1e00, ((0x94 << 8) | 0x02), 0x0001  ,
-       0x1e9e, ((0x00 << 8) | 0x00), 0xe241  ,
-       0x1ea0, ((0x5e << 8) | 0x02), 0x0001  ,
-       0x1f08, ((0x07 << 8) | 0x01), 0xfff8  ,
-       0x1f18, ((0x05 << 8) | 0x01), 0xfff8  ,
-       0x1f28, ((0x07 << 8) | 0x01), 0xfff8  ,
-       0x1f38, ((0x07 << 8) | 0x01), 0xfff8  ,
-       0x1f48, ((0x05 << 8) | 0x01), 0xfff8  ,
-       0x1f59, ((0x06 << 8) | 0x02), 0xfff8  ,
-       0x1f68, ((0x07 << 8) | 0x01), 0xfff8  ,
-       0x1f88, ((0x07 << 8) | 0x01), 0xfff8  ,
-       0x1f98, ((0x07 << 8) | 0x01), 0xfff8  ,
-       0x1fa8, ((0x07 << 8) | 0x01), 0xfff8  ,
-       0x1fb8, ((0x01 << 8) | 0x01), 0xfff8  ,
-       0x1fba, ((0x01 << 8) | 0x01), 0xffb6  ,
-       0x1fbc, ((0x00 << 8) | 0x00), 0xfff7  ,
-       0x1fc8, ((0x03 << 8) | 0x01), 0xffaa  ,
-       0x1fcc, ((0x00 << 8) | 0x00), 0xfff7  ,
-       0x1fd8, ((0x01 << 8) | 0x01), 0xfff8  ,
-       0x1fda, ((0x01 << 8) | 0x01), 0xff9c  ,
-       0x1fe8, ((0x01 << 8) | 0x01), 0xfff8  ,
-       0x1fea, ((0x01 << 8) | 0x01), 0xff90  ,
-       0x1fec, ((0x00 << 8) | 0x00), 0xfff9  ,
-       0x1ff8, ((0x01 << 8) | 0x01), 0xff80  ,
-       0x1ffa, ((0x01 << 8) | 0x01), 0xff82  ,
-       0x1ffc, ((0x00 << 8) | 0x00), 0xfff7  ,
-       0x2126, ((0x00 << 8) | 0x00), 0xe2a3  ,
-       0x212a, ((0x00 << 8) | 0x00), 0xdf41  ,
-       0x212b, ((0x00 << 8) | 0x00), 0xdfba  ,
-       0x2132, ((0x00 << 8) | 0x00), 0x001c  ,
-       0x2160, ((0x0f << 8) | 0x01), 0x0010  ,
-       0x2183, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x24b6, ((0x19 << 8) | 0x01), 0x001a  ,
-       0x2c00, ((0x2e << 8) | 0x01), 0x0030  ,
-       0x2c60, ((0x00 << 8) | 0x00), 0x0001  ,
-       0x2c62, ((0x00 << 8) | 0x00), 0xd609  ,
-       0x2c63, ((0x00 << 8) | 0x00), 0xf11a  ,
-       0x2c64, ((0x00 << 8) | 0x00), 0xd619  ,
-       0x2c67, ((0x04 << 8) | 0x02), 0x0001  ,
-       0x2c6d, ((0x00 << 8) | 0x00), 0xd5e4  ,
-       0x2c6e, ((0x00 << 8) | 0x00), 0xd603  ,
-       0x2c6f, ((0x00 << 8) | 0x00), 0xd5e1  ,
-       0x2c70, ((0x00 << 8) | 0x00), 0xd5e2  ,
-       0x2c72, ((0x03 << 8) | 0x03), 0x0001  ,
-       0x2c7e, ((0x01 << 8) | 0x01), 0xd5c1  ,
-       0x2c80, ((0x62 << 8) | 0x02), 0x0001  ,
-       0x2ceb, ((0x02 << 8) | 0x02), 0x0001  ,
-       0x2cf2, ((0x00 << 8) | 0x00), 0x0001  ,
-       0xa640, ((0x2c << 8) | 0x02), 0x0001  ,
-       0xa680, ((0x16 << 8) | 0x02), 0x0001  ,
-       0xa722, ((0x0c << 8) | 0x02), 0x0001  ,
-       0xa732, ((0x3c << 8) | 0x02), 0x0001  ,
-       0xa779, ((0x02 << 8) | 0x02), 0x0001  ,
-       0xa77d, ((0x00 << 8) | 0x00), 0x75fc  ,
-       0xa77e, ((0x08 << 8) | 0x02), 0x0001  ,
-       0xa78b, ((0x00 << 8) | 0x00), 0x0001  ,
-       0xa78d, ((0x00 << 8) | 0x00), 0x5ad8  ,
-       0xa790, ((0x02 << 8) | 0x02), 0x0001  ,
-       0xa7a0, ((0x08 << 8) | 0x02), 0x0001  ,
-       0xa7aa, ((0x00 << 8) | 0x00), 0x5abc  ,
-       0xff21, ((0x19 << 8) | 0x01), 0x0020   
-};
-
-static const PRUint32 gToLowerItems = 148;
-
-static const PRUint32 gCaseBlocks [8] = {
-0xE001003F,
-0x00003012,
-0x00000000,
-0x00000000,
-0x00000000,
-0x000000C0,
-0x00000000,
-0x80000000
-};
-
-// We map x -> x, except for upper-case letters,
-// which we map to their lower-case equivalents.
-static const PRUint8 gASCIIToLower [128] = {
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
-    0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
-    0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
-    0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
-    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
-    0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
-    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
-};
--- a/intl/unicharutil/tools/genUnicodePropertyData.pl
+++ b/intl/unicharutil/tools/genUnicodePropertyData.pl
@@ -128,20 +128,22 @@ close FH;
 
 # initialize default properties
 my @script;
 my @category;
 my @combining;
 my @eaw;
 my @mirror;
 my @hangul;
+my @casemap;
 for (my $i = 0; $i < 0x110000; ++$i) {
     $script[$i] = $scriptCode{"UNKNOWN"};
     $category[$i] = $catCode{"UNASSIGNED"};
     $combining[$i] = 0;
+    $casemap[$i] = 0;
 }
 
 my %ucd2hb = (
 'Cc' => 'CONTROL',
 'Cf' => 'FORMAT',
 'Cn' => 'UNASSIGNED',
 'Co' => 'PRIVATE_USE',
 'Cs' => 'SURROGATE',
@@ -176,19 +178,26 @@ my %ucd2hb = (
 my @versionInfo;
 open FH, "< $ARGV[1]/ReadMe.txt" or die "can't open Unicode ReadMe.txt file\n";
 while (<FH>) {
     chomp;
     push @versionInfo, $_;
 }
 close FH;
 
+my $kTitleToUpper = 0x80000000;
+my $kUpperToLower = 0x40000000;
+my $kLowerToTitle = 0x20000000;
+my $kLowerToUpper = 0x10000000;
+my $kCaseMapCharMask = 0x001fffff;
+
 # read UnicodeData.txt
 open FH, "< $ARGV[1]/UnicodeData.txt" or die "can't open UCD file UnicodeData.txt\n";
 while (<FH>) {
+    chomp;
     my @fields = split /;/;
     if ($fields[1] =~ /First/) {
         my $first = hex "0x$fields[0]";
         $_ = <FH>;
         @fields = split /;/;
         if ($fields[1] =~ /Last/) {
             my $last = hex "0x$fields[0]";
             do {
@@ -198,16 +207,37 @@ while (<FH>) {
             } while ($first <= $last);
         } else {
             die "didn't find Last code for range!\n";
         }
     } else {
         my $usv = hex "0x$fields[0]";
         $category[$usv] = $catCode{$ucd2hb{$fields[2]}};
         $combining[$usv] = $fields[3];
+        my $upper = hex $fields[12];
+        my $lower = hex $fields[13];
+        my $title = hex $fields[14];
+        # we only store one mapping for each character,
+        # but also record what kind of mapping it is
+        if ($upper && $lower) {
+            $casemap[$usv] |= $kTitleToUpper;
+            $casemap[$usv] |= ($usv ^ $upper);
+        }
+        elsif ($lower) {
+            $casemap[$usv] |= $kUpperToLower;
+            $casemap[$usv] |= ($usv ^ $lower);
+        }
+        elsif ($title && ($title != $upper)) {
+            $casemap[$usv] |= $kLowerToTitle;
+            $casemap[$usv] |= ($usv ^ $title);
+        }
+        elsif ($upper) {
+            $casemap[$usv] |= $kLowerToUpper;
+            $casemap[$usv] |= ($usv ^ $upper);
+        }
     }
 }
 close FH;
 
 # read Scripts.txt
 open FH, "< $ARGV[1]/Scripts.txt" or die "can't open UCD file Scripts.txt\n";
 push @versionInfo, "";
 while (<FH>) {
@@ -388,17 +418,17 @@ for (my $i = 0; $i < scalar @scriptCodeT
 }
 print DATA_TABLES "};\n\n";
 
 sub sprintScript
 {
   my $usv = shift;
   return sprintf("%d,", $script[$usv]);
 }
-&genTables("Script", "PRUint8", 10, 6, \&sprintScript, 1);
+&genTables("Script", "PRUint8", 10, 6, \&sprintScript, 16);
 
 sub sprintCC
 {
   my $usv = shift;
   return sprintf("%d,", $combining[$usv]);
 }
 &genTables("CClass", "PRUint8", 10, 6, \&sprintCC, 1);
 
@@ -418,41 +448,55 @@ sub sprintMirror
 &genTables("Mirror", "PRInt8", 9, 7, \&sprintMirror, 0);
 
 sub sprintCatEAW
 {
   my $usv = shift;
   return sprintf("{%d,%d},", $eaw[$usv], $category[$usv]);
 }
 &genTables("CatEAW", "struct {\n  unsigned char mEAW:3;\n  unsigned char mCategory:5;\n}",
-           9, 7, \&sprintCatEAW, 1);
+           9, 7, \&sprintCatEAW, 16);
 
 sub sprintHangulType
 {
   my $usv = shift;
   return sprintf("%d,", $hangul[$usv]);
 }
 &genTables("Hangul", "PRUint8", 10, 6, \&sprintHangulType, 0);
 
+sub sprintCasemap
+{
+  my $usv = shift;
+  return sprintf("0x%08x,", $casemap[$usv]);
+}
+&genTables("CaseMap", "PRUint32", 11, 5, \&sprintCasemap, 1);
+
+printf DATA_TABLES "const PRUint32 kTitleToUpper = 0x%08x;\n", $kTitleToUpper;
+printf DATA_TABLES "const PRUint32 kUpperToLower = 0x%08x;\n", $kUpperToLower;
+printf DATA_TABLES "const PRUint32 kLowerToTitle = 0x%08x;\n", $kLowerToTitle;
+printf DATA_TABLES "const PRUint32 kLowerToUpper = 0x%08x;\n", $kLowerToUpper;
+printf DATA_TABLES "const PRUint32 kCaseMapCharMask = 0x%08x;\n\n", $kCaseMapCharMask;
+
 sub genTables
 {
-  my ($prefix, $type, $indexBits, $charBits, $func, $smp) = @_;
+  my ($prefix, $type, $indexBits, $charBits, $func, $maxPlane) = @_;
 
+  print DATA_TABLES "#define k${prefix}MaxPlane  $maxPlane\n";
   print DATA_TABLES "#define k${prefix}IndexBits $indexBits\n";
   print DATA_TABLES "#define k${prefix}CharBits  $charBits\n";
 
   my $indexLen = 1 << $indexBits;
   my $dataLen = 1 << $charBits;
   my %charIndex = ();
   my %pageMapIndex = ();
   my @pageMap = ();
   my @char = ();
   
-  my $planeMap = "\x00" x 16;
-  foreach my $plane (0 .. ($smp ? 16 : 0)) {
+  my $planeMap = "\x00" x $maxPlane;
+  foreach my $plane (0 .. $maxPlane) {
     my $pageMap = "\x00" x $indexLen * 2;
     foreach my $page (0 .. $indexLen - 1) {
         my $charValues = "";
         foreach my $ch (0 .. $dataLen - 1) {
             my $usv = $plane * 0x10000 + $page * $dataLen + $ch;
             $charValues .= &$func($usv);
         }
         chop $charValues;
@@ -468,18 +512,18 @@ sub genTables
         $pageMapIndex{$pageMap} = scalar keys %pageMapIndex;
         $pageMap[$pageMapIndex{$pageMap}] = $pageMap;
     }
     if ($plane > 0) {
         substr($planeMap, $plane - 1, 1) = pack('C', $pageMapIndex{$pageMap});
     }
   }
 
-  if ($smp) {
-    print DATA_TABLES "static const PRUint8 s${prefix}Planes[16] = {";
+  if ($maxPlane) {
+    print DATA_TABLES "static const PRUint8 s${prefix}Planes[$maxPlane] = {";
     print DATA_TABLES join(',', map { sprintf("%d", $_) } unpack('C*', $planeMap));
     print DATA_TABLES "};\n\n";
   }
 
   my $chCount = scalar @char;
   my $pmBits = $chCount > 255 ? 16 : 8;
   my $pmCount = scalar @pageMap;
   print DATA_TABLES "static const PRUint${pmBits} s${prefix}Pages[$pmCount][$indexLen] = {\n";
@@ -493,17 +537,19 @@ sub genTables
   print DATA_TABLES "static const $type s${prefix}Values[$chCount][$dataLen] = {\n";
   for (my $i = 0; $i < scalar @char; ++$i) {
     print DATA_TABLES "  {";
     print DATA_TABLES $char[$i];
     print DATA_TABLES $i < $#char ? "},\n" : "}\n";
   }
   print DATA_TABLES "};\n\n";
 
-  print STDERR "Data for $prefix = ", $pmCount*$indexLen*$pmBits/8 + $chCount*$dataLen + 16, "\n";
+  print STDERR "Data for $prefix = ", $pmCount*$indexLen*$pmBits/8 +
+                                      $chCount*$dataLen*(($type =~ /32/) ? 4 : 1) +
+                                      $maxPlane, "\n";
 }
 
 print DATA_TABLES <<__END;
 /*
  * * * * * This file contains MACHINE-GENERATED DATA, do not edit! * * * * *
  */
 __END
 
deleted file mode 100644
--- a/intl/unicharutil/tools/gencasetable.pl
+++ /dev/null
@@ -1,430 +0,0 @@
-#!/usr/bin/perl 
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1999
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-# If you run this script because the Unicode standard has been updated,
-# check xpcom/string/public/nsCharTraits.h to see whether
-# nsCharTraits<PRUnichar>::ASCIIToLower needs to be updated. It only
-# needs to be update if the Unicode consortium adds (or removes)
-# a Unicode character whose lowercase form is an ASCII character.
-# Currently there are only two such characters: KELVIN SIGN and
-# LATIN CAPITAL LETTER I WITH DOT ABOVE.
-
-######################################################################
-#
-# Initial global variable
-#
-######################################################################
-%utot = ();
-$ui=0;
-$li=0;
-
-######################################################################
-#
-# Open the unicode database file
-#
-######################################################################
-open ( UNICODATA , "< UnicodeData-Latest.txt") 
-   || die "cannot find UnicodeData-Latest.txt";
-
-######################################################################
-#
-# Open the output file
-#
-######################################################################
-open ( OUT , "> ../src/casetable.h") 
-  || die "cannot open output ../src/casetable.h file";
-
-######################################################################
-#
-# Generate license and header
-#
-######################################################################
-$npl = <<END_OF_NPL;
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1999
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-/* 
-    DO NOT EDIT THIS DOCUMENT !!! THIS DOCUMENT IS GENERATED BY
-    mozilla/intl/unicharutil/tools/gencasetable.pl
- */
-END_OF_NPL
-print OUT $npl;
-
-print OUT "#include \"nscore.h\" \n\n";
-
-######################################################################
-#
-# Process the file line by line
-#
-######################################################################
-while(<UNICODATA>) {
-   chop;
-   ######################################################################
-   #
-   # Get value from fields
-   #
-   ######################################################################
-   @f = split(/;/ , $_); 
-   $c = $f[0];   # The unicode value
-   $u = $f[12];  # The upper case
-   $l = $f[13];  # The lower case
-   $t = $f[14];  # The title case
-
-   #
-   # print $c . " | " . $u . " | " . $l . " | " . $t . "\n";
-   # 
-
-   ######################################################################
-   #
-   # Process title case for this entry
-   #
-   ######################################################################
-   #
-   # if upper case is not equal to title case , store into
-   # %utot hash
-   #
- 
-   if(($t ne "") && ($u ne "") && ( $u ne $t )) { 
-     #
-     # print $c . " | " . $u . " | " . $l . " | " . $t . "\n";
-     #
-     $utot{$u} = $t;
-   }
-   
-   $cv = hex($c);     # convert the Unicode value into integer
-
-   ######################################################################
-   #
-   # Process upper case for this entry
-   #
-   ######################################################################
-   if( $u ne "") {    # if upper case exist
-      $uvalue = hex($u); # convert the upper case value into integer
-
-      ######################################################################
-      # store related information into arrays
-      # @ucv     - unicode value
-      # @uv      - upper case value (debug only)
-      # @ud      - difference between unicode and upper case 
-      # @ulastd  - difference between unicode and last unicode in the entry
-      ######################################################################
-
-      $ucv[$ui] = $cv;    
-      $uv[$ui] = $uvalue;
-      $ud[$ui] = 0x0000FFFF & ($uvalue - $cv);
-
-      if( $ui ne 0) { 
-          $ulastd[$ui] = $cv - $ucv[$ui-1]; 
-      }
-      $ui++;
-   }
-
-   ######################################################################
-   #
-   # Process lower case for this entry
-   #
-   ######################################################################
-   if( $l ne "") {    # if lower case exist
-      $lvalue = hex($l); # convert the lower case value into integer
-
-      ######################################################################
-      # store related information into arrays
-      # @lcv     - unicode value
-      # @lv      - lower case value (debug only)
-      # @ld      - difference between unicode and lower case 
-      # @llastd  - difference between unicode and last unicode in the entry
-      ######################################################################
-
-      $lcv[$li] = $cv;    
-      $lv[$li] = $lvalue;
-      $ld[$li] = 0x0000FFFF & ($lvalue - $cv);
-
-      if( $li ne 0) { 
-          $llastd[$li] = $cv - $lcv[$li-1]; 
-      }
-      $li++;
-   }
-   if(( $l ne "") || ($u ne "")) {    # if lower or upper case exist
-      $idx = $cv >> 13;
-      $bits = 1 << (($cv >> 8) & 0x1F) ;
-      $blk[$idx] |= $bits;
-   }
-
-}
-
-
-######################################################################
-#
-# Print out all the tables
-#
-######################################################################
-
-######################################################################
-#
-# Print out upper to title case mapping
-#
-######################################################################
-
-$ttotal = 0;
-print OUT "static const PRUnichar gUpperToTitle[] = { \n";
-while(($upper, $title) = each(%utot)) {
-   print OUT "   0x" . $upper . ",    0x" . $utot{$upper} . ", \n";
-   $ttotal++;
-}
-print OUT "};\n\n";
-print OUT "static const PRUint32 gUpperToTitleItems = $ttotal;\n\n";
-
-######################################################################
-#
-# Print out gToUpper table
-#
-######################################################################
-print OUT "static const PRUint16 gToUpper[] = \n";
-print OUT "{ /*   From    To             Every   Diff   */ \n";
-$utotal=0;
-$ufrom = 0;   # remember the start of the output item
-for ($i = 0; $i <= $#ucv; $i++)
-{
-  if(0 eq $i) {
-     ######################################################################
-     #
-     # Print the first item in the array
-     #
-     ######################################################################
-     $ufrom = $ucv[0];
-     printf OUT "       0x%04x, " ,  $ucv[0];
-  } else {
-     ######################################################################
-     #
-     # Print all the item except the first and last one
-     #    only print if the upper case difference is different from the 
-     #    and the difference between last entry changed
-     #
-     ######################################################################
-     if(($ud[$i] ne $ud[$i-1])  || 
-        (($ucv[$i] - $ucv[$i-1]) > 255) ||
-        (($ufrom ne $ucv[$i-1]) && ($ulastd[$i] ne $ulastd[$i-1]))) {
- 
-         $every = 0;
-         if($ufrom ne $ucv[$i-1])
-         {
-             $every = $ulastd[$i-1];
-         }
-
-         printf OUT "((0x%02x << 8) | 0x%02x), 0x%04x  ,\n",
-                ($ucv[$i-1] - $ufrom), $every, $ud[$i-1];
-
-         if((($ucv[$i-1] - $ufrom) > 255) || ($every > 255)) {
-             print "WARNING!!! cannot handle block > 255 chars (Upper)\n\n";
-             printf "0x%04X, 0x%04x,  0x%04x), 0x%04x \n",
-                $ufrom, $ucv[$i-1], $every, $ud[$i-1];
-         }
-
-         $ufrom = $ucv[$i];                  # update the start of the item
-         printf OUT "       0x%04x, " , $ufrom;
-         $utotal++;
-     }
-  }
-  if( $i eq $#ucv) {
-     ######################################################################
-     #
-     # Print the last item in the array
-     #
-     ######################################################################
-     printf OUT "((0x%02x << 8) | 0x%02x), 0x%04x   \n};\n\n",
-            ($ucv[$i] - $ufrom), $ulastd[$i], $ud[$i];
-     $utotal++;
-     print OUT "static const PRUint32 gToUpperItems = $utotal;\n\n";
-  }
-  #
-  #  printf "%4x - %4x - %4x - %4x\n", $ucv[$i], $uv[$i], $ud[$i], $ulastd[$i];
-  #
-}
-
-######################################################################
-#
-# Print out gToLower table
-#
-######################################################################
-print OUT "static const PRUint16 gToLower[] = \n";
-print OUT "{ /*   From    To             Every   Diff   */ \n";
-$ltotal=0;
-$lfrom = 0;   # remember the start of the output item
-for ($i = 0; $i <= $#lcv; $i++)
-{
-  if(0 eq $i) {
-     ######################################################################
-     #
-     # Print the first item in the array
-     #
-     ######################################################################
-     $lfrom = $lcv[0];
-     printf OUT "       0x%04x, " ,  $lcv[0];
-  } else {
-     ######################################################################
-     #
-     # Print all the item except the first and last one
-     #    only print if the lower case difference is different from the 
-     #    and the difference between last entry changed
-     #
-     ######################################################################
-     if(($ld[$i] ne $ld[$i-1])  || 
-        (($lcv[$i] - $lcv[$i-1]) > 255) ||
-        (($lfrom ne $lcv[$i-1]) && ($llastd[$i] ne $llastd[$i-1]))) {
- 
-         $every = 0;
-         if($lfrom ne $lcv[$i-1])
-         {
-             $every = $llastd[$i-1];
-         }
-
-         printf OUT "((0x%02x << 8) | 0x%02x), 0x%04x  ,\n",
-                ($lcv[$i-1] - $lfrom) , $every, $ld[$i-1];
-
-         if((($lcv[$i-1] - $lfrom) > 255) || ($every > 255)) {
-             print "WARNING!!! cannot handle block > 255 chars (Lower)\n\n";
-             printf "0x%04X, 0x%04x,  0x%04x, 0x%04x \n",
-                $lfrom, $lcv[$i-1], $every, $ld[$i-1];
-         }
-         $lfrom = $lcv[$i];                  # update the start of the item
-         printf OUT "       0x%04x, " , $lfrom;
-         $ltotal++;
-     }
-  }
-  if( $i eq $#lcv) {
-     ######################################################################
-     #
-     # Print the last item in the array
-     #
-     ######################################################################
-     printf OUT "((0x%02x << 8) | 0x%02x), 0x%04x   \n};\n\n",
-            ($lcv[$i] - $lfrom), $llastd[$i], $ld[$i];
-     $ltotal++;
-     print OUT "static const PRUint32 gToLowerItems = $ltotal;\n\n";
-  }
-  #
-  #  printf "%4x - %4x - %4x - %4x\n", $lcv[$i], $lv[$i], $ld[$i], $llastd[$i];
-  #
-}
-
-print OUT "static const PRUint32 gCaseBlocks [8] = {\n";
-for($idx=0;$idx<8;$idx++)
-{
-   printf OUT "0x%08X", $blk[$idx];
-   if($idx != 7) {
-      printf OUT ",\n";
-   } else {
-      printf OUT "\n";
-   }
-}
-print OUT "};\n\n";
-
-######################################################################
-#
-# Print out gASCIIToLower table
-#
-######################################################################
-print OUT "// We map x -> x, except for upper-case letters,\n";
-print OUT "// which we map to their lower-case equivalents.\n";
-print OUT "static const PRUint8 gASCIIToLower [128] = {\n";
-
-# Map x -> x, except for upper-case letters, which we map to lower-case
-# letters.
-for($idx=0; $idx < 128; $idx++)
-{
-  if ($idx % 16 == 0) {
-    print OUT "    "
-  }
-
-  if (65 <= $idx && $idx <= 90) {
-    printf OUT "0x%02x", ($idx + 0x20);
-  } else {
-    printf OUT "0x%02x", $idx;
-  }
-
-  if (($idx+1) % 16 != 0) {
-    print OUT ", ";
-  }
-  else {
-    print OUT ",\n";
-  }
-}
-print OUT "};\n";
-
-
-######################################################################
-#
-# Close files
-#
-######################################################################
-close(UNIDATA);
-close(OUT);
-
--- a/intl/unicharutil/util/Makefile.in
+++ b/intl/unicharutil/util/Makefile.in
@@ -58,21 +58,24 @@ SDK_LIBRARY = $(LIBRARY)
 
 SDK_HEADERS = \
 	nsUnicharUtils.h \
 	$(NULL)
 
 EXPORTS = \
 	nsCompressedCharMap.h \
 	nsBidiUtils.h \
+	nsUnicodeProperties.h \
+	nsUnicodeScriptCodes.h \
 	$(NULL)
 
 CPPSRCS	= \
 	nsUnicharUtils.cpp \
 	nsBidiUtils.cpp \
+	nsUnicodeProperties.cpp \
 	$(NULL)
 
 FORCE_STATIC_LIB = 1
 USE_STATIC_LIBS = 1
 
 LOCAL_INCLUDES += -I$(srcdir)/../src
 
 include $(topsrcdir)/config/rules.mk
--- a/intl/unicharutil/util/nsUnicharUtils.cpp
+++ b/intl/unicharutil/util/nsUnicharUtils.cpp
@@ -40,180 +40,59 @@
 
 #include "nsUnicharUtils.h"
 #include "nsUnicharUtilCIID.h"
 
 #include "nsCRT.h"
 #include "nsICaseConversion.h"
 #include "nsServiceManagerUtils.h"
 #include "nsXPCOMStrings.h"
-#include "casetable.h"
 #include "nsUTF8Utils.h"
+#include "nsUnicodeProperties.h"
 #include "nsHashKeys.h"
 
-#include <ctype.h>
-
-// For gUpperToTitle
-enum {
-  kUpperIdx =0,
-  kTitleIdx
-};
-
-// For gUpperToTitle
-enum {
-  kLowIdx =0,
-  kSizeEveryIdx,
-  kDiffIdx
+// We map x -> x, except for upper-case letters,
+// which we map to their lower-case equivalents.
+static const PRUint8 gASCIIToLower [128] = {
+    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+    0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+    0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+    0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+    0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
+    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+    0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
+    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
 };
 
 #define IS_ASCII(u)       ((u) < 0x80)
-#define IS_ASCII_UPPER(u) (('A' <= (u)) && ( (u) <= 'Z' ))
-#define IS_ASCII_LOWER(u) (('a' <= (u)) && ( (u) <= 'z'))
+#define IS_ASCII_UPPER(u) (('A' <= (u)) && ((u) <= 'Z'))
+#define IS_ASCII_LOWER(u) (('a' <= (u)) && ((u) <= 'z'))
 #define IS_ASCII_ALPHA(u) (IS_ASCII_UPPER(u) || IS_ASCII_LOWER(u))
-#define IS_ASCII_SPACE(u) ( ' ' == (u) )
-
-#define IS_NOCASE_CHAR(u)  (0==(1&(gCaseBlocks[(u)>>13]>>(0x001F&((u)>>8)))))
-
-// Size of Tables
-
-// Changing these numbers may break UTF-8 caching.  Be careful!
-#define CASE_MAP_CACHE_SIZE 0x100
-#define CASE_MAP_CACHE_MASK 0xFF
-
-struct nsCompressedMap {
-  const PRUnichar *mTable;
-  PRUint32 mSize;
-  PRUint32 mCache[CASE_MAP_CACHE_SIZE];
-  PRUint32 mLastBase;
-
-  PRUnichar Map(PRUnichar aChar)
-  {
-    // We don't need explicit locking here since the cached values are int32s,
-    // which are read and written atomically.  The following code is threadsafe
-    // because we never access bits from mCache directly -- we always first
-    // read the entire entry into a local variable and then mask off the bits
-    // we're interested in.
-
-    // Check the 256-byte cache first and bail with our answer if we can.
-    PRUint32 cachedData = mCache[aChar & CASE_MAP_CACHE_MASK];
-    if (aChar == ((cachedData >> 16) & 0x0000FFFF))
-      return cachedData & 0x0000FFFF;
-
-    // Now try the last index we looked up, storing it into a local variable
-    // for thread-safety.
-    PRUint32 base = mLastBase;
-    PRUnichar res = 0;
-
-    // Does this character fit in the slot?
-    if ((aChar <= ((mTable[base+kSizeEveryIdx] >> 8) +
-                   mTable[base+kLowIdx])) &&
-        (mTable[base+kLowIdx] <= aChar)) {
-
-      // This character uses the same base as our last lookup, so the
-      // conversion is easy.
-      if (((mTable[base+kSizeEveryIdx] & 0x00FF) > 0) &&
-          (0 != ((aChar - mTable[base+kLowIdx]) % 
-                 (mTable[base+kSizeEveryIdx] & 0x00FF))))
-      {
-        res = aChar;
-      } else {
-        res = aChar + mTable[base+kDiffIdx];
-      }
-
-    } else {
-      // Do the full lookup.
-      res = this->Lookup(0, mSize/2, mSize-1, aChar);
-    }
+#define IS_ASCII_SPACE(u) (' ' == (u))
 
-    // Cache the result and return.
-    mCache[aChar & CASE_MAP_CACHE_MASK] =
-        ((aChar << 16) & 0xFFFF0000) | (0x0000FFFF & res);
-    return res;
-  }
-
-  // Takes as arguments the left bound, middle, right bound, and character to
-  // search for.  Executes a binary search.
-  PRUnichar Lookup(PRUint32 l,
-                   PRUint32 m,
-                   PRUint32 r,
-                   PRUnichar aChar)
-  {
-    PRUint32 base = m*3; // Every line in the table is 3 units wide.
-
-    // Is aChar past the top of the current table entry?  (The upper byte of
-    // the 'every' entry contains the offset to the end of this entry.)
-    if (aChar > ((mTable[base+kSizeEveryIdx] >> 8) + 
-                  mTable[base+kLowIdx])) 
-    {
-      if (l > m || l == r)
-        return aChar;
-      // Advance one round.
-      PRUint32 newm = (m+r+1)/2;
-      if (newm == m)
-        newm++;
-      return this->Lookup(m+1, newm, r, aChar);
-
-    // Is aChar below the bottom of the current table entry?
-    } else if (mTable[base+kLowIdx] > aChar) {
-      if (r < m || l == r)
-        return aChar;
-      // Advance one round
-      PRUint32 newm = (l+m-1)/2;
-      if(newm == m)
-        newm++;
-      return this->Lookup(l, newm, m-1, aChar);
-
-    // We've found the entry aChar should live in.
-    } else {
-      // Determine if aChar falls in a gap.  (The lower byte of the 'every'
-      // entry contains n for which every nth character from the base is a
-      // character of interest.)
-      if (((mTable[base+kSizeEveryIdx] & 0x00FF) > 0) && 
-          (0 != ((aChar - mTable[base+kLowIdx]) % 
-                 (mTable[base+kSizeEveryIdx] & 0x00FF))))
-      {
-        return aChar;
-      }
-      // If aChar doesn't fall in the gap, cache and convert.
-      mLastBase = base;
-      return aChar + mTable[base+kDiffIdx];
-    }
-  }
-};
-
-static nsCompressedMap gUpperMap = {
-  reinterpret_cast<const PRUnichar*>(&gToUpper[0]),
-  gToUpperItems
-};
-
-static nsCompressedMap gLowerMap = {
-  reinterpret_cast<const PRUnichar*>(&gToLower[0]),
-  gToLowerItems
-};
-
-// We want ToLowerCase(PRUnichar) and ToLowerCaseASCII(PRUnichar) to be fast
+// We want ToLowerCase(PRUint32) and ToLowerCaseASCII(PRUint32) to be fast
 // when they're called from within the case-insensitive comparators, so we
 // define inlined versions.
-static NS_ALWAYS_INLINE PRUnichar
-ToLowerCase_inline(PRUnichar aChar)
+static NS_ALWAYS_INLINE PRUint32
+ToLowerCase_inline(PRUint32 aChar)
 {
   if (IS_ASCII(aChar)) {
     return gASCIIToLower[aChar];
-  } else if (IS_NOCASE_CHAR(aChar)) {
-     return aChar;
   }
 
-  return gLowerMap.Map(aChar);
+  return mozilla::unicode::GetLowercase(aChar);
 }
 
-static NS_ALWAYS_INLINE PRUnichar
-ToLowerCaseASCII_inline(const PRUnichar aChar)
+static NS_ALWAYS_INLINE PRUint32
+ToLowerCaseASCII_inline(const PRUint32 aChar)
 {
-  if (IS_ASCII(aChar))
+  if (IS_ASCII(aChar)) {
     return gASCIIToLower[aChar];
+  }
+
   return aChar;
 }
 
 void
 ToLowerCase(nsAString& aString)
 {
   PRUnichar *buf = aString.BeginWriting();
   ToLowerCase(buf, buf, aString.Length());
@@ -226,18 +105,18 @@ ToLowerCase(const nsAString& aSource,
   const PRUnichar *in;
   PRUnichar *out;
   PRUint32 len = NS_StringGetData(aSource, &in);
   NS_StringGetMutableData(aDest, len, &out);
   NS_ASSERTION(out, "Uh...");
   ToLowerCase(in, out, len);
 }
 
-PRUnichar
-ToLowerCaseASCII(const PRUnichar aChar)
+PRUint32
+ToLowerCaseASCII(const PRUint32 aChar)
 {
   return ToLowerCaseASCII_inline(aChar);
 }
 
 void
 ToUpperCase(nsAString& aString)
 {
   PRUnichar *buf = aString.BeginWriting();
@@ -285,16 +164,18 @@ nsASCIICaseInsensitiveStringComparator::
 {
   if (lLength != rLength) {
     if (lLength > rLength)
       return 1;
     return -1;
   }
 
   while (rLength) {
+    // we don't care about surrogates here, because we're only
+    // lowercasing the ASCII range
     PRUnichar l = *lhs++;
     PRUnichar r = *rhs++;
     if (l != r) {
       l = ToLowerCaseASCII_inline(l);
       r = ToLowerCaseASCII_inline(r);
 
       if (l > r)
         return 1;
@@ -304,96 +185,109 @@ nsASCIICaseInsensitiveStringComparator::
     rLength--;
   }
 
   return 0;
 }
 
 #endif // MOZILLA_INTERNAL_API
 
-PRUnichar
-ToLowerCase(PRUnichar aChar)
+PRUint32
+ToLowerCase(PRUint32 aChar)
 {
   return ToLowerCase_inline(aChar);
 }
 
 void
 ToLowerCase(const PRUnichar *aIn, PRUnichar *aOut, PRUint32 aLen)
 {
   for (PRUint32 i = 0; i < aLen; i++) {
-    aOut[i] = ToLowerCase(aIn[i]);
+    PRUint32 ch = aIn[i];
+    if (NS_IS_HIGH_SURROGATE(ch) && i < aLen - 1 &&
+        NS_IS_LOW_SURROGATE(aIn[i + 1])) {
+      ch = mozilla::unicode::GetLowercase(SURROGATE_TO_UCS4(ch, aIn[i + 1]));
+      NS_ASSERTION(!IS_IN_BMP(ch), "case mapping crossed BMP/SMP boundary!");
+      aOut[i++] = H_SURROGATE(ch);
+      aOut[i] = L_SURROGATE(ch);
+      continue;
+    }
+    aOut[i] = ToLowerCase(ch);
   }
 }
 
-PRUnichar
-ToUpperCase(PRUnichar aChar)
+PRUint32
+ToUpperCase(PRUint32 aChar)
 {
   if (IS_ASCII(aChar)) {
-    if (IS_ASCII_LOWER(aChar))
+    if (IS_ASCII_LOWER(aChar)) {
       return aChar - 0x20;
-    else
-      return aChar;
-  } else if (IS_NOCASE_CHAR(aChar)) {
+    }
     return aChar;
   }
 
-  return gUpperMap.Map(aChar);
+  return mozilla::unicode::GetUppercase(aChar);
 }
 
 void
 ToUpperCase(const PRUnichar *aIn, PRUnichar *aOut, PRUint32 aLen)
 {
   for (PRUint32 i = 0; i < aLen; i++) {
-    aOut[i] = ToUpperCase(aIn[i]);
+    PRUint32 ch = aIn[i];
+    if (NS_IS_HIGH_SURROGATE(ch) && i < aLen - 1 &&
+        NS_IS_LOW_SURROGATE(aIn[i + 1])) {
+      ch = mozilla::unicode::GetUppercase(SURROGATE_TO_UCS4(ch, aIn[i + 1]));
+      NS_ASSERTION(!IS_IN_BMP(ch), "case mapping crossed BMP/SMP boundary!");
+      aOut[i++] = H_SURROGATE(ch);
+      aOut[i] = L_SURROGATE(ch);
+      continue;
+    }
+    aOut[i] = ToUpperCase(ch);
   }
 }
 
-PRUnichar
-ToTitleCase(PRUnichar aChar)
+PRUint32
+ToTitleCase(PRUint32 aChar)
 {
   if (IS_ASCII(aChar)) {
     return ToUpperCase(aChar);
-  } else if (IS_NOCASE_CHAR(aChar)) {
-    return aChar;
   }
 
-  // First check for uppercase characters whose titlecase mapping is
-  // different, like U+01F1 DZ: they must remain unchanged.
-  if (0x01C0 == (aChar & 0xFFC0)) {
-    for (PRUint32 i = 0; i < gUpperToTitleItems; i++) {
-      if (aChar == gUpperToTitle[(i*2)+kUpperIdx]) {
-        return aChar;
-      }
-    }
-  }
-
-  PRUnichar upper = gUpperMap.Map(aChar);
-
-  if (0x01C0 == ( upper & 0xFFC0)) {
-    for (PRUint32 i = 0 ; i < gUpperToTitleItems; i++) {
-      if (upper == gUpperToTitle[(i*2)+kUpperIdx]) {
-         return gUpperToTitle[(i*2)+kTitleIdx];
-      }
-    }
-  }
-
-  return upper;
+  return mozilla::unicode::GetTitlecaseForLower(aChar);
 }
 
 PRInt32
 CaseInsensitiveCompare(const PRUnichar *a,
                        const PRUnichar *b,
                        PRUint32 len)
 {
   NS_ASSERTION(a && b, "Do not pass in invalid pointers!");
 
   if (len) {
     do {
-      PRUnichar c1 = *a++;
-      PRUnichar c2 = *b++;
+      PRUint32 c1 = *a++;
+      PRUint32 c2 = *b++;
+
+      // Unfortunately, we need to check for surrogates BEFORE we check
+      // for equality, because we could have identical high surrogates
+      // but non-identical characters, so we can't just skip them
+
+      // If c1 isn't a surrogate, we don't bother to check c2;
+      // in the case where it _is_ a surrogate, we're definitely going to get
+      // a mismatch, and don't need to interpret and lowercase it
+
+      if (NS_IS_HIGH_SURROGATE(c1) && len > 1 && NS_IS_LOW_SURROGATE(*a)) {
+        c1 = SURROGATE_TO_UCS4(c1, *a++);
+        if (NS_IS_HIGH_SURROGATE(c2) && NS_IS_LOW_SURROGATE(*b)) {
+          c2 = SURROGATE_TO_UCS4(c1, *b++);
+        }
+        // If c2 wasn't a surrogate, decrementing len means we'd stop
+        // short of the end of string b, but that doesn't actually matter
+        // because we're going to find a mismatch and return early
+        --len;
+      }
 
       if (c1 != c2) {
         c1 = ToLowerCase_inline(c1);
         c2 = ToLowerCase_inline(c2);
         if (c1 != c2) {
           if (c1 < c2) {
             return -1;
           }
@@ -429,50 +323,50 @@ GetLowerUTF8Codepoint(const char* aStr, 
     //  110XXXXX 10XXXXXX.
     // This is definitely in the BMP, so we can store straightaway into a
     // PRUint16.
 
     PRUint16 c;
     c  = (str[0] & 0x1F) << 6;
     c += (str[1] & 0x3F);
 
-    if (!IS_NOCASE_CHAR(c))
-      c = gLowerMap.Map(c);
+    // we don't go through ToLowerCase here, because we know this isn't
+    // an ASCII character so the ASCII fast-path there is useless
+    c = mozilla::unicode::GetLowercase(c);
 
     *aNext = aStr + 2;
     return c;
   }
   if (UTF8traits::is3byte(str[0]) && NS_LIKELY(aStr + 2 < aEnd)) {
     // It's a three-byte sequence, so it looks like
     //  1110XXXX 10XXXXXX 10XXXXXX.
     // This will just barely fit into 16-bits, so store into a PRUint16.
 
     PRUint16 c;
     c  = (str[0] & 0x0F) << 12;
     c += (str[1] & 0x3F) << 6;
     c += (str[2] & 0x3F);
 
-    if (!IS_NOCASE_CHAR(c))
-      c = gLowerMap.Map(c);
+    c = mozilla::unicode::GetLowercase(c);
 
     *aNext = aStr + 3;
     return c;
   }
   if (UTF8traits::is4byte(str[0]) && NS_LIKELY(aStr + 3 < aEnd)) {
     // It's a four-byte sequence, so it looks like
     //   11110XXX 10XXXXXX 10XXXXXX 10XXXXXX.
-    // Unless this is an overlong sequence, the codepoint it encodes definitely
-    // isn't in the BMP, so we don't bother trying to convert it to lower-case.
 
     PRUint32 c;
     c  = (str[0] & 0x07) << 18;
     c += (str[1] & 0x3F) << 12;
     c += (str[2] & 0x3F) << 6;
     c += (str[3] & 0x3F);
 
+    c = mozilla::unicode::GetLowercase(c);
+
     *aNext = aStr + 4;
     return c;
   }
 
   // Hm, we don't understand this sequence.
   return -1;
 }
 
--- a/intl/unicharutil/util/nsUnicharUtils.h
+++ b/intl/unicharutil/util/nsUnicharUtils.h
@@ -51,28 +51,28 @@
    (0xff00u <= (u) && (u) <= 0xffefu) )
 
 void ToLowerCase(nsAString&);
 void ToUpperCase(nsAString&);
 
 void ToLowerCase(const nsAString& aSource, nsAString& aDest);
 void ToUpperCase(const nsAString& aSource, nsAString& aDest);
 
-PRUnichar ToLowerCase(PRUnichar);
-PRUnichar ToUpperCase(PRUnichar);
-PRUnichar ToTitleCase(PRUnichar);
+PRUint32 ToLowerCase(PRUint32);
+PRUint32 ToUpperCase(PRUint32);
+PRUint32 ToTitleCase(PRUint32);
 
 void ToLowerCase(const PRUnichar*, PRUnichar*, PRUint32);
 void ToUpperCase(const PRUnichar*, PRUnichar*, PRUint32);
 
-inline bool IsUpperCase(PRUnichar c) {
+inline bool IsUpperCase(PRUint32 c) {
   return ToLowerCase(c) != c;
 }
 
-inline bool IsLowerCase(PRUnichar c) {
+inline bool IsLowerCase(PRUint32 c) {
   return ToUpperCase(c) != c;
 }
 
 #ifdef MOZILLA_INTERNAL_API
 
 class nsCaseInsensitiveStringComparator : public nsStringComparator
 {
 public:
rename from intl/unicharutil/src/nsUnicodeProperties.cpp
rename to intl/unicharutil/util/nsUnicodeProperties.cpp
--- a/intl/unicharutil/src/nsUnicodeProperties.cpp
+++ b/intl/unicharutil/util/nsUnicodeProperties.cpp
@@ -30,26 +30,26 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
+#define HB_DONT_DEFINE_STDINT  1
+
 #include "nsUnicodeProperties.h"
 #include "nsUnicodeScriptCodes.h"
 #include "nsUnicodePropertyData.cpp"
 
 #include "mozilla/Util.h"
 #include "nsMemory.h"
 #include "nsCharTraits.h"
 
-#include "harfbuzz/hb-unicode.h"
-
 #define UNICODE_BMP_LIMIT 0x10000
 #define UNICODE_LIMIT     0x110000
 
 namespace mozilla {
 
 namespace unicode {
 
 /*
@@ -132,70 +132,66 @@ GetMirroredChar(PRUint32 aCh)
 
 PRUint8
 GetCombiningClass(PRUint32 aCh)
 {
     if (aCh < UNICODE_BMP_LIMIT) {
         return sCClassValues[sCClassPages[0][aCh >> kCClassCharBits]]
                             [aCh & ((1 << kCClassCharBits) - 1)];
     }
-    if (aCh < UNICODE_LIMIT) {
+    if (aCh < (kCClassMaxPlane + 1) * 0x10000) {
         return sCClassValues[sCClassPages[sCClassPlanes[(aCh >> 16) - 1]]
                                          [(aCh & 0xffff) >> kCClassCharBits]]
                             [aCh & ((1 << kCClassCharBits) - 1)];
     }
-    NS_NOTREACHED("invalid Unicode character!");
     return 0;
 }
 
 PRUint8
 GetGeneralCategory(PRUint32 aCh)
 {
     if (aCh < UNICODE_BMP_LIMIT) {
         return sCatEAWValues[sCatEAWPages[0][aCh >> kCatEAWCharBits]]
                             [aCh & ((1 << kCatEAWCharBits) - 1)].mCategory;
     }
-    if (aCh < UNICODE_LIMIT) {
+    if (aCh < (kCatEAWMaxPlane + 1) * 0x10000) {
         return sCatEAWValues[sCatEAWPages[sCatEAWPlanes[(aCh >> 16) - 1]]
                                          [(aCh & 0xffff) >> kCatEAWCharBits]]
                             [aCh & ((1 << kCatEAWCharBits) - 1)].mCategory;
     }
-    NS_NOTREACHED("invalid Unicode character!");
     return PRUint8(HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED);
 }
 
 PRUint8
 GetEastAsianWidth(PRUint32 aCh)
 {
     if (aCh < UNICODE_BMP_LIMIT) {
         return sCatEAWValues[sCatEAWPages[0][aCh >> kCatEAWCharBits]]
                             [aCh & ((1 << kCatEAWCharBits) - 1)].mEAW;
     }
-    if (aCh < UNICODE_LIMIT) {
+    if (aCh < (kCatEAWMaxPlane + 1) * 0x10000) {
         return sCatEAWValues[sCatEAWPages[sCatEAWPlanes[(aCh >> 16) - 1]]
                                          [(aCh & 0xffff) >> kCatEAWCharBits]]
                             [aCh & ((1 << kCatEAWCharBits) - 1)].mEAW;
     }
-    NS_NOTREACHED("invalid Unicode character!");
     return 0;
 }
 
 PRInt32
 GetScriptCode(PRUint32 aCh)
 {
     if (aCh < UNICODE_BMP_LIMIT) {
         return sScriptValues[sScriptPages[0][aCh >> kScriptCharBits]]
                             [aCh & ((1 << kScriptCharBits) - 1)];
     }
-    if (aCh < UNICODE_LIMIT) {
+    if (aCh < (kScriptMaxPlane + 1) * 0x10000) {
         return sScriptValues[sScriptPages[sScriptPlanes[(aCh >> 16) - 1]]
                                          [(aCh & 0xffff) >> kScriptCharBits]]
                             [aCh & ((1 << kScriptCharBits) - 1)];
     }
-    NS_NOTREACHED("invalid Unicode character!");
     return MOZ_SCRIPT_UNKNOWN;
 }
 
 PRUint32
 GetScriptTagForCode(PRInt32 aScriptCode)
 {
     // this will safely return 0 for negative script codes, too :)
     if (PRUint32(aScriptCode) > ArrayLength(sScriptCodeToTag)) {
@@ -210,16 +206,80 @@ GetHangulSyllableType(PRUint32 aCh)
     // all Hangul chars are in plane 0
     if (aCh < UNICODE_BMP_LIMIT) {
         return HSType(sHangulValues[sHangulPages[0][aCh >> kHangulCharBits]]
                                    [aCh & ((1 << kHangulCharBits) - 1)]);
     }
     return HST_NONE;
 }
 
+static inline PRUint32
+GetCaseMapValue(PRUint32 aCh)
+{
+    if (aCh < UNICODE_BMP_LIMIT) {
+        return sCaseMapValues[sCaseMapPages[0][aCh >> kCaseMapCharBits]]
+                             [aCh & ((1 << kCaseMapCharBits) - 1)];
+    }
+    if (aCh < (kCaseMapMaxPlane + 1) * 0x10000) {
+        return sCaseMapValues[sCaseMapPages[sCaseMapPlanes[(aCh >> 16) - 1]]
+                                           [(aCh & 0xffff) >> kCaseMapCharBits]]
+                             [aCh & ((1 << kCaseMapCharBits) - 1)];
+    }
+    return 0;
+}
+
+PRUint32
+GetUppercase(PRUint32 aCh)
+{
+    PRUint32 mapValue = GetCaseMapValue(aCh);
+    if (mapValue & (kLowerToUpper | kTitleToUpper)) {
+        return aCh ^ (mapValue & kCaseMapCharMask);
+    }
+    if (mapValue & kLowerToTitle) {
+        return GetUppercase(aCh ^ (mapValue & kCaseMapCharMask));
+    }
+    return aCh;
+}
+
+PRUint32
+GetLowercase(PRUint32 aCh)
+{
+    PRUint32 mapValue = GetCaseMapValue(aCh);
+    if (mapValue & kUpperToLower) {
+        return aCh ^ (mapValue & kCaseMapCharMask);
+    }
+    if (mapValue & kTitleToUpper) {
+        return GetLowercase(aCh ^ (mapValue & kCaseMapCharMask));
+    }
+    return aCh;
+}
+
+PRUint32
+GetTitlecaseForLower(PRUint32 aCh)
+{
+    PRUint32 mapValue = GetCaseMapValue(aCh);
+    if (mapValue & (kLowerToTitle | kLowerToUpper)) {
+        return aCh ^ (mapValue & kCaseMapCharMask);
+    }
+    return aCh;
+}
+
+PRUint32
+GetTitlecaseForAll(PRUint32 aCh)
+{
+    PRUint32 mapValue = GetCaseMapValue(aCh);
+    if (mapValue & (kLowerToTitle | kLowerToUpper)) {
+        return aCh ^ (mapValue & kCaseMapCharMask);
+    }
+    if (mapValue & kUpperToLower) {
+        return GetTitlecaseForLower(aCh ^ (mapValue & kCaseMapCharMask));
+    }
+    return aCh;
+}
+
 bool
 IsClusterExtender(PRUint32 aCh, PRUint8 aCategory)
 {
     return ((aCategory >= HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK &&
              aCategory <= HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) ||
             (aCh >= 0x200c && aCh <= 0x200d) || // ZWJ, ZWNJ
             (aCh >= 0xff9e && aCh <= 0xff9f));  // katakana sound marks
 }
rename from intl/unicharutil/public/nsUnicodeProperties.h
rename to intl/unicharutil/util/nsUnicodeProperties.h
--- a/intl/unicharutil/public/nsUnicodeProperties.h
+++ b/intl/unicharutil/util/nsUnicodeProperties.h
@@ -77,16 +77,24 @@ enum HSType {
     HST_V    = 0x02,
     HST_T    = 0x04,
     HST_LV   = 0x03,
     HST_LVT  = 0x07
 };
 
 HSType GetHangulSyllableType(PRUint32 aCh);
 
+// Case mappings for the full Unicode range;
+// note that it may be worth testing for ASCII chars and taking
+// a separate fast-path before calling these, in perf-critical places
+PRUint32 GetUppercase(PRUint32 aCh);
+PRUint32 GetLowercase(PRUint32 aCh);
+PRUint32 GetTitlecaseForLower(PRUint32 aCh); // maps LC to titlecase, UC unchanged
+PRUint32 GetTitlecaseForAll(PRUint32 aCh); // maps both UC and LC to titlecase
+
 enum ShapingType {
     SHAPING_DEFAULT   = 0x0001,
     SHAPING_ARABIC    = 0x0002,
     SHAPING_HEBREW    = 0x0004,
     SHAPING_HANGUL    = 0x0008,
     SHAPING_MONGOLIAN = 0x0010,
     SHAPING_INDIC     = 0x0020,
     SHAPING_THAI      = 0x0040
rename from intl/unicharutil/src/nsUnicodePropertyData.cpp
rename to intl/unicharutil/util/nsUnicodePropertyData.cpp
--- a/intl/unicharutil/src/nsUnicodePropertyData.cpp
+++ b/intl/unicharutil/util/nsUnicodePropertyData.cpp
@@ -36,17 +36,17 @@
  *
  * Derived from the Unicode Character Database by genUnicodePropertyData.pl
  *
  * For Unicode terms of use, see http://www.unicode.org/terms_of_use.html
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
- * Created on Thu Feb 23 13:15:51 2012 from UCD data files with version info:
+ * Created on Mon Mar  5 08:11:49 2012 from UCD data files with version info:
  *
 
 # Date: 2012-01-26, 22:03:00 GMT [KW]
 #
 # Unicode Character Database
 # Copyright (c) 1991-2012 Unicode, Inc.
 # For terms of use, see http://www.unicode.org/terms_of_use.html
 #
@@ -178,16 +178,17 @@ static const PRUint32 sScriptCodeToTag[]
   HB_TAG('M','e','r','c'),
   HB_TAG('M','e','r','o'),
   HB_TAG('P','l','r','d'),
   HB_TAG('S','h','r','d'),
   HB_TAG('S','o','r','a'),
   HB_TAG('T','a','k','r')
 };
 
+#define kScriptMaxPlane  16
 #define kScriptIndexBits 10
 #define kScriptCharBits  6
 static const PRUint8 sScriptPlanes[16] = {1,2,3,3,3,3,3,3,3,3,3,3,3,4,3,3};
 
 static const PRUint16 sScriptPages[5][1024] = {
   {0,1,2,3,4,4,4,4,4,4,5,6,7,8,9,10,11,11,12,11,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,57,58,59,60,60,60,60,61,62,63,64,65,66,67,68,69,69,69,69,69,69,69,69,69,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,87,94,95,96,97,98,4,4,4,4,99,100,101,102,103,104,105,106,107,108,109,0,0,0,0,0,0,0,0,110,111,112,0,0,0,0,0,0,0,0,0,0,113,0,0,0,114,114,114,114,0,0,0,0,0,0,0,0,0,115,87,87,116,117,118,119,120,121,122,123,124,87,125,126,127,127,127,128,129,130,131,132,133,60,134,135,136,137,0,138,139,140,0,0,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,141,0,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,142,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,144,145,146,146,146,146,147,11,148,149,150,4,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,87,87,166,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,167,168,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,127,127,127,127,127,169,127,170,171,172,19,173,19,19,19,19,174,175,176,177,178,179,19,180,181,182,183,184},
   {185,186,187,188,189,190,191,192,87,87,193,194,195,196,197,198,199,200,201,87,87,87,87,87,87,87,87,87,87,87,87,87,202,203,87,87,204,87,205,87,206,207,87,87,208,209,87,87,210,211,87,87,87,87,87,87,87,212,87,87,87,87,87,87,213,214,215,216,217,218,219,220,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,221,222,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,223,223,223,223,223,223,223,223,223,223,223,223,223,224,87,87,223,225,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,227,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,228,228,228,228,228,228,228,228,229,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,230,231,232,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,233,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,0,0,0,234,235,236,237,238,190,239,87,87,0,240,87,87,0,241,242,243,244,245,0,0,0,0,246,0,0,0,0,247,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,248,249,250,251,87,87,87,87,252,0,253,254,255,252,256,257,258,259,87,87,260,261,262,263,264,265,0,266,267,268,87,269,0,270,0,271,0,110,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87},
   {127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,272,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,273,127,127,127,274,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,127,127,127,127,127,127,127,127,274,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87},
@@ -470,24 +471,24 @@ static const PRUint8 sScriptValues[277][
   {0,0,0,0,0,0,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61},
   {17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61},
   {17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,61,61,61,61,61,61,61,61,61,61,61},
   {17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61},
   {61,0,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61}
 };
 
+#define kCClassMaxPlane  1
 #define kCClassIndexBits 10
 #define kCClassCharBits  6
-static const PRUint8 sCClassPlanes[16] = {1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2};
+static const PRUint8 sCClassPlanes[1] = {1};
 
-static const PRUint8 sCClassPages[3][1024] = {
+static const PRUint8 sCClassPages[2][1024] = {
   {0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0,0,0,3,0,0,0,4,5,6,7,0,8,9,10,0,11,12,13,0,14,15,16,15,17,15,17,15,17,15,17,0,17,0,18,15,17,0,17,0,19,20,21,22,23,24,25,26,27,28,0,29,0,0,0,0,0,0,0,0,0,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,32,0,0,33,0,34,0,0,0,35,36,0,0,37,38,39,40,41,0,0,42,0,0,0,43,0,0,0,0,0,0,0,0,0,0,0,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,0,46,0,47,0,0,0,0,0,0,0,0,48,0,49,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
 };
 
 static const PRUint8 sCClassValues[72][64] = {
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,230,232,220,220,220,220,232,216,220,220,220,220,220,202,202,220,220,220,220,202,202,220,220,220,220,220,220,220,220,220,220,220,1,1,1,1,1,220,220,220,220,230,230,230},
   {230,230,230,230,230,240,230,220,220,220,230,230,230,220,220,0,230,230,230,220,220,220,220,230,232,220,220,230,233,234,234,233,234,234,233,230,230,230,230,230,230,230,230,230,230,230,230,230,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,230,230,230,230,230,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
   {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,220,230,230,230,230,220,230,230,230,222,220,230,230,230,230,230,230,220,220,220,220,220,220,230,230,220,230,230,222,228,230,10,11,12,13,14,15,16,17,18,19,19,20,21,22,0,23},
@@ -573,16 +574,17 @@ static const PRUint16 sDistantMirrors[] 
   0x2298,
   0x2215,
   0x22A6,
   0x22A9,
   0x22A8,
   0x22AB
 };
 
+#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kCatEAWIndexBits 9
 #define kCatEAWCharBits  7
 static const PRUint8 sCatEAWPlanes[16] = {1,2,3,4,4,4,4,4,4,4,4,4,4,5,6,6};
 
 static const PRUint8 sCatEAWPages[7][512] = {
   {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,41,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,78,79,80,79,79,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,89,89,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,98,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,99,100,97,97,97,97,97,97,97,97,101,41,41,102,103,104,105,106,107,108,109,110,111,112,113,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,114,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,116,97,97,117,118,119,120,41,41,121,122,123,124,125,126},
   {127,128,129,130,82,131,132,133,134,135,82,82,82,82,82,82,136,82,137,138,139,82,140,82,141,82,82,82,142,82,82,82,143,144,145,146,82,82,82,82,82,82,82,82,82,147,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,41,41,41,41,41,41,148,82,149,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,41,41,41,41,41,41,41,41,150,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,41,41,41,41,151,82,82,82,82,82,82,82,82,82,152,153,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,154,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,78,155,156,157,158,82,159,82,160,161,162,163,164,165,166,167,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,168,169,82,82,170,171,172,173,174,82,175,176,177,178,179,180,181,182,183,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82,82},
   {97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,184,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,97,185,97,186,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,97,97,97,97,186,187,187,187,187,187,187,187,187,187,187,188},
@@ -814,16 +817,17 @@ static const struct {
   {{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2}},
   {{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{5,2},{0,2},{0,2}},
   {{0,2},{3,1},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1},{3,1}},
   {{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12}},
   {{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,12},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2},{0,2}},
   {{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,3},{0,2},{0,2}}
 };
 
+#define kHangulMaxPlane  0
 #define kHangulIndexBits 10
 #define kHangulCharBits  6
 static const PRUint8 sHangulPages[1][1024] = {
   {0,0,0,0,0,0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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
+};
+
+static const PRUint32 sCaseMapValues[69][32] = {
+  {0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x00000000,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x00000000,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x10000329,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x00000000,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x00000000},
+  {0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x00000000,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000187},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000159,0x10000178,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x00000000,0x40000003,0x10000003,0x40000007,0x10000007,0x40000003,0x10000003,0x4000007f},
+  {0x1000007f,0x40000003,0x10000003,0x40000007,0x10000007,0x40000003,0x10000003,0x4000000f,0x1000000f,0x00000000,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000187,0x40000003,0x10000003,0x40000007,0x10000007,0x40000003,0x10000003,0x1000012c},
+  {0x100003c3,0x400003d2,0x40000001,0x10000001,0x40000001,0x10000001,0x400003d2,0x4000000f,0x1000000f,0x400003df,0x400003dd,0x40000007,0x10000007,0x00000000,0x40000053,0x400003d6,0x400003cb,0x40000003,0x10000003,0x400003f3,0x400003f7,0x10000063,0x400003ff,0x400003ff,0x40000001,0x10000001,0x100003a7,0x00000000,0x400003f3,0x400003ef,0x100003be,0x400003ea},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000326,0x4000000f,0x1000000f,0x4000032a,0x00000000,0x00000000,0x40000001,0x10000001,0x40000326,0x4000001f,0x1000001f,0x4000033b,0x40000339,0x40000007,0x10000007,0x40000003,0x10000003,0x40000325,0x40000001,0x10000001,0x00000000,0x00000000,0x40000001,0x10000001,0x00000000,0x10000048},
+  {0x00000000,0x00000000,0x00000000,0x00000000,0x40000002,0x80000001,0x20000003,0x4000000e,0x8000000f,0x20000001,0x40000006,0x80000001,0x20000007,0x40000003,0x10000003,0x4000001f,0x1000001f,0x40000003,0x10000003,0x40000007,0x10000007,0x40000003,0x10000003,0x4000000f,0x1000000f,0x40000003,0x10000003,0x40000007,0x10000007,0x10000053,0x40000001,0x10000001},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x00000000,0x40000002,0x80000003,0x20000001,0x40000001,0x10000001,0x40000063,0x40000048,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001},
+  {0x400003be,0x00000000,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x40002e5f,0x40000007,0x10000007,0x400003a7,0x40002e58,0x10002e41},
+  {0x10002e3f,0x40000003,0x10000003,0x400003c3,0x400000cd,0x400000c9,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x10002e3f,0x10002e3c,0x10002e22,0x100003d2,0x100003d2,0x00000000,0x100003df,0x100003dd,0x00000000,0x100003d6,0x00000000,0x100003cb,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x100003f3,0x00000000,0x00000000,0x100003f7,0x00000000,0x1000a5e8,0x1000a5cc,0x00000000,0x100003ff,0x100003ff,0x00000000,0x10002e09,0x00000000,0x00000000,0x00000000,0x100003f3,0x00000000,0x10002e1f,0x100003ef,0x00000000,0x00000000,0x100003ea,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x10002e19,0x00000000,0x00000000},
+  {0x10000326,0x00000000,0x00000000,0x1000032a,0x00000000,0x00000000,0x00000000,0x00000000,0x10000326,0x100000cd,0x1000033b,0x10000339,0x100000c9,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x10000325,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x100000dc,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x40000001,0x10000001,0x40000001,0x10000001,0x00000000,0x00000000,0x40000001,0x10000001,0x00000000,0x00000000,0x00000000,0x10000086,0x10000082,0x10000082,0x00000000,0x00000000},
+  {0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x4000002a,0x00000000,0x40000025,0x40000027,0x40000025,0x00000000,0x40000040,0x00000000,0x40000043,0x40000041,0x00000000,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020},
+  {0x40000060,0x40000060,0x00000000,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x1000002a,0x10000025,0x10000027,0x10000025,0x00000000,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020},
+  {0x10000060,0x10000060,0x10000061,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000040,0x10000043,0x10000041,0x40000018,0x10000042,0x10000049,0x00000000,0x00000000,0x00000000,0x10000073,0x10000076,0x10000018,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x1000006a,0x10000050,0x1000000b,0x00000000,0x4000004c,0x10000060,0x00000000,0x4000000f,0x1000000f,0x4000000b,0x40000001,0x10000001,0x00000000,0x40000086,0x40000082,0x40000082},
+  {0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020,0x40000020},
+  {0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020,0x10000020},
+  {0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050},
+  {0x40000001,0x10000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001},
+  {0x4000000f,0x40000003,0x10000003,0x40000007,0x10000007,0x40000003,0x10000003,0x4000000f,0x1000000f,0x40000003,0x10000003,0x40000007,0x10000007,0x40000003,0x10000003,0x1000000f,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050},
+  {0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x400000d0,0x400000d0,0x400000d0,0x400000d0,0x400000d0,0x400000d0,0x400000d0,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x00000000,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030},
+  {0x100000d0,0x100000d0,0x100000d0,0x100000d0,0x100000d0,0x100000d0,0x100000d0,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0,0x40003da0},
+  {0x40003de0,0x40003de0,0x40003de0,0x40003de0,0x40003de0,0x40003de0,0x00000000,0x40003de0,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x40003de0,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x1000ba04,0x00000000,0x00000000,0x00000000,0x1000311e,0x00000000,0x00000000},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x100000fb,0x00000000,0x00000000,0x40001e41,0x00000000},
+  {0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x00000000,0x00000000,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x00000000,0x00000000},
+  {0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008},
+  {0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x00000000,0x00000000,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x00000000,0x00000000,0x00000000,0x10000008,0x00000000,0x10000008,0x00000000,0x10000008,0x00000000,0x10000008,0x00000000,0x40000008,0x00000000,0x40000008,0x00000000,0x40000008,0x00000000,0x40000008},
+  {0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x100000ca,0x100000ca,0x100000ba,0x100000ba,0x100000be,0x100000be,0x100000ac,0x100000ac,0x10000080,0x10000080,0x10000090,0x10000090,0x10000086,0x10000086,0x00000000,0x00000000},
+  {0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x10000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x40000008,0x10000008,0x10000008,0x00000000,0x1000000f,0x00000000,0x00000000,0x00000000,0x00000000,0x40000008,0x40000008,0x400000ca,0x400000ca,0x4000000f,0x00000000,0x10001c27,0x00000000},
+  {0x00000000,0x00000000,0x00000000,0x1000000f,0x00000000,0x00000000,0x00000000,0x00000000,0x400000ba,0x400000ba,0x400000be,0x400000be,0x4000000f,0x00000000,0x00000000,0x00000000,0x10000008,0x10000008,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x40000008,0x40000008,0x400000ac,0x400000ac,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x10000008,0x10000008,0x00000000,0x00000000,0x00000000,0x10000009,0x00000000,0x00000000,0x40000008,0x40000008,0x40000090,0x40000090,0x40000009,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x1000000f,0x00000000,0x00000000,0x00000000,0x00000000,0x40000080,0x40000080,0x40000086,0x40000086,0x4000000f,0x00000000,0x00000000,0x00000000},
+  {0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x400022ef,0x00000000,0x00000000,0x00000000,0x40002141,0x400021ce,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x4000007c,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x1000007c,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x40000010,0x40000010,0x40000010,0x40000010,0x40000010,0x40000010,0x40000010,0x40000010,0x40000010,0x40000010,0x40000010,0x40000010,0x40000010,0x40000010,0x40000010,0x40000010,0x10000010,0x10000010,0x10000010,0x10000010,0x10000010,0x10000010,0x10000010,0x10000010,0x10000010,0x10000010,0x10000010,0x10000010,0x10000010,0x10000010,0x10000010,0x10000010},
+  {0x00000000,0x00000000,0x00000000,0x40000007,0x10000007,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x40000066,0x40000066,0x4000006a,0x4000006a,0x4000006e,0x4000006e,0x4000006a,0x4000006a,0x40000066,0x40000066},
+  {0x4000001a,0x4000001a,0x4000001e,0x4000001e,0x4000001a,0x4000001a,0x40000026,0x40000026,0x4000002a,0x4000002a,0x4000002e,0x4000002e,0x4000002a,0x4000002a,0x40000026,0x40000026,0x10000066,0x10000066,0x1000006a,0x1000006a,0x1000006e,0x1000006e,0x1000006a,0x1000006a,0x10000066,0x10000066,0x1000001a,0x1000001a,0x1000001e,0x1000001e,0x1000001a,0x1000001a},
+  {0x10000026,0x10000026,0x1000002a,0x1000002a,0x1000002e,0x1000002e,0x1000002a,0x1000002a,0x10000026,0x10000026,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000030,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050,0x40000050},
+  {0x40000070,0x40000070,0x40000070,0x40000070,0x40000070,0x40000070,0x40000070,0x40000070,0x40000070,0x40000070,0x40000070,0x40000070,0x40000070,0x40000070,0x40000070,0x00000000,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030,0x10000030},
+  {0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000050,0x10000070,0x10000070,0x10000070,0x10000070,0x10000070,0x10000070,0x10000070,0x10000070,0x10000070,0x10000070,0x10000070,0x10000070,0x10000070,0x10000070,0x10000070,0x00000000},
+  {0x40000001,0x10000001,0x40002e09,0x4000311e,0x40002e19,0x10002e5f,0x10002e58,0x4000000f,0x1000000f,0x40000003,0x10000003,0x40000007,0x10000007,0x40002e3c,0x40002e1f,0x40002e3f,0x40002e22,0x00000000,0x40000001,0x10000001,0x00000000,0x40000003,0x10000003,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x40002e41,0x40002e3f},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x40000007,0x10000007,0x40000003,0x10000003,0x00000000,0x00000000,0x00000000,0x40000001,0x10000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0,0x10003da0},
+  {0x10003de0,0x10003de0,0x10003de0,0x10003de0,0x10003de0,0x10003de0,0x00000000,0x10003de0,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x10003de0,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x00000000,0x00000000,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x00000000,0x00000000,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x40000003,0x10000003,0x40000007,0x10000007,0x4000ba04,0x40000001,0x10000001},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x00000000,0x00000000,0x00000000,0x40000007,0x10000007,0x4000a5e8,0x00000000,0x00000000,0x40000001,0x10000001,0x40000001,0x10000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x40000001,0x10000001,0x4000a5cc,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x00000000,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x40000060,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x00000000,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x10000060,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000},
+  {0x40000028,0x40000028,0x40000028,0x40000028,0x40000028,0x40000028,0x40000028,0x40000028,0x40000038,0x40000038,0x40000038,0x40000038,0x40000038,0x40000038,0x40000038,0x40000038,0x40000028,0x40000028,0x40000028,0x40000028,0x40000028,0x40000028,0x40000028,0x40000028,0x40000058,0x40000058,0x40000058,0x40000058,0x40000058,0x40000058,0x40000058,0x40000058},
+  {0x40000068,0x40000068,0x40000068,0x40000068,0x40000068,0x40000068,0x40000068,0x40000068,0x10000028,0x10000028,0x10000028,0x10000028,0x10000028,0x10000028,0x10000028,0x10000028,0x10000038,0x10000038,0x10000038,0x10000038,0x10000038,0x10000038,0x10000038,0x10000038,0x10000028,0x10000028,0x10000028,0x10000028,0x10000028,0x10000028,0x10000028,0x10000028},
+  {0x10000058,0x10000058,0x10000058,0x10000058,0x10000058,0x10000058,0x10000058,0x10000058,0x10000068,0x10000068,0x10000068,0x10000068,0x10000068,0x10000068,0x10000068,0x10000068,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000}
+};
+
+const PRUint32 kTitleToUpper = 0x80000000;
+const PRUint32 kUpperToLower = 0x40000000;
+const PRUint32 kLowerToTitle = 0x20000000;
+const PRUint32 kLowerToUpper = 0x10000000;
+const PRUint32 kCaseMapCharMask = 0x001fffff;
+
 /*
  * * * * * This file contains MACHINE-GENERATED DATA, do not edit! * * * * *
  */
rename from intl/unicharutil/public/nsUnicodeScriptCodes.h
rename to intl/unicharutil/util/nsUnicodeScriptCodes.h
--- a/intl/unicharutil/public/nsUnicodeScriptCodes.h
+++ b/intl/unicharutil/util/nsUnicodeScriptCodes.h
@@ -36,17 +36,17 @@
  *
  * Derived from the Unicode Character Database by genUnicodePropertyData.pl
  *
  * For Unicode terms of use, see http://www.unicode.org/terms_of_use.html
  *
  * ***** END LICENSE BLOCK ***** */
 
 /*
- * Created on Thu Feb 23 13:15:51 2012 from UCD data files with version info:
+ * Created on Mon Mar  5 08:11:49 2012 from UCD data files with version info:
  *
 
 # Date: 2012-01-26, 22:03:00 GMT [KW]
 #
 # Unicode Character Database
 # Copyright (c) 1991-2012 Unicode, Inc.
 # For terms of use, see http://www.unicode.org/terms_of_use.html
 #
--- a/intl/unicharutil/util/objs.mk
+++ b/intl/unicharutil/util/objs.mk
@@ -32,11 +32,12 @@
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 INTL_UNICHARUTIL_UTIL_LCPPSRCS = \
 	nsUnicharUtils.cpp \
 	nsBidiUtils.cpp \
+	nsUnicodeProperties.cpp \
 	$(NULL)
 
 INTL_UNICHARUTIL_UTIL_CPPSRCS = $(addprefix $(topsrcdir)/intl/unicharutil/util/, $(INTL_UNICHARUTIL_UTIL_LCPPSRCS))