OW_UTF8Utils.cpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * Copyright (C) 2003-2004 Vintela, Inc. All rights reserved.
00003 *
00004 * Redistribution and use in source and binary forms, with or without
00005 * modification, are permitted provided that the following conditions are met:
00006 *
00007 *  - Redistributions of source code must retain the above copyright notice,
00008 *    this list of conditions and the following disclaimer.
00009 *
00010 *  - Redistributions in binary form must reproduce the above copyright notice,
00011 *    this list of conditions and the following disclaimer in the documentation
00012 *    and/or other materials provided with the distribution.
00013 *
00014 *  - Neither the name of Vintela, Inc. nor the names of its
00015 *    contributors may be used to endorse or promote products derived from this
00016 *    software without specific prior written permission.
00017 *
00018 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00019 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 * ARE DISCLAIMED. IN NO EVENT SHALL Vintela, Inc. OR THE CONTRIBUTORS
00022 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00023 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00024 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00025 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00026 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00027 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00028 * POSSIBILITY OF SUCH DAMAGE.
00029 *******************************************************************************/
00030 
00035 // Portions of this file based on utf/detail/utf8_algo.hpp
00036 //
00037 //  Copyright (c) 2003 Alberto Barbati
00038 //
00039 //  Permission to copy, use, modify, sell and distribute this software
00040 //  is granted provided this copyright notice appears in all copies.
00041 //  This software is provided "as is" without express or implied
00042 //  warranty, and with no claim as to its suitability for any purpose.
00043 #include "OW_config.h"
00044 #include "OW_UTF8Utils.hpp"
00045 #include "OW_String.hpp"
00046 #include "OW_Assertion.hpp"
00047 #include "OW_Array.hpp"
00048 #include "OW_Format.hpp"
00049 #include "OW_ExceptionIds.hpp"
00050 
00051 #include <string.h> // for strlen
00052 #include <algorithm> // for std::lower_bound
00053 
00054 namespace OW_NAMESPACE
00055 {
00056 
00057 OW_DEFINE_EXCEPTION_WITH_ID(InvalidUTF8);
00058 
00059 namespace UTF8Utils
00060 {
00061 namespace {
00062 /*
00063    UTF-8 sequence length table.
00064    This table gives the sequence length according to the value of the
00065    sequence leading character.
00066    Notice: this table is different from the one found in the official
00067    UTF-8 conversion program, found here
00068    http://www.unicode.org/Public/PROGRAMS/CVTUTF/
00069    This table encodes only the sequence lenghts of UTF-8 sequences
00070    that can encode (or possibly encode) a Unicode character according
00071    to Unicode 3.2 requirements.
00072    In particular:
00073    - lines from 0x80 to 0xb0 (inclusive) contains "0" because those
00074    values do not represent a valid leading character
00075    - line 0xc0 begins with two "0" because values 0xc0 and 0xc1 lead
00076    non-shortest sequences, that are illegal since Unicode 3.1
00077    - line 0xf0 has only five "4" instead of eight and lacks values
00078    "5" and "6" because values above 0xf4 lead sequences that cannot
00079    encode a Unicode character.
00080 */
00081 UInt8 SequenceLengthTable[256] =
00082 {
00083    /* 0x00 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x0f */
00084    /* 0x10 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x1f */
00085    /* 0x20 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x2f */
00086    /* 0x30 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x3f */
00087    /* 0x40 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x4f */
00088    /* 0x50 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x5f */
00089    /* 0x60 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x6f */
00090    /* 0x70 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x7f */
00091    /* 0x80 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x8f */
00092    /* 0x90 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x9f */
00093    /* 0xa0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xaf */
00094    /* 0xb0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xbf */
00095    /* 0xc0 */ 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xcf */
00096    /* 0xd0 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xdf */
00097    /* 0xe0 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0xef */
00098    /* 0xf0 */ 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0  /* 0xff */
00099 };
00100 } // end unnamed namespace
00101 size_t charCount(const char* utf8str)
00102 {
00103    OW_ASSERT(utf8str != 0);
00104    const char* p = utf8str;
00105    size_t count = 0;
00106    while (*p)
00107    {
00108       // any chars 0x80-0xBF are extension bytes.  Anything else signals a new char
00109       UInt8 c = static_cast<UInt8>(*p);
00110       if (c < 0x80 || c > 0xBF)
00111       {
00112          ++count;
00113       }
00114       ++p;
00115    }
00116    return count;
00117 }
00119 UInt16 UTF8toUCS2(const char* utf8char)
00120 {
00121    UInt32 c = UTF8toUCS4(utf8char);
00122    if (c > 0xFFFF)
00123    {
00124       return 0xFFFF;
00125    }
00126    else
00127    {
00128       return static_cast<UInt16>(c);
00129    }
00130 }
00132 String UCS2toUTF8(UInt16 ucs2char)
00133 {
00134    // UCS2 and UCS4 are the same, only different sizes.
00135    return UCS4toUTF8(ucs2char);
00136 }
00138 UInt32 UTF8toUCS4(const char* utf8char)
00139 {
00140    OW_ASSERT(utf8char != 0);
00141    OW_ASSERT(utf8char[0] != '\0');
00142    const char* p = utf8char;
00143    const UInt32 c0 = static_cast<UInt8>(p[0]);
00144    const UInt32 bad = 0xFFFFFFFF;
00145    switch (SequenceLengthTable[c0])
00146    {
00147       case 1:
00148       {
00149          return c0;
00150       }
00151       case 2:
00152       {
00153          // check for short (invalid) utf8 sequence
00154          if (p[1] == '\0')
00155          {
00156             return bad;
00157          }
00158          const UInt32 c1 = static_cast<UInt8>(p[1]);
00159          return ((c0 & 0x1fu) << 6) | (c1 & 0x3fu);
00160       }
00161       case 3:
00162       {
00163          // check for short (invalid) utf8 sequence
00164          if (p[1] == '\0' || p[2] == '\0')
00165          {
00166             return bad;
00167          }
00168          const UInt32 c1 = static_cast<UInt8>(p[1]);
00169          const UInt32 c2 = static_cast<UInt8>(p[2]);
00170          return ((c0 & 0x0fu) << 12) | ((c1 & 0x3fu) << 6) | (c2 & 0x3fu);
00171       }
00172       case 4:
00173       {
00174          // check for short (invalid) utf8 sequence
00175          if (p[1] == '\0' || p[2] == '\0' || p[3] == '\0')
00176          {
00177             return bad;
00178          }
00179          
00180          const UInt32 c1 = static_cast<UInt8>(p[1]);
00181          const UInt32 c2 = static_cast<UInt8>(p[2]);
00182          const UInt32 c3 = static_cast<UInt8>(p[3]);
00183          
00184          return ((c0 & 0x03u) << 18) | ((c1 & 0x3fu) << 12) | ((c2 & 0x3fu) << 6) | (c3 & 0x3fu);
00185       }
00186       default:
00187       {
00188          // invalid, just skip it
00189          break;
00190       }
00191    }
00192    return bad;
00193 }
00194 
00196 String UCS4toUTF8(UInt32 ucs4char)
00197 {
00198    StringBuffer sb(5); // max 4 chars + null
00199    UCS4toUTF8(ucs4char, sb);
00200    return sb.releaseString();
00201 }
00202 
00204 void UCS4toUTF8(UInt32 ucs4char, StringBuffer& sb)
00205 {
00206    if (ucs4char < 0x80u)
00207    {
00208       // one byte
00209       sb += static_cast<char>(static_cast<UInt8>(ucs4char));
00210    }
00211    else if (ucs4char < 0x800u)
00212    {
00213       sb += static_cast<char>(static_cast<UInt8>(0xc0u | (ucs4char >> 6)));
00214       sb += static_cast<char>(static_cast<UInt8>(0x80u | (ucs4char & 0x3fu)));
00215    }
00216    else if (ucs4char < 0x10000u)
00217    {
00218       sb += static_cast<char>(static_cast<UInt8>(0xe0u | (ucs4char >> 12)));
00219       sb += static_cast<char>(static_cast<UInt8>(0x80u | ((ucs4char >> 6) & 0x3fu)));
00220       sb += static_cast<char>(static_cast<UInt8>(0x80u | (ucs4char & 0x3fu)));
00221    }
00222    else
00223    {
00224       sb += static_cast<char>(static_cast<UInt8>(0xf0u | (ucs4char >> 18)));
00225       sb += static_cast<char>(static_cast<UInt8>(0x80u | ((ucs4char >> 12) & 0x3fu)));
00226       sb += static_cast<char>(static_cast<UInt8>(0x80u | ((ucs4char >> 6) & 0x3fu)));
00227       sb += static_cast<char>(static_cast<UInt8>(0x80u | (ucs4char & 0x3fu)));
00228    }
00229 }
00230 
00231 namespace
00232 {
00234 void UCS4toUTF8(UInt32 ucs4char, char* p)
00235 {
00236    if (ucs4char < 0x80u)
00237    {
00238       // one byte
00239       p[0] = static_cast<char>(static_cast<UInt8>(ucs4char));
00240    }
00241    else if (ucs4char < 0x800u)
00242    {
00243       p[0] = static_cast<char>(static_cast<UInt8>(0xc0u | (ucs4char >> 6)));
00244       p[1] = static_cast<char>(static_cast<UInt8>(0x80u | (ucs4char & 0x3fu)));
00245    }
00246    else if (ucs4char < 0x10000u)
00247    {
00248       p[0] = static_cast<char>(static_cast<UInt8>(0xe0u | (ucs4char >> 12)));
00249       p[1] = static_cast<char>(static_cast<UInt8>(0x80u | ((ucs4char >> 6) & 0x3fu)));
00250       p[2] = static_cast<char>(static_cast<UInt8>(0x80u | (ucs4char & 0x3fu)));
00251    }
00252    else
00253    {
00254       p[0] = static_cast<char>(static_cast<UInt8>(0xf0u | (ucs4char >> 18)));
00255       p[1] = static_cast<char>(static_cast<UInt8>(0x80u | ((ucs4char >> 12) & 0x3fu)));
00256       p[2] = static_cast<char>(static_cast<UInt8>(0x80u | ((ucs4char >> 6) & 0x3fu)));
00257       p[3] = static_cast<char>(static_cast<UInt8>(0x80u | (ucs4char & 0x3fu)));
00258    }
00259 }
00260 
00262 Array<UInt16> StringToUCS2Common(const String& input, bool throwException)
00263 {
00264    // TODO: Remove the duplication between this function and UTF8toUCS2()
00265    Array<UInt16> rval;
00266    OW_ASSERT(input.length() == ::strlen(input.c_str()));
00267    const UInt16 UCS2ReplacementChar = 0xFFFD;
00268    const char* begin = input.c_str();
00269    const char* end = begin + input.length();
00270 
00271    const char* p = begin;
00272    while (p < end)
00273    {
00274       const UInt32 c0 = static_cast<UInt8>(p[0]);
00275       switch (SequenceLengthTable[c0])
00276       {
00277          case 1:
00278          {
00279             rval.push_back(c0);
00280             ++p;
00281          }
00282          break;
00283          case 2:
00284          {
00285             // check for short (invalid) utf8 sequence
00286             if (p[1] == '\0')
00287             {
00288                if (throwException)
00289                {
00290                   OW_THROW(InvalidUTF8Exception, Format("Length: %1, input = %2, p = %3", 
00291                      static_cast<int>(SequenceLengthTable[c0]), input.c_str(), p).c_str());
00292                }
00293                else
00294                {
00295                   rval.push_back(UCS2ReplacementChar);
00296                   p += 2;
00297                }
00298             }
00299             const UInt32 c1 = static_cast<UInt8>(p[1]);
00300             rval.push_back(((c0 & 0x1fu) << 6) | (c1 & 0x3fu));
00301             p += 2;
00302          }
00303          break;
00304          case 3:
00305          {
00306             // check for short (invalid) utf8 sequence
00307             if (p[1] == '\0' || p[2] == '\0')
00308             {
00309                if (throwException)
00310                {
00311                   OW_THROW(InvalidUTF8Exception, Format("Length: %1, input = %2, p = %3", 
00312                      static_cast<int>(SequenceLengthTable[c0]), input.c_str(), p).c_str());
00313                }
00314                else
00315                {
00316                   rval.push_back(UCS2ReplacementChar);
00317                   p += 3;
00318                }
00319 
00320             }
00321             const UInt32 c1 = static_cast<UInt8>(p[1]);
00322             const UInt32 c2 = static_cast<UInt8>(p[2]);
00323             rval.push_back(((c0 & 0x0fu) << 12) | ((c1 & 0x3fu) << 6) | (c2 & 0x3fu));
00324             p += 3;
00325          }
00326          break;
00327          case 4:
00328          {
00329             // UCS2 can't hold a value this big
00330             if (throwException)
00331             {
00332                OW_THROW(InvalidUTF8Exception, Format("Length: %1, input = %2, p = %3", 
00333                   static_cast<int>(SequenceLengthTable[c0]), input.c_str(), p).c_str());
00334             }
00335             else
00336             {
00337                rval.push_back(UCS2ReplacementChar);
00338                p += 4;
00339             }
00340 
00341          }
00342          break;
00343          default:
00344          {
00345             if (throwException)
00346             {
00347                OW_THROW(InvalidUTF8Exception, Format("Length: %1, input = %2, p = %3", 
00348                   static_cast<int>(SequenceLengthTable[c0]), input.c_str(), p).c_str());
00349             }
00350             else
00351             {
00352                rval.push_back(UCS2ReplacementChar);
00353                ++p;
00354             }
00355          }
00356       }
00357    }
00358    return rval;
00359 }
00360 
00361 } // end anonymous namespace
00362 
00364 Array<UInt16> StringToUCS2ReplaceInvalid(const String& input)
00365 {
00366    return StringToUCS2Common(input, false);
00367 }
00368 
00370 Array<UInt16> StringToUCS2(const String& input)
00371 {
00372    return StringToUCS2Common(input, true);
00373 }
00374 
00376 String UCS2ToString(const void* input, size_t inputLength)
00377 {
00378    // start out with 1 byte/char in input, this is just big enough for a
00379    // standard ASCII string.  If any chars are bigger, we'll only incur 1 or
00380    // 2 (worse case) reallocations of the buffer.
00381    size_t numchars = inputLength/2;
00382    StringBuffer sb(numchars + 1);
00383    for (size_t i = 0; i < numchars; ++i)
00384    {
00385       UCS4toUTF8(reinterpret_cast<const UInt16*>(input)[i], sb);
00386    }
00387    return sb.releaseString();
00388 }
00389 
00391 String UCS2ToString(const Array<UInt16>& input)
00392 {
00393    return UCS2ToString(&input[0], input.size() * sizeof(UInt16));
00394 }
00396 String UCS2ToString(const Array<char>& input)
00397 {
00398    return UCS2ToString(&input[0], input.size());
00399 }
00400 
00402 namespace
00403 {
00404 
00405 int UTF8CharLen(UInt32 ucs4char)
00406 {
00407    if (ucs4char < 0x80u)
00408    {
00409       return 1;
00410    }
00411    else if (ucs4char < 0x800u)
00412    {
00413       return 2;
00414    }
00415    else if (ucs4char < 0x10000u)
00416    {
00417       return 3;
00418    }
00419    else
00420    {
00421       return 4;
00422    }
00423 }
00424 
00425 template <typename TransformT>
00426 bool transformInPlace(char* input, TransformT transformer)
00427 {
00428    char* p = input;
00429    char* output = input;
00430    while (*p)
00431    {
00432       UInt32 ucs4char = UTF8toUCS4(p);
00433       if (ucs4char == 0xFFFFFFFF)
00434       {
00435          ++p;
00436          ++output;
00437          continue;
00438       }
00439       UInt32 newUcs4Char = transformer(ucs4char);
00440 
00441       const UInt32 c0 = static_cast<UInt8>(p[0]);
00442       int prevCharLen = SequenceLengthTable[c0];
00443       int newCharLen = UTF8CharLen(newUcs4Char);
00444       
00445       // can't grow the string, only shrink it. This can't happen with valid UTF8, but with invalid stuff it could.
00446       if (p > output)
00447       {
00448          return false;
00449       }
00450 
00451       // This is commented out, because, given the current set of data from Unicode 4.0.1, there are no
00452       // chars that grow when either upper or lower-cased.
00453       //if ((p + prevCharLen) < (output + newCharLen))
00454       //{
00455       // return false;
00456       //}
00457       UCS4toUTF8(newUcs4Char, output);
00458       p += prevCharLen;
00459       output += newCharLen;
00460    }
00461    *output = '\0'; // null terminate in case the string shrunk
00462    return true;
00463 }
00464 
00465 template <typename TransformT>
00466 String transform(const char* input, TransformT transformer)
00467 {
00468    StringBuffer rval(strlen(input));
00469    const char* p = input;
00470    while (*p)
00471    {
00472       UInt32 ucs4char = UTF8toUCS4(p);
00473       if (ucs4char == 0xFFFFFFFF)
00474       {
00475          rval += *p;
00476          ++p;
00477          continue;
00478       }
00479 
00480       UTF8Utils::UCS4toUTF8(transformer(ucs4char), rval);
00481 
00482       const UInt32 c0 = static_cast<UInt8>(p[0]);
00483       int prevCharLen = SequenceLengthTable[c0];
00484       p += prevCharLen;
00485    }
00486    return rval.releaseString();
00487 }
00488 
00489 // These mappings were generated by OW_GenCaseMappings.cpp with UnicodeData.txt from unicode 4.0.1 and downloaded from http://www.unicode.org/Public/UNIDATA/
00490 // Don't modify it by hand, re-run the generator if something needs to change.
00491 struct CaseMapping
00492 {
00493    UInt32 codePoint;
00494    UInt32 mapping;
00495 };
00496 const CaseMapping lowerMappings[] =
00497 {
00498    {0x41, 0x61},
00499    {0x42, 0x62},
00500    {0x43, 0x63},
00501    {0x44, 0x64},
00502    {0x45, 0x65},
00503    {0x46, 0x66},
00504    {0x47, 0x67},
00505    {0x48, 0x68},
00506    {0x49, 0x69},
00507    {0x4a, 0x6a},
00508    {0x4b, 0x6b},
00509    {0x4c, 0x6c},
00510    {0x4d, 0x6d},
00511    {0x4e, 0x6e},
00512    {0x4f, 0x6f},
00513    {0x50, 0x70},
00514    {0x51, 0x71},
00515    {0x52, 0x72},
00516    {0x53, 0x73},
00517    {0x54, 0x74},
00518    {0x55, 0x75},
00519    {0x56, 0x76},
00520    {0x57, 0x77},
00521    {0x58, 0x78},
00522    {0x59, 0x79},
00523    {0x5a, 0x7a},
00524    {0xc0, 0xe0},
00525    {0xc1, 0xe1},
00526    {0xc2, 0xe2},
00527    {0xc3, 0xe3},
00528    {0xc4, 0xe4},
00529    {0xc5, 0xe5},
00530    {0xc6, 0xe6},
00531    {0xc7, 0xe7},
00532    {0xc8, 0xe8},
00533    {0xc9, 0xe9},
00534    {0xca, 0xea},
00535    {0xcb, 0xeb},
00536    {0xcc, 0xec},
00537    {0xcd, 0xed},
00538    {0xce, 0xee},
00539    {0xcf, 0xef},
00540    {0xd0, 0xf0},
00541    {0xd1, 0xf1},
00542    {0xd2, 0xf2},
00543    {0xd3, 0xf3},
00544    {0xd4, 0xf4},
00545    {0xd5, 0xf5},
00546    {0xd6, 0xf6},
00547    {0xd8, 0xf8},
00548    {0xd9, 0xf9},
00549    {0xda, 0xfa},
00550    {0xdb, 0xfb},
00551    {0xdc, 0xfc},
00552    {0xdd, 0xfd},
00553    {0xde, 0xfe},
00554    {0x100, 0x101},
00555    {0x102, 0x103},
00556    {0x104, 0x105},
00557    {0x106, 0x107},
00558    {0x108, 0x109},
00559    {0x10a, 0x10b},
00560    {0x10c, 0x10d},
00561    {0x10e, 0x10f},
00562    {0x110, 0x111},
00563    {0x112, 0x113},
00564    {0x114, 0x115},
00565    {0x116, 0x117},
00566    {0x118, 0x119},
00567    {0x11a, 0x11b},
00568    {0x11c, 0x11d},
00569    {0x11e, 0x11f},
00570    {0x120, 0x121},
00571    {0x122, 0x123},
00572    {0x124, 0x125},
00573    {0x126, 0x127},
00574    {0x128, 0x129},
00575    {0x12a, 0x12b},
00576    {0x12c, 0x12d},
00577    {0x12e, 0x12f},
00578    {0x130, 0x69},
00579    {0x132, 0x133},
00580    {0x134, 0x135},
00581    {0x136, 0x137},
00582    {0x139, 0x13a},
00583    {0x13b, 0x13c},
00584    {0x13d, 0x13e},
00585    {0x13f, 0x140},
00586    {0x141, 0x142},
00587    {0x143, 0x144},
00588    {0x145, 0x146},
00589    {0x147, 0x148},
00590    {0x14a, 0x14b},
00591    {0x14c, 0x14d},
00592    {0x14e, 0x14f},
00593    {0x150, 0x151},
00594    {0x152, 0x153},
00595    {0x154, 0x155},
00596    {0x156, 0x157},
00597    {0x158, 0x159},
00598    {0x15a, 0x15b},
00599    {0x15c, 0x15d},
00600    {0x15e, 0x15f},
00601    {0x160, 0x161},
00602    {0x162, 0x163},
00603    {0x164, 0x165},
00604    {0x166, 0x167},
00605    {0x168, 0x169},
00606    {0x16a, 0x16b},
00607    {0x16c, 0x16d},
00608    {0x16e, 0x16f},
00609    {0x170, 0x171},
00610    {0x172, 0x173},
00611    {0x174, 0x175},
00612    {0x176, 0x177},
00613    {0x178, 0xff},
00614    {0x179, 0x17a},
00615    {0x17b, 0x17c},
00616    {0x17d, 0x17e},
00617    {0x181, 0x253},
00618    {0x182, 0x183},
00619    {0x184, 0x185},
00620    {0x186, 0x254},
00621    {0x187, 0x188},
00622    {0x189, 0x256},
00623    {0x18a, 0x257},
00624    {0x18b, 0x18c},
00625    {0x18e, 0x1dd},
00626    {0x18f, 0x259},
00627    {0x190, 0x25b},
00628    {0x191, 0x192},
00629    {0x193, 0x260},
00630    {0x194, 0x263},
00631    {0x196, 0x269},
00632    {0x197, 0x268},
00633    {0x198, 0x199},
00634    {0x19c, 0x26f},
00635    {0x19d, 0x272},
00636    {0x19f, 0x275},
00637    {0x1a0, 0x1a1},
00638    {0x1a2, 0x1a3},
00639    {0x1a4, 0x1a5},
00640    {0x1a6, 0x280},
00641    {0x1a7, 0x1a8},
00642    {0x1a9, 0x283},
00643    {0x1ac, 0x1ad},
00644    {0x1ae, 0x288},
00645    {0x1af, 0x1b0},
00646    {0x1b1, 0x28a},
00647    {0x1b2, 0x28b},
00648    {0x1b3, 0x1b4},
00649    {0x1b5, 0x1b6},
00650    {0x1b7, 0x292},
00651    {0x1b8, 0x1b9},
00652    {0x1bc, 0x1bd},
00653    {0x1c4, 0x1c6},
00654    {0x1c5, 0x1c6},
00655    {0x1c7, 0x1c9},
00656    {0x1c8, 0x1c9},
00657    {0x1ca, 0x1cc},
00658    {0x1cb, 0x1cc},
00659    {0x1cd, 0x1ce},
00660    {0x1cf, 0x1d0},
00661    {0x1d1, 0x1d2},
00662    {0x1d3, 0x1d4},
00663    {0x1d5, 0x1d6},
00664    {0x1d7, 0x1d8},
00665    {0x1d9, 0x1da},
00666    {0x1db, 0x1dc},
00667    {0x1de, 0x1df},
00668    {0x1e0, 0x1e1},
00669    {0x1e2, 0x1e3},
00670    {0x1e4, 0x1e5},
00671    {0x1e6, 0x1e7},
00672    {0x1e8, 0x1e9},
00673    {0x1ea, 0x1eb},
00674    {0x1ec, 0x1ed},
00675    {0x1ee, 0x1ef},
00676    {0x1f1, 0x1f3},
00677    {0x1f2, 0x1f3},
00678    {0x1f4, 0x1f5},
00679    {0x1f6, 0x195},
00680    {0x1f7, 0x1bf},
00681    {0x1f8, 0x1f9},
00682    {0x1fa, 0x1fb},
00683    {0x1fc, 0x1fd},
00684    {0x1fe, 0x1ff},
00685    {0x200, 0x201},
00686    {0x202, 0x203},
00687    {0x204, 0x205},
00688    {0x206, 0x207},
00689    {0x208, 0x209},
00690    {0x20a, 0x20b},
00691    {0x20c, 0x20d},
00692    {0x20e, 0x20f},
00693    {0x210, 0x211},
00694    {0x212, 0x213},
00695    {0x214, 0x215},
00696    {0x216, 0x217},
00697    {0x218, 0x219},
00698    {0x21a, 0x21b},
00699    {0x21c, 0x21d},
00700    {0x21e, 0x21f},
00701    {0x220, 0x19e},
00702    {0x222, 0x223},
00703    {0x224, 0x225},
00704    {0x226, 0x227},
00705    {0x228, 0x229},
00706    {0x22a, 0x22b},
00707    {0x22c, 0x22d},
00708    {0x22e, 0x22f},
00709    {0x230, 0x231},
00710    {0x232, 0x233},
00711    {0x386, 0x3ac},
00712    {0x388, 0x3ad},
00713    {0x389, 0x3ae},
00714    {0x38a, 0x3af},
00715    {0x38c, 0x3cc},
00716    {0x38e, 0x3cd},
00717    {0x38f, 0x3ce},
00718    {0x391, 0x3b1},
00719    {0x392, 0x3b2},
00720    {0x393, 0x3b3},
00721    {0x394, 0x3b4},
00722    {0x395, 0x3b5},
00723    {0x396, 0x3b6},
00724    {0x397, 0x3b7},
00725    {0x398, 0x3b8},
00726    {0x399, 0x3b9},
00727    {0x39a, 0x3ba},
00728    {0x39b, 0x3bb},
00729    {0x39c, 0x3bc},
00730    {0x39d, 0x3bd},
00731    {0x39e, 0x3be},
00732    {0x39f, 0x3bf},
00733    {0x3a0, 0x3c0},
00734    {0x3a1, 0x3c1},
00735    {0x3a3, 0x3c3},
00736    {0x3a4, 0x3c4},
00737    {0x3a5, 0x3c5},
00738    {0x3a6, 0x3c6},
00739    {0x3a7, 0x3c7},
00740    {0x3a8, 0x3c8},
00741    {0x3a9, 0x3c9},
00742    {0x3aa, 0x3ca},
00743    {0x3ab, 0x3cb},
00744    {0x3d8, 0x3d9},
00745    {0x3da, 0x3db},
00746    {0x3dc, 0x3dd},
00747    {0x3de, 0x3df},
00748    {0x3e0, 0x3e1},
00749    {0x3e2, 0x3e3},
00750    {0x3e4, 0x3e5},
00751    {0x3e6, 0x3e7},
00752    {0x3e8, 0x3e9},
00753    {0x3ea, 0x3eb},
00754    {0x3ec, 0x3ed},
00755    {0x3ee, 0x3ef},
00756    {0x3f4, 0x3b8},
00757    {0x3f7, 0x3f8},
00758    {0x3f9, 0x3f2},
00759    {0x3fa, 0x3fb},
00760    {0x400, 0x450},
00761    {0x401, 0x451},
00762    {0x402, 0x452},
00763    {0x403, 0x453},
00764    {0x404, 0x454},
00765    {0x405, 0x455},
00766    {0x406, 0x456},
00767    {0x407, 0x457},
00768    {0x408, 0x458},
00769    {0x409, 0x459},
00770    {0x40a, 0x45a},
00771    {0x40b, 0x45b},
00772    {0x40c, 0x45c},
00773    {0x40d, 0x45d},
00774    {0x40e, 0x45e},
00775    {0x40f, 0x45f},
00776    {0x410, 0x430},
00777    {0x411, 0x431},
00778    {0x412, 0x432},
00779    {0x413, 0x433},
00780    {0x414, 0x434},
00781    {0x415, 0x435},
00782    {0x416, 0x436},
00783    {0x417, 0x437},
00784    {0x418, 0x438},
00785    {0x419, 0x439},
00786    {0x41a, 0x43a},
00787    {0x41b, 0x43b},
00788    {0x41c, 0x43c},
00789    {0x41d, 0x43d},
00790    {0x41e, 0x43e},
00791    {0x41f, 0x43f},
00792    {0x420, 0x440},
00793    {0x421, 0x441},
00794    {0x422, 0x442},
00795    {0x423, 0x443},
00796    {0x424, 0x444},
00797    {0x425, 0x445},
00798    {0x426, 0x446},
00799    {0x427, 0x447},
00800    {0x428, 0x448},
00801    {0x429, 0x449},
00802    {0x42a, 0x44a},
00803    {0x42b, 0x44b},
00804    {0x42c, 0x44c},
00805    {0x42d, 0x44d},
00806    {0x42e, 0x44e},
00807    {0x42f, 0x44f},
00808    {0x460, 0x461},
00809    {0x462, 0x463},
00810    {0x464, 0x465},
00811    {0x466, 0x467},
00812    {0x468, 0x469},
00813    {0x46a, 0x46b},
00814    {0x46c, 0x46d},
00815    {0x46e, 0x46f},
00816    {0x470, 0x471},
00817    {0x472, 0x473},
00818    {0x474, 0x475},
00819    {0x476, 0x477},
00820    {0x478, 0x479},
00821    {0x47a, 0x47b},
00822    {0x47c, 0x47d},
00823    {0x47e, 0x47f},
00824    {0x480, 0x481},
00825    {0x48a, 0x48b},
00826    {0x48c, 0x48d},
00827    {0x48e, 0x48f},
00828    {0x490, 0x491},
00829    {0x492, 0x493},
00830    {0x494, 0x495},
00831    {0x496, 0x497},
00832    {0x498, 0x499},
00833    {0x49a, 0x49b},
00834    {0x49c, 0x49d},
00835    {0x49e, 0x49f},
00836    {0x4a0, 0x4a1},
00837    {0x4a2, 0x4a3},
00838    {0x4a4, 0x4a5},
00839    {0x4a6, 0x4a7},
00840    {0x4a8, 0x4a9},
00841    {0x4aa, 0x4ab},
00842    {0x4ac, 0x4ad},
00843    {0x4ae, 0x4af},
00844    {0x4b0, 0x4b1},
00845    {0x4b2, 0x4b3},
00846    {0x4b4, 0x4b5},
00847    {0x4b6, 0x4b7},
00848    {0x4b8, 0x4b9},
00849    {0x4ba, 0x4bb},
00850    {0x4bc, 0x4bd},
00851    {0x4be, 0x4bf},
00852    {0x4c1, 0x4c2},
00853    {0x4c3, 0x4c4},
00854    {0x4c5, 0x4c6},
00855    {0x4c7, 0x4c8},
00856    {0x4c9, 0x4ca},
00857    {0x4cb, 0x4cc},
00858    {0x4cd, 0x4ce},
00859    {0x4d0, 0x4d1},
00860    {0x4d2, 0x4d3},
00861    {0x4d4, 0x4d5},
00862    {0x4d6, 0x4d7},
00863    {0x4d8, 0x4d9},
00864    {0x4da, 0x4db},
00865    {0x4dc, 0x4dd},
00866    {0x4de, 0x4df},
00867    {0x4e0, 0x4e1},
00868    {0x4e2, 0x4e3},
00869    {0x4e4, 0x4e5},
00870    {0x4e6, 0x4e7},
00871    {0x4e8, 0x4e9},
00872    {0x4ea, 0x4eb},
00873    {0x4ec, 0x4ed},
00874    {0x4ee, 0x4ef},
00875    {0x4f0, 0x4f1},
00876    {0x4f2, 0x4f3},
00877    {0x4f4, 0x4f5},
00878    {0x4f8, 0x4f9},
00879    {0x500, 0x501},
00880    {0x502, 0x503},
00881    {0x504, 0x505},
00882    {0x506, 0x507},
00883    {0x508, 0x509},
00884    {0x50a, 0x50b},
00885    {0x50c, 0x50d},
00886    {0x50e, 0x50f},
00887    {0x531, 0x561},
00888    {0x532, 0x562},
00889    {0x533, 0x563},
00890    {0x534, 0x564},
00891    {0x535, 0x565},
00892    {0x536, 0x566},
00893    {0x537, 0x567},
00894    {0x538, 0x568},
00895    {0x539, 0x569},
00896    {0x53a, 0x56a},
00897    {0x53b, 0x56b},
00898    {0x53c, 0x56c},
00899    {0x53d, 0x56d},
00900    {0x53e, 0x56e},
00901    {0x53f, 0x56f},
00902    {0x540, 0x570},
00903    {0x541, 0x571},
00904    {0x542, 0x572},
00905    {0x543, 0x573},
00906    {0x544, 0x574},
00907    {0x545, 0x575},
00908    {0x546, 0x576},
00909    {0x547, 0x577},
00910    {0x548, 0x578},
00911    {0x549, 0x579},
00912    {0x54a, 0x57a},
00913    {0x54b, 0x57b},
00914    {0x54c, 0x57c},
00915    {0x54d, 0x57d},
00916    {0x54e, 0x57e},
00917    {0x54f, 0x57f},
00918    {0x550, 0x580},
00919    {0x551, 0x581},
00920    {0x552, 0x582},
00921    {0x553, 0x583},
00922    {0x554, 0x584},
00923    {0x555, 0x585},
00924    {0x556, 0x586},
00925    {0x1e00, 0x1e01},
00926    {0x1e02, 0x1e03},
00927    {0x1e04, 0x1e05},
00928    {0x1e06, 0x1e07},
00929    {0x1e08, 0x1e09},
00930    {0x1e0a, 0x1e0b},
00931    {0x1e0c, 0x1e0d},
00932    {0x1e0e, 0x1e0f},
00933    {0x1e10, 0x1e11},
00934    {0x1e12, 0x1e13},
00935    {0x1e14, 0x1e15},
00936    {0x1e16, 0x1e17},
00937    {0x1e18, 0x1e19},
00938    {0x1e1a, 0x1e1b},
00939    {0x1e1c, 0x1e1d},
00940    {0x1e1e, 0x1e1f},
00941    {0x1e20, 0x1e21},
00942    {0x1e22, 0x1e23},
00943    {0x1e24, 0x1e25},
00944    {0x1e26, 0x1e27},
00945    {0x1e28, 0x1e29},
00946    {0x1e2a, 0x1e2b},
00947    {0x1e2c, 0x1e2d},
00948    {0x1e2e, 0x1e2f},
00949    {0x1e30, 0x1e31},
00950    {0x1e32, 0x1e33},
00951    {0x1e34, 0x1e35},
00952    {0x1e36, 0x1e37},
00953    {0x1e38, 0x1e39},
00954    {0x1e3a, 0x1e3b},
00955    {0x1e3c, 0x1e3d},
00956    {0x1e3e, 0x1e3f},
00957    {0x1e40, 0x1e41},
00958    {0x1e42, 0x1e43},
00959    {0x1e44, 0x1e45},
00960    {0x1e46, 0x1e47},
00961    {0x1e48, 0x1e49},
00962    {0x1e4a, 0x1e4b},
00963    {0x1e4c, 0x1e4d},
00964    {0x1e4e, 0x1e4f},
00965    {0x1e50, 0x1e51},
00966    {0x1e52, 0x1e53},
00967    {0x1e54, 0x1e55},
00968    {0x1e56, 0x1e57},
00969    {0x1e58, 0x1e59},
00970    {0x1e5a, 0x1e5b},
00971    {0x1e5c, 0x1e5d},
00972    {0x1e5e, 0x1e5f},
00973    {0x1e60, 0x1e61},
00974    {0x1e62, 0x1e63},
00975    {0x1e64, 0x1e65},
00976    {0x1e66, 0x1e67},
00977    {0x1e68, 0x1e69},
00978    {0x1e6a, 0x1e6b},
00979    {0x1e6c, 0x1e6d},
00980    {0x1e6e, 0x1e6f},
00981    {0x1e70, 0x1e71},
00982    {0x1e72, 0x1e73},
00983    {0x1e74, 0x1e75},
00984    {0x1e76, 0x1e77},
00985    {0x1e78, 0x1e79},
00986    {0x1e7a, 0x1e7b},
00987    {0x1e7c, 0x1e7d},
00988    {0x1e7e, 0x1e7f},
00989    {0x1e80, 0x1e81},
00990    {0x1e82, 0x1e83},
00991    {0x1e84, 0x1e85},
00992    {0x1e86, 0x1e87},
00993    {0x1e88, 0x1e89},
00994    {0x1e8a, 0x1e8b},
00995    {0x1e8c, 0x1e8d},
00996    {0x1e8e, 0x1e8f},
00997    {0x1e90, 0x1e91},
00998    {0x1e92, 0x1e93},
00999    {0x1e94, 0x1e95},
01000    {0x1ea0, 0x1ea1},
01001    {0x1ea2, 0x1ea3},
01002    {0x1ea4, 0x1ea5},
01003    {0x1ea6, 0x1ea7},
01004    {0x1ea8, 0x1ea9},
01005    {0x1eaa, 0x1eab},
01006    {0x1eac, 0x1ead},
01007    {0x1eae, 0x1eaf},
01008    {0x1eb0, 0x1eb1},
01009    {0x1eb2, 0x1eb3},
01010    {0x1eb4, 0x1eb5},
01011    {0x1eb6, 0x1eb7},
01012    {0x1eb8, 0x1eb9},
01013    {0x1eba, 0x1ebb},
01014    {0x1ebc, 0x1ebd},
01015    {0x1ebe, 0x1ebf},
01016    {0x1ec0, 0x1ec1},
01017    {0x1ec2, 0x1ec3},
01018    {0x1ec4, 0x1ec5},
01019    {0x1ec6, 0x1ec7},
01020    {0x1ec8, 0x1ec9},
01021    {0x1eca, 0x1ecb},
01022    {0x1ecc, 0x1ecd},
01023    {0x1ece, 0x1ecf},
01024    {0x1ed0, 0x1ed1},
01025    {0x1ed2, 0x1ed3},
01026    {0x1ed4, 0x1ed5},
01027    {0x1ed6, 0x1ed7},
01028    {0x1ed8, 0x1ed9},
01029    {0x1eda, 0x1edb},
01030    {0x1edc, 0x1edd},
01031    {0x1ede, 0x1edf},
01032    {0x1ee0, 0x1ee1},
01033    {0x1ee2, 0x1ee3},
01034    {0x1ee4, 0x1ee5},
01035    {0x1ee6, 0x1ee7},
01036    {0x1ee8, 0x1ee9},
01037    {0x1eea, 0x1eeb},
01038    {0x1eec, 0x1eed},
01039    {0x1eee, 0x1eef},
01040    {0x1ef0, 0x1ef1},
01041    {0x1ef2, 0x1ef3},
01042    {0x1ef4, 0x1ef5},
01043    {0x1ef6, 0x1ef7},
01044    {0x1ef8, 0x1ef9},
01045    {0x1f08, 0x1f00},
01046    {0x1f09, 0x1f01},
01047    {0x1f0a, 0x1f02},
01048    {0x1f0b, 0x1f03},
01049    {0x1f0c, 0x1f04},
01050    {0x1f0d, 0x1f05},
01051    {0x1f0e, 0x1f06},
01052    {0x1f0f, 0x1f07},
01053    {0x1f18, 0x1f10},
01054    {0x1f19, 0x1f11},
01055    {0x1f1a, 0x1f12},
01056    {0x1f1b, 0x1f13},
01057    {0x1f1c, 0x1f14},
01058    {0x1f1d, 0x1f15},
01059    {0x1f28, 0x1f20},
01060    {0x1f29, 0x1f21},
01061    {0x1f2a, 0x1f22},
01062    {0x1f2b, 0x1f23},
01063    {0x1f2c, 0x1f24},
01064    {0x1f2d, 0x1f25},
01065    {0x1f2e, 0x1f26},
01066    {0x1f2f, 0x1f27},
01067    {0x1f38, 0x1f30},
01068    {0x1f39, 0x1f31},
01069    {0x1f3a, 0x1f32},
01070    {0x1f3b, 0x1f33},
01071    {0x1f3c, 0x1f34},
01072    {0x1f3d, 0x1f35},
01073    {0x1f3e, 0x1f36},
01074    {0x1f3f, 0x1f37},
01075    {0x1f48, 0x1f40},
01076    {0x1f49, 0x1f41},
01077    {0x1f4a, 0x1f42},
01078    {0x1f4b, 0x1f43},
01079    {0x1f4c, 0x1f44},
01080    {0x1f4d, 0x1f45},
01081    {0x1f59, 0x1f51},
01082    {0x1f5b, 0x1f53},
01083    {0x1f5d, 0x1f55},
01084    {0x1f5f, 0x1f57},
01085    {0x1f68, 0x1f60},
01086    {0x1f69, 0x1f61},
01087    {0x1f6a, 0x1f62},
01088    {0x1f6b, 0x1f63},
01089    {0x1f6c, 0x1f64},
01090    {0x1f6d, 0x1f65},
01091    {0x1f6e, 0x1f66},
01092    {0x1f6f, 0x1f67},
01093    {0x1f88, 0x1f80},
01094    {0x1f89, 0x1f81},
01095    {0x1f8a, 0x1f82},
01096    {0x1f8b, 0x1f83},
01097    {0x1f8c, 0x1f84},
01098    {0x1f8d, 0x1f85},
01099    {0x1f8e, 0x1f86},
01100    {0x1f8f, 0x1f87},
01101    {0x1f98, 0x1f90},
01102    {0x1f99, 0x1f91},
01103    {0x1f9a, 0x1f92},
01104    {0x1f9b, 0x1f93},
01105    {0x1f9c, 0x1f94},
01106    {0x1f9d, 0x1f95},
01107    {0x1f9e, 0x1f96},
01108    {0x1f9f, 0x1f97},
01109    {0x1fa8, 0x1fa0},
01110    {0x1fa9, 0x1fa1},
01111    {0x1faa, 0x1fa2},
01112    {0x1fab, 0x1fa3},
01113    {0x1fac, 0x1fa4},
01114    {0x1fad, 0x1fa5},
01115    {0x1fae, 0x1fa6},
01116    {0x1faf, 0x1fa7},
01117    {0x1fb8, 0x1fb0},
01118    {0x1fb9, 0x1fb1},
01119    {0x1fba, 0x1f70},
01120    {0x1fbb, 0x1f71},
01121    {0x1fbc, 0x1fb3},
01122    {0x1fc8, 0x1f72},
01123    {0x1fc9, 0x1f73},
01124    {0x1fca, 0x1f74},
01125    {0x1fcb, 0x1f75},
01126    {0x1fcc, 0x1fc3},
01127    {0x1fd8, 0x1fd0},
01128    {0x1fd9, 0x1fd1},
01129    {0x1fda, 0x1f76},
01130    {0x1fdb, 0x1f77},
01131    {0x1fe8, 0x1fe0},
01132    {0x1fe9, 0x1fe1},
01133    {0x1fea, 0x1f7a},
01134    {0x1feb, 0x1f7b},
01135    {0x1fec, 0x1fe5},
01136    {0x1ff8, 0x1f78},
01137    {0x1ff9, 0x1f79},
01138    {0x1ffa, 0x1f7c},
01139    {0x1ffb, 0x1f7d},
01140    {0x1ffc, 0x1ff3},
01141    {0x2126, 0x3c9},
01142    {0x212a, 0x6b},
01143    {0x212b, 0xe5},
01144    {0x2160, 0x2170},
01145    {0x2161, 0x2171},
01146    {0x2162, 0x2172},
01147    {0x2163, 0x2173},
01148    {0x2164, 0x2174},
01149    {0x2165, 0x2175},
01150    {0x2166, 0x2176},
01151    {0x2167, 0x2177},
01152    {0x2168, 0x2178},
01153    {0x2169, 0x2179},
01154    {0x216a, 0x217a},
01155    {0x216b, 0x217b},
01156    {0x216c, 0x217c},
01157    {0x216d, 0x217d},
01158    {0x216e, 0x217e},
01159    {0x216f, 0x217f},
01160    {0x24b6, 0x24d0},
01161    {0x24b7, 0x24d1},
01162    {0x24b8, 0x24d2},
01163    {0x24b9, 0x24d3},
01164    {0x24ba, 0x24d4},
01165    {0x24bb, 0x24d5},
01166    {0x24bc, 0x24d6},
01167    {0x24bd, 0x24d7},
01168    {0x24be, 0x24d8},
01169    {0x24bf, 0x24d9},
01170    {0x24c0, 0x24da},
01171    {0x24c1, 0x24db},
01172    {0x24c2, 0x24dc},
01173    {0x24c3, 0x24dd},
01174    {0x24c4, 0x24de},
01175    {0x24c5, 0x24df},
01176    {0x24c6, 0x24e0},
01177    {0x24c7, 0x24e1},
01178    {0x24c8, 0x24e2},
01179    {0x24c9, 0x24e3},
01180    {0x24ca, 0x24e4},
01181    {0x24cb, 0x24e5},
01182    {0x24cc, 0x24e6},
01183    {0x24cd, 0x24e7},
01184    {0x24ce, 0x24e8},
01185    {0x24cf, 0x24e9},
01186    {0xff21, 0xff41},
01187    {0xff22, 0xff42},
01188    {0xff23, 0xff43},
01189    {0xff24, 0xff44},
01190    {0xff25, 0xff45},
01191    {0xff26, 0xff46},
01192    {0xff27, 0xff47},
01193    {0xff28, 0xff48},
01194    {0xff29, 0xff49},
01195    {0xff2a, 0xff4a},
01196    {0xff2b, 0xff4b},
01197    {0xff2c, 0xff4c},
01198    {0xff2d, 0xff4d},
01199    {0xff2e, 0xff4e},
01200    {0xff2f, 0xff4f},
01201    {0xff30, 0xff50},
01202    {0xff31, 0xff51},
01203    {0xff32, 0xff52},
01204    {0xff33, 0xff53},
01205    {0xff34, 0xff54},
01206    {0xff35, 0xff55},
01207    {0xff36, 0xff56},
01208    {0xff37, 0xff57},
01209    {0xff38, 0xff58},
01210    {0xff39, 0xff59},
01211    {0xff3a, 0xff5a},
01212    {0x10400, 0x10428},
01213    {0x10401, 0x10429},
01214    {0x10402, 0x1042a},
01215    {0x10403, 0x1042b},
01216    {0x10404, 0x1042c},
01217    {0x10405, 0x1042d},
01218    {0x10406, 0x1042e},
01219    {0x10407, 0x1042f},
01220    {0x10408, 0x10430},
01221    {0x10409, 0x10431},
01222    {0x1040a, 0x10432},
01223    {0x1040b, 0x10433},
01224    {0x1040c, 0x10434},
01225    {0x1040d, 0x10435},
01226    {0x1040e, 0x10436},
01227    {0x1040f, 0x10437},
01228    {0x10410, 0x10438},
01229    {0x10411, 0x10439},
01230    {0x10412, 0x1043a},
01231    {0x10413, 0x1043b},
01232    {0x10414, 0x1043c},
01233    {0x10415, 0x1043d},
01234    {0x10416, 0x1043e},
01235    {0x10417, 0x1043f},
01236    {0x10418, 0x10440},
01237    {0x10419, 0x10441},
01238    {0x1041a, 0x10442},
01239    {0x1041b, 0x10443},
01240    {0x1041c, 0x10444},
01241    {0x1041d, 0x10445},
01242    {0x1041e, 0x10446},
01243    {0x1041f, 0x10447},
01244    {0x10420, 0x10448},
01245    {0x10421, 0x10449},
01246    {0x10422, 0x1044a},
01247    {0x10423, 0x1044b},
01248    {0x10424, 0x1044c},
01249    {0x10425, 0x1044d},
01250    {0x10426, 0x1044e},
01251    {0x10427, 0x1044f},
01252 };
01253 
01254 const CaseMapping upperMappings[] =
01255 {
01256    {0x61, 0x41},
01257    {0x62, 0x42},
01258    {0x63, 0x43},
01259    {0x64, 0x44},
01260    {0x65, 0x45},
01261    {0x66, 0x46},
01262    {0x67, 0x47},
01263    {0x68, 0x48},
01264    {0x69, 0x49},
01265    {0x6a, 0x4a},
01266    {0x6b, 0x4b},
01267    {0x6c, 0x4c},
01268    {0x6d, 0x4d},
01269    {0x6e, 0x4e},
01270    {0x6f, 0x4f},
01271    {0x70, 0x50},
01272    {0x71, 0x51},
01273    {0x72, 0x52},
01274    {0x73, 0x53},
01275    {0x74, 0x54},
01276    {0x75, 0x55},
01277    {0x76, 0x56},
01278    {0x77, 0x57},
01279    {0x78, 0x58},
01280    {0x79, 0x59},
01281    {0x7a, 0x5a},
01282    {0xb5, 0x39c},
01283    {0xe0, 0xc0},
01284    {0xe1, 0xc1},
01285    {0xe2, 0xc2},
01286    {0xe3, 0xc3},
01287    {0xe4, 0xc4},
01288    {0xe5, 0xc5},
01289    {0xe6, 0xc6},
01290    {0xe7, 0xc7},
01291    {0xe8, 0xc8},
01292    {0xe9, 0xc9},
01293    {0xea, 0xca},
01294    {0xeb, 0xcb},
01295    {0xec, 0xcc},
01296    {0xed, 0xcd},
01297    {0xee, 0xce},
01298    {0xef, 0xcf},
01299    {0xf0, 0xd0},
01300    {0xf1, 0xd1},
01301    {0xf2, 0xd2},
01302    {0xf3, 0xd3},
01303    {0xf4, 0xd4},
01304    {0xf5, 0xd5},
01305    {0xf6, 0xd6},
01306    {0xf8, 0xd8},
01307    {0xf9, 0xd9},
01308    {0xfa, 0xda},
01309    {0xfb, 0xdb},
01310    {0xfc, 0xdc},
01311    {0xfd, 0xdd},
01312    {0xfe, 0xde},
01313    {0xff, 0x178},
01314    {0x101, 0x100},
01315    {0x103, 0x102},
01316    {0x105, 0x104},
01317    {0x107, 0x106},
01318    {0x109, 0x108},
01319    {0x10b, 0x10a},
01320    {0x10d, 0x10c},
01321    {0x10f, 0x10e},
01322    {0x111, 0x110},
01323    {0x113, 0x112},
01324    {0x115, 0x114},
01325    {0x117, 0x116},
01326    {0x119, 0x118},
01327    {0x11b, 0x11a},
01328    {0x11d, 0x11c},
01329    {0x11f, 0x11e},
01330    {0x121, 0x120},
01331    {0x123, 0x122},
01332    {0x125, 0x124},
01333    {0x127, 0x126},
01334    {0x129, 0x128},
01335    {0x12b, 0x12a},
01336    {0x12d, 0x12c},
01337    {0x12f, 0x12e},
01338    {0x131, 0x49},
01339    {0x133, 0x132},
01340    {0x135, 0x134},
01341    {0x137, 0x136},
01342    {0x13a, 0x139},
01343    {0x13c, 0x13b},
01344    {0x13e, 0x13d},
01345    {0x140, 0x13f},
01346    {0x142, 0x141},
01347    {0x144, 0x143},
01348    {0x146, 0x145},
01349    {0x148, 0x147},
01350    {0x14b, 0x14a},
01351    {0x14d, 0x14c},
01352    {0x14f, 0x14e},
01353    {0x151, 0x150},
01354    {0x153, 0x152},
01355    {0x155, 0x154},
01356    {0x157, 0x156},
01357    {0x159, 0x158},
01358    {0x15b, 0x15a},
01359    {0x15d, 0x15c},
01360    {0x15f, 0x15e},
01361    {0x161, 0x160},
01362    {0x163, 0x162},
01363    {0x165, 0x164},
01364    {0x167, 0x166},
01365    {0x169, 0x168},
01366    {0x16b, 0x16a},
01367    {0x16d, 0x16c},
01368    {0x16f, 0x16e},
01369    {0x171, 0x170},
01370    {0x173, 0x172},
01371    {0x175, 0x174},
01372    {0x177, 0x176},
01373    {0x17a, 0x179},
01374    {0x17c, 0x17b},
01375    {0x17e, 0x17d},
01376    {0x17f, 0x53},
01377    {0x183, 0x182},
01378    {0x185, 0x184},
01379    {0x188, 0x187},
01380    {0x18c, 0x18b},
01381    {0x192, 0x191},
01382    {0x195, 0x1f6},
01383    {0x199, 0x198},
01384    {0x19e, 0x220},
01385    {0x1a1, 0x1a0},
01386    {0x1a3, 0x1a2},
01387    {0x1a5, 0x1a4},
01388    {0x1a8, 0x1a7},
01389    {0x1ad, 0x1ac},
01390    {0x1b0, 0x1af},
01391    {0x1b4, 0x1b3},
01392    {0x1b6, 0x1b5},
01393    {0x1b9, 0x1b8},
01394    {0x1bd, 0x1bc},
01395    {0x1bf, 0x1f7},
01396    {0x1c5, 0x1c4},
01397    {0x1c6, 0x1c4},
01398    {0x1c8, 0x1c7},
01399    {0x1c9, 0x1c7},
01400    {0x1cb, 0x1ca},
01401    {0x1cc, 0x1ca},
01402    {0x1ce, 0x1cd},
01403    {0x1d0, 0x1cf},
01404    {0x1d2, 0x1d1},
01405    {0x1d4, 0x1d3},
01406    {0x1d6, 0x1d5},
01407    {0x1d8, 0x1d7},
01408    {0x1da, 0x1d9},
01409    {0x1dc, 0x1db},
01410    {0x1dd, 0x18e},
01411    {0x1df, 0x1de},
01412    {0x1e1, 0x1e0},
01413    {0x1e3, 0x1e2},
01414    {0x1e5, 0x1e4},
01415    {0x1e7, 0x1e6},
01416    {0x1e9, 0x1e8},
01417    {0x1eb, 0x1ea},
01418    {0x1ed, 0x1ec},
01419    {0x1ef, 0x1ee},
01420    {0x1f2, 0x1f1},
01421    {0x1f3, 0x1f1},
01422    {0x1f5, 0x1f4},
01423    {0x1f9, 0x1f8},
01424    {0x1fb, 0x1fa},
01425    {0x1fd, 0x1fc},
01426    {0x1ff, 0x1fe},
01427    {0x201, 0x200},
01428    {0x203, 0x202},
01429    {0x205, 0x204},
01430    {0x207, 0x206},
01431    {0x209, 0x208},
01432    {0x20b, 0x20a},
01433    {0x20d, 0x20c},
01434    {0x20f, 0x20e},
01435    {0x211, 0x210},
01436    {0x213, 0x212},
01437    {0x215, 0x214},
01438    {0x217, 0x216},
01439    {0x219, 0x218},
01440    {0x21b, 0x21a},
01441    {0x21d, 0x21c},
01442    {0x21f, 0x21e},
01443    {0x223, 0x222},
01444    {0x225, 0x224},
01445    {0x227, 0x226},
01446    {0x229, 0x228},
01447    {0x22b, 0x22a},
01448    {0x22d, 0x22c},
01449    {0x22f, 0x22e},
01450    {0x231, 0x230},
01451    {0x233, 0x232},
01452    {0x253, 0x181},
01453    {0x254, 0x186},
01454    {0x256, 0x189},
01455    {0x257, 0x18a},
01456    {0x259, 0x18f},
01457    {0x25b, 0x190},
01458    {0x260, 0x193},
01459    {0x263, 0x194},
01460    {0x268, 0x197},
01461    {0x269, 0x196},
01462    {0x26f, 0x19c},
01463    {0x272, 0x19d},
01464    {0x275, 0x19f},
01465    {0x280, 0x1a6},
01466    {0x283, 0x1a9},
01467    {0x288, 0x1ae},
01468    {0x28a, 0x1b1},
01469    {0x28b, 0x1b2},
01470    {0x292, 0x1b7},
01471    {0x345, 0x399},
01472    {0x3ac, 0x386},
01473    {0x3ad, 0x388},
01474    {0x3ae, 0x389},
01475    {0x3af, 0x38a},
01476    {0x3b1, 0x391},
01477    {0x3b2, 0x392},
01478    {0x3b3, 0x393},
01479    {0x3b4, 0x394},
01480    {0x3b5, 0x395},
01481    {0x3b6, 0x396},
01482    {0x3b7, 0x397},
01483    {0x3b8, 0x398},
01484    {0x3b9, 0x399},
01485    {0x3ba, 0x39a},
01486    {0x3bb, 0x39b},
01487    {0x3bc, 0x39c},
01488    {0x3bd, 0x39d},
01489    {0x3be, 0x39e},
01490    {0x3bf, 0x39f},
01491    {0x3c0, 0x3a0},
01492    {0x3c1, 0x3a1},
01493    {0x3c2, 0x3a3},
01494    {0x3c3, 0x3a3},
01495    {0x3c4, 0x3a4},
01496    {0x3c5, 0x3a5},
01497    {0x3c6, 0x3a6},
01498    {0x3c7, 0x3a7},
01499    {0x3c8, 0x3a8},
01500    {0x3c9, 0x3a9},
01501    {0x3ca, 0x3aa},
01502    {0x3cb, 0x3ab},
01503    {0x3cc, 0x38c},
01504    {0x3cd, 0x38e},
01505    {0x3ce, 0x38f},
01506    {0x3d0, 0x392},
01507    {0x3d1, 0x398},
01508    {0x3d5, 0x3a6},
01509    {0x3d6, 0x3a0},
01510    {0x3d9, 0x3d8},
01511    {0x3db, 0x3da},
01512    {0x3dd, 0x3dc},
01513    {0x3df, 0x3de},
01514    {0x3e1, 0x3e0},
01515    {0x3e3, 0x3e2},
01516    {0x3e5, 0x3e4},
01517    {0x3e7, 0x3e6},
01518    {0x3e9, 0x3e8},
01519    {0x3eb, 0x3ea},
01520    {0x3ed, 0x3ec},
01521    {0x3ef, 0x3ee},
01522    {0x3f0, 0x39a},
01523    {0x3f1, 0x3a1},
01524    {0x3f2, 0x3f9},
01525    {0x3f5, 0x395},
01526    {0x3f8, 0x3f7},
01527    {0x3fb, 0x3fa},
01528    {0x430, 0x410},
01529    {0x431, 0x411},
01530    {0x432, 0x412},
01531    {0x433, 0x413},
01532    {0x434, 0x414},
01533    {0x435, 0x415},
01534    {0x436, 0x416},
01535    {0x437, 0x417},
01536    {0x438, 0x418},
01537    {0x439, 0x419},
01538    {0x43a, 0x41a},
01539    {0x43b, 0x41b},
01540    {0x43c, 0x41c},
01541    {0x43d, 0x41d},
01542    {0x43e, 0x41e},
01543    {0x43f, 0x41f},
01544    {0x440, 0x420},
01545    {0x441, 0x421},
01546    {0x442, 0x422},
01547    {0x443, 0x423},
01548    {0x444, 0x424},
01549    {0x445, 0x425},
01550    {0x446, 0x426},
01551    {0x447, 0x427},
01552    {0x448, 0x428},
01553    {0x449, 0x429},
01554    {0x44a, 0x42a},
01555    {0x44b, 0x42b},
01556    {0x44c, 0x42c},
01557    {0x44d, 0x42d},
01558    {0x44e, 0x42e},
01559    {0x44f, 0x42f},
01560    {0x450, 0x400},
01561    {0x451, 0x401},
01562    {0x452, 0x402},
01563    {0x453, 0x403},
01564    {0x454, 0x404},
01565    {0x455, 0x405},
01566    {0x456, 0x406},
01567    {0x457, 0x407},
01568    {0x458, 0x408},
01569    {0x459, 0x409},
01570    {0x45a, 0x40a},
01571    {0x45b, 0x40b},
01572    {0x45c, 0x40c},
01573    {0x45d, 0x40d},
01574    {0x45e, 0x40e},
01575    {0x45f, 0x40f},
01576    {0x461, 0x460},
01577    {0x463, 0x462},
01578    {0x465, 0x464},
01579    {0x467, 0x466},
01580    {0x469, 0x468},
01581    {0x46b, 0x46a},
01582    {0x46d, 0x46c},
01583    {0x46f, 0x46e},
01584    {0x471, 0x470},
01585    {0x473, 0x472},
01586    {0x475, 0x474},
01587    {0x477, 0x476},
01588    {0x479, 0x478},
01589    {0x47b, 0x47a},
01590    {0x47d, 0x47c},
01591    {0x47f, 0x47e},
01592    {0x481, 0x480},
01593    {0x48b, 0x48a},
01594    {0x48d, 0x48c},
01595    {0x48f, 0x48e},
01596    {0x491, 0x490},
01597    {0x493, 0x492},
01598    {0x495, 0x494},
01599    {0x497, 0x496},
01600    {0x499, 0x498},
01601    {0x49b, 0x49a},
01602    {0x49d, 0x49c},
01603    {0x49f, 0x49e},
01604    {0x4a1, 0x4a0},
01605    {0x4a3, 0x4a2},
01606    {0x4a5, 0x4a4},
01607    {0x4a7, 0x4a6},
01608    {0x4a9, 0x4a8},
01609    {0x4ab, 0x4aa},
01610    {0x4ad, 0x4ac},
01611    {0x4af, 0x4ae},
01612    {0x4b1, 0x4b0},
01613    {0x4b3, 0x4b2},
01614    {0x4b5, 0x4b4},
01615    {0x4b7, 0x4b6},
01616    {0x4b9, 0x4b8},
01617    {0x4bb, 0x4ba},
01618    {0x4bd, 0x4bc},
01619    {0x4bf, 0x4be},
01620    {0x4c2, 0x4c1},
01621    {0x4c4, 0x4c3},
01622    {0x4c6, 0x4c5},
01623    {0x4c8, 0x4c7},
01624    {0x4ca, 0x4c9},
01625    {0x4cc, 0x4cb},
01626    {0x4ce, 0x4cd},
01627    {0x4d1, 0x4d0},
01628    {0x4d3, 0x4d2},
01629    {0x4d5, 0x4d4},
01630    {0x4d7, 0x4d6},
01631    {0x4d9, 0x4d8},
01632    {0x4db, 0x4da},
01633    {0x4dd, 0x4dc},
01634    {0x4df, 0x4de},
01635    {0x4e1, 0x4e0},
01636    {0x4e3, 0x4e2},
01637    {0x4e5, 0x4e4},
01638    {0x4e7, 0x4e6},
01639    {0x4e9, 0x4e8},
01640    {0x4eb, 0x4ea},
01641    {0x4ed, 0x4ec},
01642    {0x4ef, 0x4ee},
01643    {0x4f1, 0x4f0},
01644    {0x4f3, 0x4f2},
01645    {0x4f5, 0x4f4},
01646    {0x4f9, 0x4f8},
01647    {0x501, 0x500},
01648    {0x503, 0x502},
01649    {0x505, 0x504},
01650    {0x507, 0x506},
01651    {0x509, 0x508},
01652    {0x50b, 0x50a},
01653    {0x50d, 0x50c},
01654    {0x50f, 0x50e},
01655    {0x561, 0x531},
01656    {0x562, 0x532},
01657    {0x563, 0x533},
01658    {0x564, 0x534},
01659    {0x565, 0x535},
01660    {0x566, 0x536},
01661    {0x567, 0x537},
01662    {0x568, 0x538},
01663    {0x569, 0x539},
01664    {0x56a, 0x53a},
01665    {0x56b, 0x53b},
01666    {0x56c, 0x53c},
01667    {0x56d, 0x53d},
01668    {0x56e, 0x53e},
01669    {0x56f, 0x53f},
01670    {0x570, 0x540},
01671    {0x571, 0x541},
01672    {0x572, 0x542},
01673    {0x573, 0x543},
01674    {0x574, 0x544},
01675    {0x575, 0x545},
01676    {0x576, 0x546},
01677    {0x577, 0x547},
01678    {0x578, 0x548},
01679    {0x579, 0x549},
01680    {0x57a, 0x54a},
01681    {0x57b, 0x54b},
01682    {0x57c, 0x54c},
01683    {0x57d, 0x54d},
01684    {0x57e, 0x54e},
01685    {0x57f, 0x54f},
01686    {0x580, 0x550},
01687    {0x581, 0x551},
01688    {0x582, 0x552},
01689    {0x583, 0x553},
01690    {0x584, 0x554},
01691    {0x585, 0x555},
01692    {0x586, 0x556},
01693    {0x1e01, 0x1e00},
01694    {0x1e03, 0x1e02},
01695    {0x1e05, 0x1e04},
01696    {0x1e07, 0x1e06},
01697    {0x1e09, 0x1e08},
01698    {0x1e0b, 0x1e0a},
01699    {0x1e0d, 0x1e0c},
01700    {0x1e0f, 0x1e0e},
01701    {0x1e11, 0x1e10},
01702    {0x1e13, 0x1e12},
01703    {0x1e15, 0x1e14},
01704    {0x1e17, 0x1e16},
01705    {0x1e19, 0x1e18},
01706    {0x1e1b, 0x1e1a},
01707    {0x1e1d, 0x1e1c},
01708    {0x1e1f, 0x1e1e},
01709    {0x1e21, 0x1e20},
01710    {0x1e23, 0x1e22},
01711    {0x1e25, 0x1e24},
01712    {0x1e27, 0x1e26},
01713    {0x1e29, 0x1e28},
01714    {0x1e2b, 0x1e2a},
01715    {0x1e2d, 0x1e2c},
01716    {0x1e2f, 0x1e2e},
01717    {0x1e31, 0x1e30},
01718    {0x1e33, 0x1e32},
01719    {0x1e35, 0x1e34},
01720    {0x1e37, 0x1e36},
01721    {0x1e39, 0x1e38},
01722    {0x1e3b, 0x1e3a},
01723    {0x1e3d, 0x1e3c},
01724    {0x1e3f, 0x1e3e},
01725    {0x1e41, 0x1e40},
01726    {0x1e43, 0x1e42},
01727    {0x1e45, 0x1e44},
01728    {0x1e47, 0x1e46},
01729    {0x1e49, 0x1e48},
01730    {0x1e4b, 0x1e4a},
01731    {0x1e4d, 0x1e4c},
01732    {0x1e4f, 0x1e4e},
01733    {0x1e51, 0x1e50},
01734    {0x1e53, 0x1e52},
01735    {0x1e55, 0x1e54},
01736    {0x1e57, 0x1e56},
01737    {0x1e59, 0x1e58},
01738    {0x1e5b, 0x1e5a},
01739    {0x1e5d, 0x1e5c},
01740    {0x1e5f, 0x1e5e},
01741    {0x1e61, 0x1e60},
01742    {0x1e63, 0x1e62},
01743    {0x1e65, 0x1e64},
01744    {0x1e67, 0x1e66},
01745    {0x1e69, 0x1e68},
01746    {0x1e6b, 0x1e6a},
01747    {0x1e6d, 0x1e6c},
01748    {0x1e6f, 0x1e6e},
01749    {0x1e71, 0x1e70},
01750    {0x1e73, 0x1e72},
01751    {0x1e75, 0x1e74},
01752    {0x1e77, 0x1e76},
01753    {0x1e79, 0x1e78},
01754    {0x1e7b, 0x1e7a},
01755    {0x1e7d, 0x1e7c},
01756    {0x1e7f, 0x1e7e},
01757    {0x1e81, 0x1e80},
01758    {0x1e83, 0x1e82},
01759    {0x1e85, 0x1e84},
01760    {0x1e87, 0x1e86},
01761    {0x1e89, 0x1e88},
01762    {0x1e8b, 0x1e8a},
01763    {0x1e8d, 0x1e8c},
01764    {0x1e8f, 0x1e8e},
01765    {0x1e91, 0x1e90},
01766    {0x1e93, 0x1e92},
01767    {0x1e95, 0x1e94},
01768    {0x1e9b, 0x1e60},
01769    {0x1ea1, 0x1ea0},
01770    {0x1ea3, 0x1ea2},
01771    {0x1ea5, 0x1ea4},
01772    {0x1ea7, 0x1ea6},
01773    {0x1ea9, 0x1ea8},
01774    {0x1eab, 0x1eaa},
01775    {0x1ead, 0x1eac},
01776    {0x1eaf, 0x1eae},
01777    {0x1eb1, 0x1eb0},
01778    {0x1eb3, 0x1eb2},
01779    {0x1eb5, 0x1eb4},
01780    {0x1eb7, 0x1eb6},
01781    {0x1eb9, 0x1eb8},
01782    {0x1ebb, 0x1eba},
01783    {0x1ebd, 0x1ebc},
01784    {0x1ebf, 0x1ebe},
01785    {0x1ec1, 0x1ec0},
01786    {0x1ec3, 0x1ec2},
01787    {0x1ec5, 0x1ec4},
01788    {0x1ec7, 0x1ec6},
01789    {0x1ec9, 0x1ec8},
01790    {0x1ecb, 0x1eca},
01791    {0x1ecd, 0x1ecc},
01792    {0x1ecf, 0x1ece},
01793    {0x1ed1, 0x1ed0},
01794    {0x1ed3, 0x1ed2},
01795    {0x1ed5, 0x1ed4},
01796    {0x1ed7, 0x1ed6},
01797    {0x1ed9, 0x1ed8},
01798    {0x1edb, 0x1eda},
01799    {0x1edd, 0x1edc},
01800    {0x1edf, 0x1ede},
01801    {0x1ee1, 0x1ee0},
01802    {0x1ee3, 0x1ee2},
01803    {0x1ee5, 0x1ee4},
01804    {0x1ee7, 0x1ee6},
01805    {0x1ee9, 0x1ee8},
01806    {0x1eeb, 0x1eea},
01807    {0x1eed, 0x1eec},
01808    {0x1eef, 0x1eee},
01809    {0x1ef1, 0x1ef0},
01810    {0x1ef3, 0x1ef2},
01811    {0x1ef5, 0x1ef4},
01812    {0x1ef7, 0x1ef6},
01813    {0x1ef9, 0x1ef8},
01814    {0x1f00, 0x1f08},
01815    {0x1f01, 0x1f09},
01816    {0x1f02, 0x1f0a},
01817    {0x1f03, 0x1f0b},
01818    {0x1f04, 0x1f0c},
01819    {0x1f05, 0x1f0d},
01820    {0x1f06, 0x1f0e},
01821    {0x1f07, 0x1f0f},
01822    {0x1f10, 0x1f18},
01823    {0x1f11, 0x1f19},
01824    {0x1f12, 0x1f1a},
01825    {0x1f13, 0x1f1b},
01826    {0x1f14, 0x1f1c},
01827    {0x1f15, 0x1f1d},
01828    {0x1f20, 0x1f28},
01829    {0x1f21, 0x1f29},
01830    {0x1f22, 0x1f2a},
01831    {0x1f23, 0x1f2b},
01832    {0x1f24, 0x1f2c},
01833    {0x1f25, 0x1f2d},
01834    {0x1f26, 0x1f2e},
01835    {0x1f27, 0x1f2f},
01836    {0x1f30, 0x1f38},
01837    {0x1f31, 0x1f39},
01838    {0x1f32, 0x1f3a},
01839    {0x1f33, 0x1f3b},
01840    {0x1f34, 0x1f3c},
01841    {0x1f35, 0x1f3d},
01842    {0x1f36, 0x1f3e},
01843    {0x1f37, 0x1f3f},
01844    {0x1f40, 0x1f48},
01845    {0x1f41, 0x1f49},
01846    {0x1f42, 0x1f4a},
01847    {0x1f43, 0x1f4b},
01848    {0x1f44, 0x1f4c},
01849    {0x1f45, 0x1f4d},
01850    {0x1f51, 0x1f59},
01851    {0x1f53, 0x1f5b},
01852    {0x1f55, 0x1f5d},
01853    {0x1f57, 0x1f5f},
01854    {0x1f60, 0x1f68},
01855    {0x1f61, 0x1f69},
01856    {0x1f62, 0x1f6a},
01857    {0x1f63, 0x1f6b},
01858    {0x1f64, 0x1f6c},
01859    {0x1f65, 0x1f6d},
01860    {0x1f66, 0x1f6e},
01861    {0x1f67, 0x1f6f},
01862    {0x1f70, 0x1fba},
01863    {0x1f71, 0x1fbb},
01864    {0x1f72, 0x1fc8},
01865    {0x1f73, 0x1fc9},
01866    {0x1f74, 0x1fca},
01867    {0x1f75, 0x1fcb},
01868    {0x1f76, 0x1fda},
01869    {0x1f77, 0x1fdb},
01870    {0x1f78, 0x1ff8},
01871    {0x1f79, 0x1ff9},
01872    {0x1f7a, 0x1fea},
01873    {0x1f7b, 0x1feb},
01874    {0x1f7c, 0x1ffa},
01875    {0x1f7d, 0x1ffb},
01876    {0x1f80, 0x1f88},
01877    {0x1f81, 0x1f89},
01878    {0x1f82, 0x1f8a},
01879    {0x1f83, 0x1f8b},
01880    {0x1f84, 0x1f8c},
01881    {0x1f85, 0x1f8d},
01882    {0x1f86, 0x1f8e},
01883    {0x1f87, 0x1f8f},
01884    {0x1f90, 0x1f98},
01885    {0x1f91, 0x1f99},
01886    {0x1f92, 0x1f9a},
01887    {0x1f93, 0x1f9b},
01888    {0x1f94, 0x1f9c},
01889    {0x1f95, 0x1f9d},
01890    {0x1f96, 0x1f9e},
01891    {0x1f97, 0x1f9f},
01892    {0x1fa0, 0x1fa8},
01893    {0x1fa1, 0x1fa9},
01894    {0x1fa2, 0x1faa},
01895    {0x1fa3, 0x1fab},
01896    {0x1fa4, 0x1fac},
01897    {0x1fa5, 0x1fad},
01898    {0x1fa6, 0x1fae},
01899    {0x1fa7, 0x1faf},
01900    {0x1fb0, 0x1fb8},
01901    {0x1fb1, 0x1fb9},
01902    {0x1fb3, 0x1fbc},
01903    {0x1fbe, 0x399},
01904    {0x1fc3, 0x1fcc},
01905    {0x1fd0, 0x1fd8},
01906    {0x1fd1, 0x1fd9},
01907    {0x1fe0, 0x1fe8},
01908    {0x1fe1, 0x1fe9},
01909    {0x1fe5, 0x1fec},
01910    {0x1ff3, 0x1ffc},
01911    {0x2170, 0x2160},
01912    {0x2171, 0x2161},
01913    {0x2172, 0x2162},
01914    {0x2173, 0x2163},
01915    {0x2174, 0x2164},
01916    {0x2175, 0x2165},
01917    {0x2176, 0x2166},
01918    {0x2177, 0x2167},
01919    {0x2178, 0x2168},
01920    {0x2179, 0x2169},
01921    {0x217a, 0x216a},
01922    {0x217b, 0x216b},
01923    {0x217c, 0x216c},
01924    {0x217d, 0x216d},
01925    {0x217e, 0x216e},
01926    {0x217f, 0x216f},
01927    {0x24d0, 0x24b6},
01928    {0x24d1, 0x24b7},
01929    {0x24d2, 0x24b8},
01930    {0x24d3, 0x24b9},
01931    {0x24d4, 0x24ba},
01932    {0x24d5, 0x24bb},
01933    {0x24d6, 0x24bc},
01934    {0x24d7, 0x24bd},
01935    {0x24d8, 0x24be},
01936    {0x24d9, 0x24bf},
01937    {0x24da, 0x24c0},
01938    {0x24db, 0x24c1},
01939    {0x24dc, 0x24c2},
01940    {0x24dd, 0x24c3},
01941    {0x24de, 0x24c4},
01942    {0x24df, 0x24c5},
01943    {0x24e0, 0x24c6},
01944    {0x24e1, 0x24c7},
01945    {0x24e2, 0x24c8},
01946    {0x24e3, 0x24c9},
01947    {0x24e4, 0x24ca},
01948    {0x24e5, 0x24cb},
01949    {0x24e6, 0x24cc},
01950    {0x24e7, 0x24cd},
01951    {0x24e8, 0x24ce},
01952    {0x24e9, 0x24cf},
01953    {0xff41, 0xff21},
01954    {0xff42, 0xff22},
01955    {0xff43, 0xff23},
01956    {0xff44, 0xff24},
01957    {0xff45, 0xff25},
01958    {0xff46, 0xff26},
01959    {0xff47, 0xff27},
01960    {0xff48, 0xff28},
01961    {0xff49, 0xff29},
01962    {0xff4a, 0xff2a},
01963    {0xff4b, 0xff2b},
01964    {0xff4c, 0xff2c},
01965    {0xff4d, 0xff2d},
01966    {0xff4e, 0xff2e},
01967    {0xff4f, 0xff2f},
01968    {0xff50, 0xff30},
01969    {0xff51, 0xff31},
01970    {0xff52, 0xff32},
01971    {0xff53, 0xff33},
01972    {0xff54, 0xff34},
01973    {0xff55, 0xff35},
01974    {0xff56, 0xff36},
01975    {0xff57, 0xff37},
01976    {0xff58, 0xff38},
01977    {0xff59, 0xff39},
01978    {0xff5a, 0xff3a},
01979    {0x10428, 0x10400},
01980    {0x10429, 0x10401},
01981    {0x1042a, 0x10402},
01982    {0x1042b, 0x10403},
01983    {0x1042c, 0x10404},
01984    {0x1042d, 0x10405},
01985    {0x1042e, 0x10406},
01986    {0x1042f, 0x10407},
01987    {0x10430, 0x10408},
01988    {0x10431, 0x10409},
01989    {0x10432, 0x1040a},
01990    {0x10433, 0x1040b},
01991    {0x10434, 0x1040c},
01992    {0x10435, 0x1040d},
01993    {0x10436, 0x1040e},
01994    {0x10437, 0x1040f},
01995    {0x10438, 0x10410},
01996    {0x10439, 0x10411},
01997    {0x1043a, 0x10412},
01998    {0x1043b, 0x10413},
01999    {0x1043c, 0x10414},
02000    {0x1043d, 0x10415},
02001    {0x1043e, 0x10416},
02002    {0x1043f, 0x10417},
02003    {0x10440, 0x10418},
02004    {0x10441, 0x10419},
02005    {0x10442, 0x1041a},
02006    {0x10443, 0x1041b},
02007    {0x10444, 0x1041c},
02008    {0x10445, 0x1041d},
02009    {0x10446, 0x1041e},
02010    {0x10447, 0x1041f},
02011    {0x10448, 0x10420},
02012    {0x10449, 0x10421},
02013    {0x1044a, 0x10422},
02014    {0x1044b, 0x10423},
02015    {0x1044c, 0x10424},
02016    {0x1044d, 0x10425},
02017    {0x1044e, 0x10426},
02018    {0x1044f, 0x10427},
02019 };
02020 
02021 const CaseMapping* const lowerMappingsEnd = lowerMappings +
02022    (sizeof(lowerMappings)/sizeof(lowerMappings[0]));
02023 
02024 const CaseMapping* const upperMappingsEnd = upperMappings +
02025    (sizeof(upperMappings)/sizeof(upperMappings[0]));
02026 
02027 struct MappingOrdering
02028 {
02029    bool operator()(const CaseMapping& x, const CaseMapping& y)
02030    {
02031       return x.codePoint < y.codePoint;
02032    }
02033 };
02034 
02035 struct Transformer
02036 {
02037    Transformer(const CaseMapping* const begin, const CaseMapping* const end)
02038       : m_begin(begin)
02039       , m_end(end)
02040    {
02041    }
02042 
02043    UInt32 operator()(UInt32 in) const
02044    {
02045       CaseMapping val = { in, 0 };
02046       const CaseMapping* i = std::lower_bound(m_begin, m_end, val, MappingOrdering());
02047       if (i == m_end || i->codePoint != in)
02048       {
02049          return in;
02050       }
02051       else
02052       {
02053          return i->mapping;
02054       }
02055    }
02056    const CaseMapping* const m_begin;
02057    const CaseMapping* const m_end;
02058 };
02059 
02060 } // end unnamed namespace
02061 
02063 bool toUpperCaseInPlace(char* input)
02064 {
02065    return transformInPlace(input, Transformer(upperMappings, upperMappingsEnd));
02066 }
02067 
02069 String toUpperCase(const char* input)
02070 {
02071    return transform(input, Transformer(upperMappings, upperMappingsEnd));
02072 }
02073 
02075 bool toLowerCaseInPlace(char* input)
02076 {
02077    return transformInPlace(input, Transformer(lowerMappings, lowerMappingsEnd));
02078 }
02079 
02081 String toLowerCase(const char* input)
02082 {
02083    return transform(input, Transformer(lowerMappings, lowerMappingsEnd));
02084 }
02085 
02086 } // end namespace OW_UTF8Utils
02087 
02088 } // end namespace OW_NAMESPACE
02089 
02090 

Generated on Thu Feb 9 08:48:17 2006 for openwbem by  doxygen 1.4.6