Imported version 0.2-1 v0.2-1
authorRoman Moravcik <roman.moravcik@gmail.com>
Thu, 18 Feb 2010 16:16:28 +0000 (17:16 +0100)
committerRoman Moravcik <roman.moravcik@gmail.com>
Thu, 18 Feb 2010 16:16:28 +0000 (17:16 +0100)
112 files changed:
AUTHORS [new file with mode: 0644]
COPYING [new file with mode: 0644]
INSTALL [new file with mode: 0644]
Makefile.am [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
configure.ac [new file with mode: 0644]
data/Makefile.am [new file with mode: 0644]
data/mstardict.desktop.in.in [new file with mode: 0644]
data/mstardict.png [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/rules [new file with mode: 0755]
m4/Makefile.am [new file with mode: 0644]
m4/codeset.m4 [new file with mode: 0644]
m4/gettext.m4 [new file with mode: 0644]
m4/glibc21.m4 [new file with mode: 0644]
m4/iconv.m4 [new file with mode: 0644]
m4/intdiv0.m4 [new file with mode: 0644]
m4/intmax.m4 [new file with mode: 0644]
m4/inttypes-pri.m4 [new file with mode: 0644]
m4/inttypes.m4 [new file with mode: 0644]
m4/inttypes_h.m4 [new file with mode: 0644]
m4/isc-posix.m4 [new file with mode: 0644]
m4/lcmessage.m4 [new file with mode: 0644]
m4/lib-ld.m4 [new file with mode: 0644]
m4/lib-link.m4 [new file with mode: 0644]
m4/lib-prefix.m4 [new file with mode: 0644]
m4/longdouble.m4 [new file with mode: 0644]
m4/longlong.m4 [new file with mode: 0644]
m4/nls.m4 [new file with mode: 0644]
m4/po.m4 [new file with mode: 0644]
m4/printf-posix.m4 [new file with mode: 0644]
m4/progtest.m4 [new file with mode: 0644]
m4/readline.m4 [new file with mode: 0644]
m4/signed.m4 [new file with mode: 0644]
m4/size_max.m4 [new file with mode: 0644]
m4/stdint_h.m4 [new file with mode: 0644]
m4/uintmax_t.m4 [new file with mode: 0644]
m4/ulonglong.m4 [new file with mode: 0644]
m4/wchar_t.m4 [new file with mode: 0644]
m4/wint_t.m4 [new file with mode: 0644]
m4/xsize.m4 [new file with mode: 0644]
po/LINGUAS [new file with mode: 0644]
po/POTFILES.in [new file with mode: 0644]
po/sk.po [new file with mode: 0644]
src/Makefile.am [new file with mode: 0644]
src/lib/Makefile.am [new file with mode: 0644]
src/lib/collation.cpp [new file with mode: 0644]
src/lib/collation.h [new file with mode: 0644]
src/lib/common.cpp [new file with mode: 0644]
src/lib/common.hpp [new file with mode: 0644]
src/lib/ctype-mb.cpp [new file with mode: 0644]
src/lib/ctype-uca.cpp [new file with mode: 0644]
src/lib/ctype-utf8.cpp [new file with mode: 0644]
src/lib/data.cpp [new file with mode: 0644]
src/lib/data.hpp [new file with mode: 0644]
src/lib/dict_client.cpp [new file with mode: 0644]
src/lib/dict_client.hpp [new file with mode: 0644]
src/lib/dictmask.h [new file with mode: 0644]
src/lib/dictziplib.cpp [new file with mode: 0644]
src/lib/dictziplib.hpp [new file with mode: 0644]
src/lib/distance.cpp [new file with mode: 0644]
src/lib/distance.h [new file with mode: 0644]
src/lib/file.hpp [new file with mode: 0644]
src/lib/getuint32.h [new file with mode: 0644]
src/lib/http_client.cpp [new file with mode: 0644]
src/lib/http_client.h [new file with mode: 0644]
src/lib/httpmanager.cpp [new file with mode: 0644]
src/lib/httpmanager.h [new file with mode: 0644]
src/lib/kmp.cpp [new file with mode: 0644]
src/lib/kmp.h [new file with mode: 0644]
src/lib/lib.cpp [new file with mode: 0644]
src/lib/lib.h [new file with mode: 0644]
src/lib/m_ctype.h [new file with mode: 0644]
src/lib/m_string.h [new file with mode: 0644]
src/lib/mapfile.hpp [new file with mode: 0644]
src/lib/md5.c [new file with mode: 0644]
src/lib/md5.h [new file with mode: 0644]
src/lib/my_global.h [new file with mode: 0644]
src/lib/netdictcache.cpp [new file with mode: 0644]
src/lib/netdictcache.h [new file with mode: 0644]
src/lib/netdictplugin.cpp [new file with mode: 0644]
src/lib/netdictplugin.h [new file with mode: 0644]
src/lib/parsedata_plugin.cpp [new file with mode: 0644]
src/lib/parsedata_plugin.h [new file with mode: 0644]
src/lib/plugin.cpp [new file with mode: 0644]
src/lib/plugin.h [new file with mode: 0644]
src/lib/pluginmanager.cpp [new file with mode: 0644]
src/lib/pluginmanager.h [new file with mode: 0644]
src/lib/sockets.cpp [new file with mode: 0644]
src/lib/sockets.hpp [new file with mode: 0644]
src/lib/specialdictplugin.cpp [new file with mode: 0644]
src/lib/specialdictplugin.h [new file with mode: 0644]
src/lib/stardict_client.cpp [new file with mode: 0644]
src/lib/stardict_client.hpp [new file with mode: 0644]
src/lib/stardict_libconfig.h [new file with mode: 0644]
src/lib/stddict.cpp [new file with mode: 0644]
src/lib/stddict.hpp [new file with mode: 0644]
src/lib/storage.cpp [new file with mode: 0644]
src/lib/storage.h [new file with mode: 0644]
src/lib/treedict.cpp [new file with mode: 0644]
src/lib/treedict.hpp [new file with mode: 0644]
src/lib/ttsplugin.cpp [new file with mode: 0644]
src/lib/ttsplugin.h [new file with mode: 0644]
src/lib/virtualdictplugin.cpp [new file with mode: 0644]
src/lib/virtualdictplugin.h [new file with mode: 0644]
src/libwrapper.cpp [new file with mode: 0644]
src/libwrapper.hpp [new file with mode: 0644]
src/mstardict.cpp [new file with mode: 0644]
src/mstardict.hpp [new file with mode: 0644]

diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
index 0000000..dc48655
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,6 @@
+author of stardict:
+       Hu Zheng <huzheng_001@163.com> http://forlinux.yeah.net
+author of sdcv:
+       Evgeniy Dushistov <dushistov@mail.ru>
+author of mstardict:
+       Roman Moravcik <roman.moravcik@gmail.com>
diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..d60c31a
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+                   GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..b42a17a
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,182 @@
+Basic Installation
+==================
+
+   These are generic installation instructions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+   The file `configure.in' is used to create `configure' by a program
+called `autoconf'.  You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
+
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  You can give `configure'
+initial values for variables by setting them in the environment.  Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory.  After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+   By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc.  You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on.  Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+     CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+   If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+     Use and save the results of the tests in FILE instead of
+     `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
+     debugging `configure'.
+
+`--help'
+     Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--version'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..d582cb5
--- /dev/null
@@ -0,0 +1,5 @@
+SUBDIRS = data m4 src po
+
+EXTRA_DIST = config.rpath mkinstalldirs BUGS config.rpath 
+
+ACLOCAL_AMFLAGS = -I m4
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..1927a2b
--- /dev/null
@@ -0,0 +1,28 @@
+#! /bin/sh
+#
+#  Cue Sheet Music Applet (widget) for Maemo.
+#  Copyright (C) 2009 Roman Moravcik
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+
+set -x
+glib-gettextize --copy --force
+libtoolize --automake --copy --force
+aclocal
+intltoolize --automake --copy --force
+autoconf --force
+autoheader --force
+automake --add-missing --copy --force-missing --foreign
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..87ee46d
--- /dev/null
@@ -0,0 +1,65 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.52)
+
+AC_INIT(mstardict, 0.2, roman.moravcik@gmail.com)
+AC_CONFIG_SRCDIR(src/mstardict.cpp)
+
+dnl Don't include maintainer make-rules by default
+AM_MAINTAINER_MODE
+
+AM_INIT_AUTOMAKE([dist-bzip2])
+
+AM_CONFIG_HEADER(config.h)
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_CXX
+AC_LANG([C++])
+AC_PROG_CXXCPP
+AC_PROG_MAKE_SET
+AC_PROG_RANLIB
+
+dnl ================================================================
+dnl Gettext stuff.
+dnl ================================================================
+IT_PROG_INTLTOOL([0.35])
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION(0.14.1)
+GETTEXT_PACKAGE=mstardict
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
+AM_ICONV
+
+AC_FUNC_MMAP
+
+AC_CHECK_LIB(z,zlibVersion,LIBS="$LIBS -lz",[AC_MSG_ERROR([zlib not found])])
+
+PKG_CHECK_MODULES(MSTARDICT, glib-2.0 >= 2.6.1 hildon-1)
+
+MSTARDICT_CFLAGS="-Wall $MSTARDICT_CFLAGS"
+
+AC_SUBST(MSTARDICT_LIBS)
+AC_SUBST(MSTARDICT_CFLAGS)
+
+dnl fill cflags for libstardict
+PKG_CHECK_MODULES(LIB_STARDICT, glib-2.0 >= 2.6.1 gtk+-2.0 >= 2.12 sigc++-2.0)
+AC_SUBST(LIB_STARDICT_CFLAGS)
+
+# Discover where to install the .desktop file:
+HILDON_DESKTOP_ENTRY_DIR=`pkg-config osso-af-settings --variable=desktopentrydir`
+AC_SUBST(HILDON_DESKTOP_ENTRY_DIR)
+
+AC_OUTPUT([
+ Makefile
+ data/Makefile
+ data/mstardict.desktop.in
+ m4/Makefile
+ src/lib/Makefile
+ src/Makefile
+ po/Makefile.in
+])
+
+echo "
+
+Type \"make\" to compile.
+
+"
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644 (file)
index 0000000..995a9ba
--- /dev/null
@@ -0,0 +1,9 @@
+imagesdir = $(datadir)/icons/hicolor/48x48/hildon
+images_DATA = mstardict.png
+
+desktopdir = $(HILDON_DESKTOP_ENTRY_DIR)
+desktop_in_files = mstardict.desktop.in
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+@INTLTOOL_DESKTOP_RULE@
+
+DISTCLEANFILES = $(desktop_DATA)
diff --git a/data/mstardict.desktop.in.in b/data/mstardict.desktop.in.in
new file mode 100644 (file)
index 0000000..827e484
--- /dev/null
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=MStarDict
+Comment=Lookup words
+Exec=mstardict
+Terminal=false
+Type=Application
+Icon=mstardict
+Categories=Utility;Dictionary;
diff --git a/data/mstardict.png b/data/mstardict.png
new file mode 100644 (file)
index 0000000..e3202cf
Binary files /dev/null and b/data/mstardict.png differ
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..eca44e6
--- /dev/null
@@ -0,0 +1,184 @@
+mstardict (0.2-1) unstable; urgency=low
+
+  * Imported stardict-3.0.1 library.
+
+ -- Roman Moravcik <roman.moravcik@gmail.com>  Fri, 22 Jan 2010 14:08:36 +0100
+
+mstardict (0.1-1) unstable; urgency=low
+
+  * First version base on sdcv-0.4.2.
+
+ -- Roman Moravcik <roman.moravcik@gmail.com>  Fri, 22 Jan 2010 14:08:36 +0100
+
+sdcv (0.4.2-13) unstable; urgency=low
+
+  * Convert to 3.0 (quilt) source format.
+  * Simplify debian/rules.
+  * Fix typo in man page.
+
+ -- Michal Čihař <nijel@debian.org>  Sun, 03 Jan 2010 14:08:36 +0100
+
+sdcv (0.4.2-12) unstable; urgency=low
+
+  * Build depend on libreadline-dev only, no libreadline5-dev 
+    (Closes: #553848).
+  * Bump standards to 3.8.3.
+
+ -- Michal Čihař <nijel@debian.org>  Mon, 02 Nov 2009 08:47:06 +0100
+
+sdcv (0.4.2-11) unstable; urgency=low
+
+  * Simplify debian/rules by using overrides, --with-quilt and debian/clean.
+  * Regenerate autoconf files during build (Closes: #534814).
+
+ -- Michal Čihař <nijel@debian.org>  Mon, 29 Jun 2009 10:25:24 +0200
+
+sdcv (0.4.2-10) unstable; urgency=low
+
+  * Build depend on autotools-dev to update config.{sub,guess}.
+  * Bump standards to 3.8.2 (no changes needed).
+  * Avoid duplicating section in debian/control.
+  * Point to GPL-2 in debian/copyright.
+  * Improve description a bit.
+
+ -- Michal Čihař <nijel@debian.org>  Wed, 24 Jun 2009 11:37:20 +0200
+
+sdcv (0.4.2-9) unstable; urgency=low
+
+  * Switch Vcs-Browser to viewsvn.
+  * Fix FTBFS with GCC 4.4 (Closes: #505344).
+  * Document all Debian patches.
+  * Add ${misc:Depends} to deps.
+
+ -- Michal Čihař <nijel@debian.org>  Fri, 19 Dec 2008 14:09:09 +0100
+
+sdcv (0.4.2-8) unstable; urgency=low
+
+  * Fix FTBFS if built twice (Closes: #503031).
+  * Unfuzzy string in Slovak translation (caused by another patch and the
+    translation is not really fuzzy).
+
+ -- Michal Čihař <nijel@debian.org>  Wed, 22 Oct 2008 08:02:56 +0200
+
+sdcv (0.4.2-7) unstable; urgency=low
+
+  * Properly typecast to avoid problems with signed char.
+  * Fix format chars to avoid possible problems on 64-bit arches.
+  * Properly handle gzread return values.
+
+ -- Michal Čihař <nijel@debian.org>  Mon, 20 Oct 2008 11:22:28 +0200
+
+sdcv (0.4.2-6) unstable; urgency=low
+
+  * Fix unalligned access to internal buffer while reading dictionary index
+    (Closes: #500921).
+
+ -- Michal Čihař <nijel@debian.org>  Mon, 06 Oct 2008 14:07:45 +0200
+
+sdcv (0.4.2-5) unstable; urgency=low
+
+  * Make sdcv accept $HOME as home directory (Closes: #500921).
+
+ -- Michal Čihař <nijel@debian.org>  Fri, 03 Oct 2008 09:18:52 +0200
+
+sdcv (0.4.2-4) unstable; urgency=low
+
+  * Create fake home directory to make testing possible (Closes: #500318).
+
+ -- Michal Čihař <nijel@debian.org>  Mon, 29 Sep 2008 08:46:18 +0200
+
+sdcv (0.4.2-3) unstable; urgency=low
+
+  * New maintainer (Closes: #480557).
+  * Maintain package in collab-maint, add Vcs-* headers.
+  * Convert to debhelper 7.
+  * Use quilt to apply all patches.
+  * Acknowledge NMUs, thanks to all who helped (Closes: #470985, #474819,
+    #450040, #417687, #441754).
+  * Fix running of testsuite with dash as /bin/sh.
+  * Added Czech translation.
+  * Run explicitely update-gmo to regenerate translations.
+  * Fix typo in english translation.
+  * Fix errors in uk man page.
+  * All patches were reported upstream.
+  * Update to standards 3.8.0.
+  * Use machine-interpretable debian/copyright.
+
+ -- Michal Čihař <nijel@debian.org>  Wed, 24 Sep 2008 11:25:30 +0200
+
+sdcv (0.4.2-2.2) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * FTBFS: libwrapper.cpp:55: error: 'strchr' was not declared in this
+    scope (Closes: #474819)
+  * debian/control:
+    - Bump Standards-Version to 3.7.3.
+    - Use Homepage: field for upstream URL.
+  * Update debian/watch file to use SourceForge-specific syntax (Closes:
+    450040)
+
+ -- Chris Lamb <chris@chris-lamb.co.uk>  Sat, 12 Apr 2008 01:10:51 +0100
+
+sdcv (0.4.2-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTBFS with GCC 4.3 (Closes: #417687).
+  * Update Slovak translation (Closes: #441754).
+
+ -- Luk Claes <luk@debian.org>  Fri, 14 Mar 2008 22:22:31 +0000
+
+sdcv (0.4.2-2) unstable; urgency=low
+
+  * Apply patch for AMD64 build by Matej Vela <vela@debian.org> 
+    (Closes: #369702)
+  * Apply patch for pango markup support (Closes: #365324)
+
+ -- Cai Qian <caiqian@debian.org>  Sat, 10 June 2006 19:33:09 +0100
+
+sdcv (0.4.2-1) unstable; urgency=low
+
+  * New upstream release
+  * Modify watch file
+  * Use new policy
+
+ -- Cai Qian <caiqian@debian.org>  Wed, 31 May 2006 00:57:09 +0100
+
+sdcv (0.4-3) unstable; urgency=low
+
+  * Correct watch file format
+  * Add readline option in debian/rules
+
+ -- Cai Qian <caiqian@debian.org>  Sat, 22 Oct 2005 20:08:00 +0100
+
+sdcv (0.4-2) unstable; urgency=low
+
+  * Build with libreadline support
+  * Add watch file
+
+ -- Cai Qian <caiqian@debian.org>  Thu, 20 Oct 2005 21:10:00 +0100
+
+sdcv (0.4-1) unstable; urgency=low
+
+  * New upstream release
+  * SDCV did not provide libsdcv and libsdcv-dev any more 
+  * Corrected FSF address
+
+ -- Cai Qian <caiqian@debian.org>  Tue, 27 Sep 2005 13:03:00 +0100
+
+sdcv (0.3.4-1) unstable; urgency=low
+
+  * New upstream release.
+  * Now SDCV is using autotools build system.
+  * Split SDCV into sdcv, libsdcv3 and libsdcv-dev.
+  * Add Chinese po file.
+  * Sponsored by Brian Nelson.
+
+ -- Cai Qian <caiqian@gnome.org>  Mon, 21 Jan 2005 09:49:03 +0800
+
+sdcv (0.1-1) unstable; urgency=low
+
+  * Initial Release. (Closes: #250532)
+  * Sponsored by Brian Nelson <pyro@debian.org>
+
+ -- Cai Qian <caiqian@gnome.org>  Mon, 15 Nov 2004 23:12:29 +0800
+
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..106c64e
--- /dev/null
@@ -0,0 +1,57 @@
+Source: mstardict
+Priority: optional
+Section: user/utilities
+Maintainer: Roman Moravcik <roman.moravcik@gmail.com>
+Build-Depends: debhelper (>= 5.0.0), gettext, libhildon1-dev, libosso-dev, libgtk2.0-dev, libglib2.0-dev, libsigc++-2.0-dev, zlib1g-dev, maemo-optify
+Standards-Version: 3.8.3
+
+Package: mstardict
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: International dictionary for Maemo
+ MStarDict is a StarDict clone written with using Gtk2 for Maemo.
+ It can use StarDict DICT files as a word database for translation.
+ .
+ MStarDict is loading StarDict DICT files from MyDocs/mstardict/ directory.
+XB-Maemo-Display-Name: Maemo Stardict
+XB-Maemo-Icon-26:
+ iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgI
+ fAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3
+ Lmlua3NjYXBlLm9yZ5vuPBoAAAZZSURBVGiB7ZlbaBzXGcd/s7taeVeKrNqy
+ JUt2ait2nIdSYWh6DS0NpAU/tBDchz4EiqEkFErzlBTal741NC9tH5LS4pZe
+ CeQlDymBPhjqltIGAkmbOL4SSZG0u5L2ot2dnTlnzvn6MLur3dVeRlpFTiD/
+ 5TCzM9+c7/zPdznfmXFEhI8yYvd6AMPiYwL3Gh8TuNdIdLu48vjjR7WNf+Od
+ Snni4S8/csjxteKA0lVM7Jqt6GtTv3xuNYr8DgKO48SfX7hw8dKDD12xY2li
+ U1NQqYK1+z/aLhCAscB78/Ll7y1cufLbQfLdXGh0yXVPbP919m1wUeEkEofS
+ 45PPOo4zMUi2qwsBWASLoBYXkfwmYiJaYAi+Dg4lE+CKxa15p4GjwFa/Z7oS
+ sISmFMDUakjVRYzZ+8h2Ac8YKtbgB0EMGB8k38cCdX+snx8UGnrrOgfas7cF
+ JGxWts8PAg3LR521vjEQdhbGwrY9PliE+qhrH4yeBBpDbo2HVuRSDuXJFBjD
+ fM7DqVv77nQKiYXntuIyki9wIn4fo7FQVTaosPWJNCPHjkFug9OVdi+xHcc9
+ EbAdA+/W2cy3LvG5xy4CwttPPknK1QB89ac/J5YYacqVMyvc/vWvSN5cppgw
+ nPr+08x99kuItahshpVnftTWby99uyLQ6KizNQmK5dj5hwi2iiRSKZyzZ7Bv
+ 3Qxvah+/mGflmR+TurDAiae+y+zXvk755m9IP/oV5i58huK//knh939BrOwY
+ bDP7RSTQsxayIvXZkPC8pXmH09w3NUX+6lXQPumz8817KAWBQinF0hv/Ce+n
+ xxAR5r7wRdA+hVdeJShXMNVqW79tLWIMdCVgaXcjW5+RRkucmwetqFy9hnge
+ h+fnMUg4a1rhWMv6g9Mcv/RNrOuy9berBAjpw5OI76Eyubb+OltrCh+EPQXx
+ xLl53NUV/I08lffuMnlyjvdGYhzSAtpnJBHn89/+DiOTk+QX73Dn9n85PpIk
+ juAXC5hAN4O+n94o6GoB00ycLW5Ub1oMR8+cYfPWDe6oDdZvvYsTBMQ/ORs+
+ pX1UYZObP3mOuz/7BUdOzPKpJ57AaEVQ2WJ0NIlOxtv6bG3SPEaj0NMCpmUm
+ GosZQHB0gtRYmlMLn+bUwvPhRe0zdv8s7q33QSvQCitQWnkfv7jJ5PFjrDox
+ vFyW8Zlp1JFxnLVSVxtYqeuN6EM9Y0C6HAVInZ4D7bP40ivcfuF3LP7xZdA+
+ k/efDN1Mh0G8HK/inZ9lNDlC4fq7WGspvvEWaJ9Tjz5CZjwgk9I7Ml04YYJf
+ KEaiMLAW6oyB42dOY12X4v9uhAWe4zBXLnNkeprlRBxHK0aTSS7+8FnEGMo3
+ bpP/++tYIP/vNxmfmWLm/FlmfvA0tc08N178c1OnBAFuZo31tTU8pfZOIMxA
+ 0vy1ZoXV166x6vwD06hORbj+4p9w4jHEWt5+4Q/NfoKah1XBdr9ac/fl10iM
+ pUhOjKOK5VBXzcXPZAnyeSpaoa2JvA50t4BtL+ZaCfgVd4d46zVTqgxUqqo1
+ VMUlKBTwszlMudyqelfF40AX6rYSDwMJAtT6On42hyjVVW+jRUFfF2o0sw8U
+ TK2GyuZQm5t9N0e27rJ22Gq01W2GGX5QKuFlsgSlUiT51gogCvpvaNi9TwKI
+ MfgbG/jZHNbzoj/I9poTdR0YsKlvkJBIJrW+j5fNojY2kSAYKN9Lr2m67WD0
+ 3Q+0nvfrLiiX8TJZ/EJh6JcwvTZQvdC7mOvYD+8wqbWofJ5aJotxt9PosNmq
+ M20PQrRaiG2LiNbUsln83Dp2j27SD41yeqg0Cp31iaCrFWqZDH6+8IG+opC2
+ 1D0YfQlYEbxCkcI711ER0+Cw2JeFTAeBLa+ssLi8xNwD5/Ar1chpbViYRuxF
+ lO9KoLSR02WlCZRqW5EPAq1VQBQMfK2yW5MOi91uKfuWEp0kDgL7UkoYwEi4
+ EhsJM4I9oJejRkJdQ2ehe+VCQb2E8azoKPIfKhcSoGbDNyFLWueI4EkfiiC2
+ gBLLlrVsiXGXtd74a7V8Ddi5/euA0/nx0XGcdBIeG43HLwMm5jiikQk5gE+y
+ IhYvXHCqxHgJw6siUuz3TDcCI8DDwNnmxRgn6eNu+wgBNnFYwvC6iGQHPbCD
+ AIRWAJItl0YjDmA/PmmWRKQWVbgrgY8S/g8FKB7z9BxzMwAAAABJRU5ErkJg
+ gg==
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..c408167
--- /dev/null
@@ -0,0 +1,47 @@
+This package (stardict) was debianized by Anthony Fok <foka@debian.org>
+on Wed,  9 Apr 2003 23:29:25 +0800.
+
+It was downloaded from
+http://downloads.sourceforge.net/stardict/stardict-3.0.0.tar.bz2
+
+Upstream Authors:
+    Hu Zheng (胡正) <huzheng_001@163.com>
+
+Developers:
+    Evgeniy Dushistov <dushistov@mail.ru>
+
+Contributors:
+    Alex Murygin <murygin@aitoc.com>
+
+Home Pages:
+    http://stardict.sourceforge.net/
+    http://forlinux.yeah.net/
+
+Copyright:
+
+    StarDict 3.0.1, an international dictionary written in GTK+ 2.x
+    Copyright (C) 2003, 2004, 2005, 2006, 2007  Hu Zheng
+   
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; either version 3
+    of the License, or (at your option) any later version.
+   
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+   
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 
+    02110-1301 USA
+   
+  On Debian GNU/Linux systems, the complete text of the GNU General
+  Public License can be found in `/usr/share/common-licenses/GPL'.
+
+Note: This software also contain some files in GNU Lesser General 
+Public Licence(LGPL). 
+
+On Debian GNU/Linux systems, the complete text of the Lesser GNU General
+Public License may be found in /usr/share/common-licenses/LGPL.
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..2deb34f
--- /dev/null
@@ -0,0 +1,77 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+
+#export DH_VERBOSE=1
+
+
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+
+CFLAGS = -Wall -g
+
+DESTDIR = $(CURDIR)/debian/mstardict
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+
+       ./autogen.sh
+       ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --disable-static CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs"
+
+       touch $@
+
+build: build-stamp
+
+build-stamp: configure-stamp
+       dh_testdir
+
+       $(MAKE)
+
+       touch $@
+
+clean:
+       dh_testdir
+       dh_testroot
+
+       rm -f build-stamp configure-stamp
+
+       [ ! -f Makefile ] || $(MAKE) distclean
+       rm -f Makefile.in aclocal.m4 compile config.guess config.h.in config.rpath config.sub configure data/Makefile.in depcomp install-sh intltool-extract.in intltool-merge.in intltool-update.in ltmain.sh m4/Makefile.in missing mkinstalldirs po/Makefile.in.in src/Makefile.in src/lib/Makefile.in
+
+       dh_clean 
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k 
+       dh_installdirs
+
+       $(MAKE) DESTDIR=$(DESTDIR) install
+       find $(DESTDIR) -name "*.la" | xargs rm -f
+
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs
+       dh_installdocs
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+       dh_installdeb
+       dh_shlibdeps
+       dh_gencontrol
+       maemo-optify
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-arch
+.PHONY: build clean binary-arch binary install configure
diff --git a/m4/Makefile.am b/m4/Makefile.am
new file mode 100644 (file)
index 0000000..f971283
--- /dev/null
@@ -0,0 +1 @@
+EXTRA_DIST = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 intmax.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 longdouble.m4 longlong.m4 nls.m4 po.m4 printf-posix.m4 progtest.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4
diff --git a/m4/codeset.m4 b/m4/codeset.m4
new file mode 100644 (file)
index 0000000..59535eb
--- /dev/null
@@ -0,0 +1,23 @@
+# codeset.m4 serial AM1 (gettext-0.10.40)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
+    [AC_TRY_LINK([#include <langinfo.h>],
+      [char* cs = nl_langinfo(CODESET);],
+      am_cv_langinfo_codeset=yes,
+      am_cv_langinfo_codeset=no)
+    ])
+  if test $am_cv_langinfo_codeset = yes; then
+    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
+      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
+  fi
+])
diff --git a/m4/gettext.m4 b/m4/gettext.m4
new file mode 100644 (file)
index 0000000..a374f03
--- /dev/null
@@ -0,0 +1,487 @@
+# gettext.m4 serial 28 (gettext-0.13)
+dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+dnl Macro to add for using GNU gettext.
+
+dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
+dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
+dnl    default (if it is not specified or empty) is 'no-libtool'.
+dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
+dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
+dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
+dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
+dnl    depending on --{enable,disable}-{shared,static} and on the presence of
+dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
+dnl    $(top_builddir)/intl/libintl.a will be created.
+dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
+dnl    implementations (in libc or libintl) without the ngettext() function
+dnl    will be ignored.  If NEEDSYMBOL is specified and is
+dnl    'need-formatstring-macros', then GNU gettext implementations that don't
+dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
+dnl INTLDIR is used to find the intl libraries.  If empty,
+dnl    the value `$(top_builddir)/intl/' is used.
+dnl
+dnl The result of the configuration is one of three cases:
+dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
+dnl    and used.
+dnl    Catalog format: GNU --> install in $(datadir)
+dnl    Catalog extension: .mo after installation, .gmo in source tree
+dnl 2) GNU gettext has been found in the system's C library.
+dnl    Catalog format: GNU --> install in $(datadir)
+dnl    Catalog extension: .mo after installation, .gmo in source tree
+dnl 3) No internationalization, always use English msgid.
+dnl    Catalog format: none
+dnl    Catalog extension: none
+dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
+dnl The use of .gmo is historical (it was needed to avoid overwriting the
+dnl GNU format catalogs when building on a platform with an X/Open gettext),
+dnl but we keep it in order not to force irrelevant filename changes on the
+dnl maintainers.
+dnl
+AC_DEFUN([AM_GNU_GETTEXT],
+[
+  dnl Argument checking.
+  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
+    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
+])])])])])
+  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
+    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
+])])])])
+  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
+  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
+
+  AC_REQUIRE([AM_PO_SUBDIRS])dnl
+  ifelse(gt_included_intl, yes, [
+    AC_REQUIRE([AM_INTL_SUBDIR])dnl
+  ])
+
+  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+
+  dnl Sometimes libintl requires libiconv, so first search for libiconv.
+  dnl Ideally we would do this search only after the
+  dnl      if test "$USE_NLS" = "yes"; then
+  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+  dnl the configure script would need to contain the same shell code
+  dnl again, outside any 'if'. There are two solutions:
+  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
+  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
+  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
+  dnl documented, we avoid it.
+  ifelse(gt_included_intl, yes, , [
+    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+  ])
+
+  dnl Set USE_NLS.
+  AM_NLS
+
+  ifelse(gt_included_intl, yes, [
+    BUILD_INCLUDED_LIBINTL=no
+    USE_INCLUDED_LIBINTL=no
+  ])
+  LIBINTL=
+  LTLIBINTL=
+  POSUB=
+
+  dnl If we use NLS figure out what method
+  if test "$USE_NLS" = "yes"; then
+    gt_use_preinstalled_gnugettext=no
+    ifelse(gt_included_intl, yes, [
+      AC_MSG_CHECKING([whether included gettext is requested])
+      AC_ARG_WITH(included-gettext,
+        [  --with-included-gettext use the GNU gettext library included here],
+        nls_cv_force_use_gnu_gettext=$withval,
+        nls_cv_force_use_gnu_gettext=no)
+      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+
+      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+    ])
+        dnl User does not insist on using GNU NLS library.  Figure out what
+        dnl to use.  If GNU gettext is available we use this.  Else we have
+        dnl to fall back to GNU NLS library.
+
+        dnl Add a version number to the cache macros.
+        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
+        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
+        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
+
+        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
+         [AC_TRY_LINK([#include <libintl.h>
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;],
+            [bindtextdomain ("", "");
+return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
+            gt_cv_func_gnugettext_libc=yes,
+            gt_cv_func_gnugettext_libc=no)])
+
+        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+          dnl Sometimes libintl requires libiconv, so first search for libiconv.
+          ifelse(gt_included_intl, yes, , [
+            AM_ICONV_LINK
+          ])
+          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
+          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
+          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
+          dnl even if libiconv doesn't exist.
+          AC_LIB_LINKFLAGS_BODY([intl])
+          AC_CACHE_CHECK([for GNU gettext in libintl],
+            gt_cv_func_gnugettext_libintl,
+           [gt_save_CPPFLAGS="$CPPFLAGS"
+            CPPFLAGS="$CPPFLAGS $INCINTL"
+            gt_save_LIBS="$LIBS"
+            LIBS="$LIBS $LIBINTL"
+            dnl Now see whether libintl exists and does not depend on libiconv.
+            AC_TRY_LINK([#include <libintl.h>
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias ();],
+              [bindtextdomain ("", "");
+return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
+              gt_cv_func_gnugettext_libintl=yes,
+              gt_cv_func_gnugettext_libintl=no)
+            dnl Now see whether libintl exists and depends on libiconv.
+            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
+              LIBS="$LIBS $LIBICONV"
+              AC_TRY_LINK([#include <libintl.h>
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias ();],
+                [bindtextdomain ("", "");
+return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
+               [LIBINTL="$LIBINTL $LIBICONV"
+                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+                gt_cv_func_gnugettext_libintl=yes
+               ])
+            fi
+            CPPFLAGS="$gt_save_CPPFLAGS"
+            LIBS="$gt_save_LIBS"])
+        fi
+
+        dnl If an already present or preinstalled GNU gettext() is found,
+        dnl use it.  But if this macro is used in GNU gettext, and GNU
+        dnl gettext is already preinstalled in libintl, we update this
+        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
+        if test "$gt_cv_func_gnugettext_libc" = "yes" \
+           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
+                && test "$PACKAGE" != gettext-runtime \
+                && test "$PACKAGE" != gettext-tools; }; then
+          gt_use_preinstalled_gnugettext=yes
+        else
+          dnl Reset the values set by searching for libintl.
+          LIBINTL=
+          LTLIBINTL=
+          INCINTL=
+        fi
+
+    ifelse(gt_included_intl, yes, [
+        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
+          dnl GNU gettext is not found in the C library.
+          dnl Fall back on included GNU gettext library.
+          nls_cv_use_gnu_gettext=yes
+        fi
+      fi
+
+      if test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Mark actions used to generate GNU NLS library.
+        BUILD_INCLUDED_LIBINTL=yes
+        USE_INCLUDED_LIBINTL=yes
+        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
+        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
+        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
+      fi
+
+      if test "$gt_use_preinstalled_gnugettext" = "yes" \
+         || test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Mark actions to use GNU gettext tools.
+        CATOBJEXT=.gmo
+      fi
+    ])
+
+    if test "$gt_use_preinstalled_gnugettext" = "yes" \
+       || test "$nls_cv_use_gnu_gettext" = "yes"; then
+      AC_DEFINE(ENABLE_NLS, 1,
+        [Define to 1 if translation of program messages to the user's native language
+   is requested.])
+    else
+      USE_NLS=no
+    fi
+  fi
+
+  AC_MSG_CHECKING([whether to use NLS])
+  AC_MSG_RESULT([$USE_NLS])
+  if test "$USE_NLS" = "yes"; then
+    AC_MSG_CHECKING([where the gettext function comes from])
+    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+        gt_source="external libintl"
+      else
+        gt_source="libc"
+      fi
+    else
+      gt_source="included intl directory"
+    fi
+    AC_MSG_RESULT([$gt_source])
+  fi
+
+  if test "$USE_NLS" = "yes"; then
+
+    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+        AC_MSG_CHECKING([how to link with libintl])
+        AC_MSG_RESULT([$LIBINTL])
+        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
+      fi
+
+      dnl For backward compatibility. Some packages may be using this.
+      AC_DEFINE(HAVE_GETTEXT, 1,
+       [Define if the GNU gettext() function is already present or preinstalled.])
+      AC_DEFINE(HAVE_DCGETTEXT, 1,
+       [Define if the GNU dcgettext() function is already present or preinstalled.])
+    fi
+
+    dnl We need to process the po/ directory.
+    POSUB=po
+  fi
+
+  ifelse(gt_included_intl, yes, [
+    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
+    dnl to 'yes' because some of the testsuite requires it.
+    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
+      BUILD_INCLUDED_LIBINTL=yes
+    fi
+
+    dnl Make all variables we use known to autoconf.
+    AC_SUBST(BUILD_INCLUDED_LIBINTL)
+    AC_SUBST(USE_INCLUDED_LIBINTL)
+    AC_SUBST(CATOBJEXT)
+
+    dnl For backward compatibility. Some configure.ins may be using this.
+    nls_cv_header_intl=
+    nls_cv_header_libgt=
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    DATADIRNAME=share
+    AC_SUBST(DATADIRNAME)
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    INSTOBJEXT=.mo
+    AC_SUBST(INSTOBJEXT)
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    GENCAT=gencat
+    AC_SUBST(GENCAT)
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    if test "$USE_INCLUDED_LIBINTL" = yes; then
+      INTLOBJS="\$(GETTOBJS)"
+    fi
+    AC_SUBST(INTLOBJS)
+
+    dnl Enable libtool support if the surrounding package wishes it.
+    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
+    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
+  ])
+
+  dnl For backward compatibility. Some Makefiles may be using this.
+  INTLLIBS="$LIBINTL"
+  AC_SUBST(INTLLIBS)
+
+  dnl Make all documented variables known to autoconf.
+  AC_SUBST(LIBINTL)
+  AC_SUBST(LTLIBINTL)
+  AC_SUBST(POSUB)
+])
+
+
+dnl Checks for all prerequisites of the intl subdirectory,
+dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
+dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
+AC_DEFUN([AM_INTL_SUBDIR],
+[
+  AC_REQUIRE([AC_PROG_INSTALL])dnl
+  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
+  AC_REQUIRE([AC_PROG_CC])dnl
+  AC_REQUIRE([AC_CANONICAL_HOST])dnl
+  AC_REQUIRE([AC_PROG_RANLIB])dnl
+  AC_REQUIRE([AC_ISC_POSIX])dnl
+  AC_REQUIRE([AC_HEADER_STDC])dnl
+  AC_REQUIRE([AC_C_CONST])dnl
+  AC_REQUIRE([bh_C_SIGNED])dnl
+  AC_REQUIRE([AC_C_INLINE])dnl
+  AC_REQUIRE([AC_TYPE_OFF_T])dnl
+  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+  AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
+  AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
+  AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
+  AC_REQUIRE([gt_TYPE_WINT_T])dnl
+  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
+  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
+  AC_REQUIRE([gt_TYPE_INTMAX_T])
+  AC_REQUIRE([gt_PRINTF_POSIX])
+  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+  AC_REQUIRE([AC_FUNC_MMAP])dnl
+  AC_REQUIRE([jm_GLIBC21])dnl
+  AC_REQUIRE([gt_INTDIV0])dnl
+  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
+  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
+  AC_REQUIRE([gt_INTTYPES_PRI])dnl
+  AC_REQUIRE([gl_XSIZE])dnl
+
+  AC_CHECK_TYPE([ptrdiff_t], ,
+    [AC_DEFINE([ptrdiff_t], [long],
+       [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
+    ])
+  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
+stdlib.h string.h unistd.h sys/param.h])
+  AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
+mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
+strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
+__fsetlocking])
+
+  dnl Use the _snprintf function only if it is declared (because on NetBSD it
+  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
+  gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
+  gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
+
+  dnl Use the *_unlocked functions only if they are declared.
+  dnl (because some of them were defined without being declared in Solaris
+  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
+  dnl on Solaris 2.5.1 to run on Solaris 2.6).
+  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
+  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
+  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
+  gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
+
+  case $gt_cv_func_printf_posix in
+    *yes) HAVE_POSIX_PRINTF=1 ;;
+    *) HAVE_POSIX_PRINTF=0 ;;
+  esac
+  AC_SUBST([HAVE_POSIX_PRINTF])
+  if test "$ac_cv_func_asprintf" = yes; then
+    HAVE_ASPRINTF=1
+  else
+    HAVE_ASPRINTF=0
+  fi
+  AC_SUBST([HAVE_ASPRINTF])
+  if test "$ac_cv_func_snprintf" = yes; then
+    HAVE_SNPRINTF=1
+  else
+    HAVE_SNPRINTF=0
+  fi
+  AC_SUBST([HAVE_SNPRINTF])
+  if test "$ac_cv_func_wprintf" = yes; then
+    HAVE_WPRINTF=1
+  else
+    HAVE_WPRINTF=0
+  fi
+  AC_SUBST([HAVE_WPRINTF])
+
+  AM_ICONV
+  AM_LANGINFO_CODESET
+  if test $ac_cv_header_locale_h = yes; then
+    AM_LC_MESSAGES
+  fi
+
+  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
+  dnl because plural.y uses bison specific features. It requires at least
+  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
+  dnl compile.
+  dnl bison is only needed for the maintainer (who touches plural.y). But in
+  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
+  dnl the rule in general Makefile. Now, some people carelessly touch the
+  dnl files or have a broken "make" program, hence the plural.c rule will
+  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
+  dnl present or too old.
+  AC_CHECK_PROGS([INTLBISON], [bison])
+  if test -z "$INTLBISON"; then
+    ac_verc_fail=yes
+  else
+    dnl Found it, now check the version.
+    AC_MSG_CHECKING([version of bison])
+changequote(<<,>>)dnl
+    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+    case $ac_prog_version in
+      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
+changequote([,])dnl
+         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+    esac
+    AC_MSG_RESULT([$ac_prog_version])
+  fi
+  if test $ac_verc_fail = yes; then
+    INTLBISON=:
+  fi
+])
+
+
+dnl gt_CHECK_DECL(FUNC, INCLUDES)
+dnl Check whether a function is declared.
+AC_DEFUN([gt_CHECK_DECL],
+[
+  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
+    [AC_TRY_COMPILE([$2], [
+#ifndef $1
+  char *p = (char *) $1;
+#endif
+], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
+  if test $ac_cv_have_decl_$1 = yes; then
+    gt_value=1
+  else
+    gt_value=0
+  fi
+  AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
+    [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
new file mode 100644 (file)
index 0000000..9c9f3db
--- /dev/null
@@ -0,0 +1,32 @@
+# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# Test for the GNU C Library, version 2.1 or newer.
+# From Bruno Haible.
+
+AC_DEFUN([jm_GLIBC21],
+  [
+    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
+      ac_cv_gnu_library_2_1,
+      [AC_EGREP_CPP([Lucky GNU user],
+       [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+  Lucky GNU user
+ #endif
+#endif
+       ],
+       ac_cv_gnu_library_2_1=yes,
+       ac_cv_gnu_library_2_1=no)
+      ]
+    )
+    AC_SUBST(GLIBC21)
+    GLIBC21="$ac_cv_gnu_library_2_1"
+  ]
+)
diff --git a/m4/iconv.m4 b/m4/iconv.m4
new file mode 100644 (file)
index 0000000..c5f3579
--- /dev/null
@@ -0,0 +1,103 @@
+# iconv.m4 serial AM4 (gettext-0.11.3)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
+[
+  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+
+  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+  dnl accordingly.
+  AC_LIB_LINKFLAGS_BODY([iconv])
+])
+
+AC_DEFUN([AM_ICONV_LINK],
+[
+  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+  dnl those with the standalone portable GNU libiconv installed).
+
+  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+  dnl accordingly.
+  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+
+  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
+  dnl because if the user has installed libiconv and not disabled its use
+  dnl via --without-libiconv-prefix, he wants to use it. The first
+  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
+  am_save_CPPFLAGS="$CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
+
+  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
+    am_cv_func_iconv="no, consider installing GNU libiconv"
+    am_cv_lib_iconv=no
+    AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+      [iconv_t cd = iconv_open("","");
+       iconv(cd,NULL,NULL,NULL,NULL);
+       iconv_close(cd);],
+      am_cv_func_iconv=yes)
+    if test "$am_cv_func_iconv" != yes; then
+      am_save_LIBS="$LIBS"
+      LIBS="$LIBS $LIBICONV"
+      AC_TRY_LINK([#include <stdlib.h>
+#include <iconv.h>],
+        [iconv_t cd = iconv_open("","");
+         iconv(cd,NULL,NULL,NULL,NULL);
+         iconv_close(cd);],
+        am_cv_lib_iconv=yes
+        am_cv_func_iconv=yes)
+      LIBS="$am_save_LIBS"
+    fi
+  ])
+  if test "$am_cv_func_iconv" = yes; then
+    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+  fi
+  if test "$am_cv_lib_iconv" = yes; then
+    AC_MSG_CHECKING([how to link with libiconv])
+    AC_MSG_RESULT([$LIBICONV])
+  else
+    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
+    dnl either.
+    CPPFLAGS="$am_save_CPPFLAGS"
+    LIBICONV=
+    LTLIBICONV=
+  fi
+  AC_SUBST(LIBICONV)
+  AC_SUBST(LTLIBICONV)
+])
+
+AC_DEFUN([AM_ICONV],
+[
+  AM_ICONV_LINK
+  if test "$am_cv_func_iconv" = yes; then
+    AC_MSG_CHECKING([for iconv declaration])
+    AC_CACHE_VAL(am_cv_proto_iconv, [
+      AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
+      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
+    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+    AC_MSG_RESULT([$]{ac_t:-
+         }[$]am_cv_proto_iconv)
+    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
+      [Define as const if the declaration of iconv() needs const.])
+  fi
+])
diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4
new file mode 100644 (file)
index 0000000..55dddcf
--- /dev/null
@@ -0,0 +1,72 @@
+# intdiv0.m4 serial 1 (gettext-0.11.3)
+dnl Copyright (C) 2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gt_INTDIV0],
+[
+  AC_REQUIRE([AC_PROG_CC])dnl
+  AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
+    gt_cv_int_divbyzero_sigfpe,
+    [
+      AC_TRY_RUN([
+#include <stdlib.h>
+#include <signal.h>
+
+static void
+#ifdef __cplusplus
+sigfpe_handler (int sig)
+#else
+sigfpe_handler (sig) int sig;
+#endif
+{
+  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
+  exit (sig != SIGFPE);
+}
+
+int x = 1;
+int y = 0;
+int z;
+int nan;
+
+int main ()
+{
+  signal (SIGFPE, sigfpe_handler);
+/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
+#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
+  signal (SIGTRAP, sigfpe_handler);
+#endif
+/* Linux/SPARC yields signal SIGILL.  */
+#if defined (__sparc__) && defined (__linux__)
+  signal (SIGILL, sigfpe_handler);
+#endif
+
+  z = x / y;
+  nan = y / y;
+  exit (1);
+}
+], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
+        [
+          # Guess based on the CPU.
+          case "$host_cpu" in
+            alpha* | i[34567]86 | m68k | s390*)
+              gt_cv_int_divbyzero_sigfpe="guessing yes";;
+            *)
+              gt_cv_int_divbyzero_sigfpe="guessing no";;
+          esac
+        ])
+    ])
+  case "$gt_cv_int_divbyzero_sigfpe" in
+    *yes) value=1;;
+    *) value=0;;
+  esac
+  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
+    [Define if integer division by zero raises signal SIGFPE.])
+])
diff --git a/m4/intmax.m4 b/m4/intmax.m4
new file mode 100644 (file)
index 0000000..dfb08cc
--- /dev/null
@@ -0,0 +1,32 @@
+# intmax.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+dnl Test whether the system has the 'intmax_t' type, but don't attempt to
+dnl find a replacement if it is lacking.
+
+AC_DEFUN([gt_TYPE_INTMAX_T],
+[
+  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
+  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
+  AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
+    [AC_TRY_COMPILE([
+#include <stddef.h> 
+#include <stdlib.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+#include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+#include <inttypes.h>
+#endif
+], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
+  if test $gt_cv_c_intmax_t = yes; then
+    AC_DEFINE(HAVE_INTMAX_T, 1,
+      [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
+  fi
+])
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4
new file mode 100644 (file)
index 0000000..fd007c3
--- /dev/null
@@ -0,0 +1,32 @@
+# inttypes-pri.m4 serial 1 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
+# macros to non-string values.  This is the case on AIX 4.3.3.
+
+AC_DEFUN([gt_INTTYPES_PRI],
+[
+  AC_REQUIRE([gt_HEADER_INTTYPES_H])
+  if test $gt_cv_header_inttypes_h = yes; then
+    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
+      gt_cv_inttypes_pri_broken,
+      [
+        AC_TRY_COMPILE([#include <inttypes.h>
+#ifdef PRId32
+char *p = PRId32;
+#endif
+], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
+      ])
+  fi
+  if test "$gt_cv_inttypes_pri_broken" = yes; then
+    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
+      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
+  fi
+])
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
new file mode 100644 (file)
index 0000000..ab370ff
--- /dev/null
@@ -0,0 +1,27 @@
+# inttypes.m4 serial 1 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
+# <sys/types.h>.
+
+AC_DEFUN([gt_HEADER_INTTYPES_H],
+[
+  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
+  [
+    AC_TRY_COMPILE(
+      [#include <sys/types.h>
+#include <inttypes.h>],
+      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
+  ])
+  if test $gt_cv_header_inttypes_h = yes; then
+    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
+      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
+  fi
+])
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4
new file mode 100644 (file)
index 0000000..f342eba
--- /dev/null
@@ -0,0 +1,28 @@
+# inttypes_h.m4 serial 5 (gettext-0.12)
+dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
+[
+  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
+  [AC_TRY_COMPILE(
+    [#include <sys/types.h>
+#include <inttypes.h>],
+    [uintmax_t i = (uintmax_t) -1;],
+    jm_ac_cv_header_inttypes_h=yes,
+    jm_ac_cv_header_inttypes_h=no)])
+  if test $jm_ac_cv_header_inttypes_h = yes; then
+    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
+      [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
+       and declares uintmax_t. ])
+  fi
+])
diff --git a/m4/isc-posix.m4 b/m4/isc-posix.m4
new file mode 100644 (file)
index 0000000..1319dd1
--- /dev/null
@@ -0,0 +1,26 @@
+# isc-posix.m4 serial 2 (gettext-0.11.2)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
+
+# This test replaces the one in autoconf.
+# Currently this macro should have the same name as the autoconf macro
+# because gettext's gettext.m4 (distributed in the automake package)
+# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
+# give these diagnostics:
+#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
+#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
+
+undefine([AC_ISC_POSIX])
+
+AC_DEFUN([AC_ISC_POSIX],
+  [
+    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
+    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
+  ]
+)
diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4
new file mode 100644 (file)
index 0000000..ffd4008
--- /dev/null
@@ -0,0 +1,32 @@
+# lcmessage.m4 serial 3 (gettext-0.11.3)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+
+AC_DEFUN([AM_LC_MESSAGES],
+[
+  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+  if test $am_cv_val_LC_MESSAGES = yes; then
+    AC_DEFINE(HAVE_LC_MESSAGES, 1,
+      [Define if your <locale.h> file defines LC_MESSAGES.])
+  fi
+])
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4
new file mode 100644 (file)
index 0000000..38aeaec
--- /dev/null
@@ -0,0 +1,112 @@
+# lib-ld.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
+dnl with libtool.m4.
+
+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+AC_DEFUN([AC_LIB_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  acl_cv_prog_gnu_ld=yes ;;
+*)
+  acl_cv_prog_gnu_ld=no ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
+
+dnl From libtool-1.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by GCC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]* | [A-Za-z]:[\\/]*)]
+      [re_direlt='/[^/][^/]*/\.\./']
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(acl_cv_path_LD,
+[if test -z "$LD"; then
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      acl_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break ;;
+      *)
+       test "$with_gnu_ld" != yes && break ;;
+      esac
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_LIB_PROG_LD_GNU
+])
diff --git a/m4/lib-link.m4 b/m4/lib-link.m4
new file mode 100644 (file)
index 0000000..eeb200d
--- /dev/null
@@ -0,0 +1,551 @@
+# lib-link.m4 serial 4 (gettext-0.12)
+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+  define([Name],[translit([$1],[./-], [___])])
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
+    AC_LIB_LINKFLAGS_BODY([$1], [$2])
+    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+  ])
+  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+  AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
+  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+  dnl results of this search when this library appears as a dependency.
+  HAVE_LIB[]NAME=yes
+  undefine([Name])
+  undefine([NAME])
+])
+
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
+dnl searches for libname and the libraries corresponding to explicit and
+dnl implicit dependencies, together with the specified include files and
+dnl the ability to compile and link the specified testcode. If found, it
+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+  define([Name],[translit([$1],[./-], [___])])
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+
+  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+  dnl accordingly.
+  AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+  dnl because if the user has installed lib[]Name and not disabled its use
+  dnl via --without-lib[]Name-prefix, he wants to use it.
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+    ac_save_LIBS="$LIBS"
+    LIBS="$LIBS $LIB[]NAME"
+    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
+    LIBS="$ac_save_LIBS"
+  ])
+  if test "$ac_cv_lib[]Name" = yes; then
+    HAVE_LIB[]NAME=yes
+    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
+    AC_MSG_CHECKING([how to link with lib[]$1])
+    AC_MSG_RESULT([$LIB[]NAME])
+  else
+    HAVE_LIB[]NAME=no
+    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+    dnl $INC[]NAME either.
+    CPPFLAGS="$ac_save_CPPFLAGS"
+    LIB[]NAME=
+    LTLIB[]NAME=
+  fi
+  AC_SUBST([HAVE_LIB]NAME)
+  AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
+  undefine([Name])
+  undefine([NAME])
+])
+
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
+dnl hardcode_direct, hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
+  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
+  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
+  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
+  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
+    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+    . ./conftest.sh
+    rm -f ./conftest.sh
+    acl_cv_rpath=done
+  ])
+  wl="$acl_cv_wl"
+  libext="$acl_cv_libext"
+  shlibext="$acl_cv_shlibext"
+  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  hardcode_direct="$acl_cv_hardcode_direct"
+  hardcode_minus_L="$acl_cv_hardcode_minus_L"
+  dnl Determine whether the user wants rpath handling at all.
+  AC_ARG_ENABLE(rpath,
+    [  --disable-rpath         do not hardcode runtime library paths],
+    :, enable_rpath=yes)
+])
+
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  dnl By default, look in $includedir and $libdir.
+  use_additional=yes
+  AC_LIB_WITH_FINAL_PREFIX([
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+  ])
+  AC_LIB_ARG_WITH([lib$1-prefix],
+[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
+  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/lib"
+      fi
+    fi
+])
+  dnl Search the library and its dependencies in $additional_libdir and
+  dnl $LDFLAGS. Using breadth-first-seach.
+  LIB[]NAME=
+  LTLIB[]NAME=
+  INC[]NAME=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='$1 $2'
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+        dnl or AC_LIB_HAVE_LINKFLAGS call.
+        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+          else
+            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+            dnl that this library doesn't exist. So just drop it.
+            :
+          fi
+        else
+          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+          dnl and the already constructed $LIBNAME/$LTLIBNAME.
+          found_dir=
+          found_la=
+          found_so=
+          found_a=
+          if test $use_additional = yes; then
+            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
+              found_dir="$additional_libdir"
+              found_so="$additional_libdir/lib$name.$shlibext"
+              if test -f "$additional_libdir/lib$name.la"; then
+                found_la="$additional_libdir/lib$name.la"
+              fi
+            else
+              if test -f "$additional_libdir/lib$name.$libext"; then
+                found_dir="$additional_libdir"
+                found_a="$additional_libdir/lib$name.$libext"
+                if test -f "$additional_libdir/lib$name.la"; then
+                  found_la="$additional_libdir/lib$name.la"
+                fi
+              fi
+            fi
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIB[]NAME; do
+              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
+                    found_dir="$dir"
+                    found_so="$dir/lib$name.$shlibext"
+                    if test -f "$dir/lib$name.la"; then
+                      found_la="$dir/lib$name.la"
+                    fi
+                  else
+                    if test -f "$dir/lib$name.$libext"; then
+                      found_dir="$dir"
+                      found_a="$dir/lib$name.$libext"
+                      if test -f "$dir/lib$name.la"; then
+                        found_la="$dir/lib$name.la"
+                      fi
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+            dnl Found the library.
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+              dnl Linking with a shared library. We attempt to hardcode its
+              dnl directory into the executable's runpath, unless it's the
+              dnl standard /usr/lib.
+              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+                dnl No hardcoding is needed.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+              else
+                dnl Use an explicit option to hardcode DIR into the resulting
+                dnl binary.
+                dnl Potentially add DIR to ltrpathdirs.
+                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                dnl The hardcoding into $LIBNAME is system dependent.
+                if test "$hardcode_direct" = yes; then
+                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+                  dnl resulting binary.
+                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                else
+                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+                    dnl Use an explicit option to hardcode DIR into the resulting
+                    dnl binary.
+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                    dnl Potentially add DIR to rpathdirs.
+                    dnl The rpathdirs will be appended to $LIBNAME at the end.
+                    haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                    dnl Rely on "-L$found_dir".
+                    dnl But don't add it if it's already contained in the LDFLAGS
+                    dnl or the already constructed $LIBNAME
+                    haveit=
+                    for x in $LDFLAGS $LIB[]NAME; do
+                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+                    fi
+                    if test "$hardcode_minus_L" != no; then
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                    else
+                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
+                      dnl here, because this doesn't fit in flags passed to the
+                      dnl compiler. So give up. No hardcoding. This affects only
+                      dnl very old systems.
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                dnl Linking with a static library.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+              else
+                dnl We shouldn't come here, but anyway it's good to have a
+                dnl fallback.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+              fi
+            fi
+            dnl Assume the include files are nearby.
+            additional_includedir=
+            case "$found_dir" in
+              */lib | */lib/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+              dnl Potentially add $additional_includedir to $INCNAME.
+              dnl But don't add it
+              dnl   1. if it's the standard /usr/include,
+              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
+              dnl   3. if it's already present in $CPPFLAGS or the already
+              dnl      constructed $INCNAME,
+              dnl   4. if it doesn't exist as a directory.
+              if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux*) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INC[]NAME; do
+                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                      dnl Really add $additional_includedir to $INCNAME.
+                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+            dnl Look for dependencies.
+            if test -n "$found_la"; then
+              dnl Read the .la file. It defines the variables
+              dnl dlname, library_names, old_library, dependency_libs, current,
+              dnl age, revision, installed, dlopen, dlpreopen, libdir.
+              save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+              dnl We use only dependency_libs.
+              for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+                    dnl But don't add it
+                    dnl   1. if it's the standard /usr/lib,
+                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
+                    dnl   3. if it's already present in $LDFLAGS or the already
+                    dnl      constructed $LIBNAME,
+                    dnl   4. if it doesn't exist as a directory.
+                    if test "X$additional_libdir" != "X/usr/lib"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/lib"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux*) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                            dnl Really add $additional_libdir to $LIBNAME.
+                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                            dnl Really add $additional_libdir to $LTLIBNAME.
+                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                      dnl Potentially add DIR to rpathdirs.
+                      dnl The rpathdirs will be appended to $LIBNAME at the end.
+                      haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                      dnl Potentially add DIR to ltrpathdirs.
+                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                      haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                    dnl Handle this in the next round.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                    dnl Handle this in the next round. Throw away the .la's
+                    dnl directory; it is already contained in a preceding -L
+                    dnl option.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                    dnl Most likely an immediate library name.
+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+            dnl Didn't find the library; assume it is in the system directories
+            dnl known to the linker and runtime loader. (All the system
+            dnl directories known to the linker should also be known to the
+            dnl runtime loader, otherwise the system is severely misconfigured.)
+            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$hardcode_libdir_separator"; then
+      dnl Weird platform: only the last -rpath option counts, the user must
+      dnl pass all path elements in one option. We can arrange that for a
+      dnl single library, but not when more than one $LIBNAMEs are used.
+      alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+      done
+      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
+      acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+    else
+      dnl The -rpath options are cumulative.
+      for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+    dnl When using libtool, the option that works for both libraries and
+    dnl executables is -R. The -R options are cumulative.
+    for found_dir in $ltrpathdirs; do
+      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+    done
+  fi
+])
+
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+  for element in [$2]; do
+    haveit=
+    for x in $[$1]; do
+      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      [$1]="${[$1]}${[$1]:+ }$element"
+    fi
+  done
+])
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
new file mode 100644 (file)
index 0000000..8aff5a9
--- /dev/null
@@ -0,0 +1,155 @@
+# lib-prefix.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
+dnl require excessive bracketing.
+ifdef([AC_HELP_STRING],
+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
+
+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
+dnl to access previously installed libraries. The basic assumption is that
+dnl a user will want packages to use other packages he previously installed
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  dnl By default, look in $includedir and $libdir.
+  use_additional=yes
+  AC_LIB_WITH_FINAL_PREFIX([
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+  ])
+  AC_LIB_ARG_WITH([lib-prefix],
+[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+  --without-lib-prefix    don't search for libraries in includedir and libdir],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/lib"
+      fi
+    fi
+])
+  if test $use_additional = yes; then
+    dnl Potentially add $additional_includedir to $CPPFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/include,
+    dnl   2. if it's already present in $CPPFLAGS,
+    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
+    dnl   4. if it doesn't exist as a directory.
+    if test "X$additional_includedir" != "X/usr/include"; then
+      haveit=
+      for x in $CPPFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-I$additional_includedir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_includedir" = "X/usr/local/include"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux*) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_includedir"; then
+            dnl Really add $additional_includedir to $CPPFLAGS.
+            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+          fi
+        fi
+      fi
+    fi
+    dnl Potentially add $additional_libdir to $LDFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/lib,
+    dnl   2. if it's already present in $LDFLAGS,
+    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
+    dnl   4. if it doesn't exist as a directory.
+    if test "X$additional_libdir" != "X/usr/lib"; then
+      haveit=
+      for x in $LDFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-L$additional_libdir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_libdir" = "X/usr/local/lib"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux*) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_libdir"; then
+            dnl Really add $additional_libdir to $LDFLAGS.
+            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+          fi
+        fi
+      fi
+    fi
+  fi
+])
+
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+  dnl Unfortunately, prefix and exec_prefix get only finally determined
+  dnl at the end of configure.
+  if test "X$prefix" = "XNONE"; then
+    acl_final_prefix="$ac_default_prefix"
+  else
+    acl_final_prefix="$prefix"
+  fi
+  if test "X$exec_prefix" = "XNONE"; then
+    acl_final_exec_prefix='${prefix}'
+  else
+    acl_final_exec_prefix="$exec_prefix"
+  fi
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+  prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  $1
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+])
diff --git a/m4/longdouble.m4 b/m4/longdouble.m4
new file mode 100644 (file)
index 0000000..1333d2f
--- /dev/null
@@ -0,0 +1,30 @@
+# longdouble.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+dnl Test whether the compiler supports the 'long double' type.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_LONGDOUBLE],
+[
+  AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
+    [if test "$GCC" = yes; then
+       gt_cv_c_long_double=yes
+     else
+       AC_TRY_COMPILE([
+         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
+         long double foo = 0.0;
+         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
+         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
+         ], ,
+         gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
+     fi])
+  if test $gt_cv_c_long_double = yes; then
+    AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
+  fi
+])
diff --git a/m4/longlong.m4 b/m4/longlong.m4
new file mode 100644 (file)
index 0000000..d7d7350
--- /dev/null
@@ -0,0 +1,25 @@
+# longlong.m4 serial 4
+dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_LONG_LONG if 'long long' works.
+
+AC_DEFUN([jm_AC_TYPE_LONG_LONG],
+[
+  AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
+  [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
+    [long long llmax = (long long) -1;
+     return ll << i | ll >> i | llmax / ll | llmax % ll;],
+    ac_cv_type_long_long=yes,
+    ac_cv_type_long_long=no)])
+  if test $ac_cv_type_long_long = yes; then
+    AC_DEFINE(HAVE_LONG_LONG, 1,
+      [Define if you have the 'long long' type.])
+  fi
+])
diff --git a/m4/nls.m4 b/m4/nls.m4
new file mode 100644 (file)
index 0000000..36bc493
--- /dev/null
+++ b/m4/nls.m4
@@ -0,0 +1,49 @@
+# nls.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_DEFUN([AM_NLS],
+[
+  AC_MSG_CHECKING([whether NLS is requested])
+  dnl Default is enabled NLS
+  AC_ARG_ENABLE(nls,
+    [  --disable-nls           do not use Native Language Support],
+    USE_NLS=$enableval, USE_NLS=yes)
+  AC_MSG_RESULT($USE_NLS)
+  AC_SUBST(USE_NLS)
+])
+
+AC_DEFUN([AM_MKINSTALLDIRS],
+[
+  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
+  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
+  dnl Try to locate it.
+  MKINSTALLDIRS=
+  if test -n "$ac_aux_dir"; then
+    case "$ac_aux_dir" in
+      /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
+      *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
+    esac
+  fi
+  if test -z "$MKINSTALLDIRS"; then
+    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+  fi
+  AC_SUBST(MKINSTALLDIRS)
+])
diff --git a/m4/po.m4 b/m4/po.m4
new file mode 100644 (file)
index 0000000..e161998
--- /dev/null
+++ b/m4/po.m4
@@ -0,0 +1,426 @@
+# po.m4 serial 3 (gettext-0.14)
+dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+dnl Checks for all prerequisites of the po subdirectory.
+AC_DEFUN([AM_PO_SUBDIRS],
+[
+  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+  AC_REQUIRE([AC_PROG_INSTALL])dnl
+  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
+  AC_REQUIRE([AM_NLS])dnl
+
+  dnl Perform the following tests also if --disable-nls has been given,
+  dnl because they are needed for "make dist" to work.
+
+  dnl Search for GNU msgfmt in the PATH.
+  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
+  dnl The second test excludes FreeBSD msgfmt.
+  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
+     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+    :)
+  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+
+  dnl Search for GNU xgettext 0.12 or newer in the PATH.
+  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
+  dnl The second test excludes FreeBSD xgettext.
+  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
+     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+    :)
+  dnl Remove leftover from FreeBSD xgettext call.
+  rm -f messages.po
+
+  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
+  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
+    [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
+
+  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
+  dnl Test whether we really found GNU msgfmt.
+  if test "$GMSGFMT" != ":"; then
+    dnl If it is no GNU msgfmt we define it as : so that the
+    dnl Makefiles still can work.
+    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
+       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+      : ;
+    else
+      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
+      AC_MSG_RESULT(
+        [found $GMSGFMT program is not GNU msgfmt; ignore it])
+      GMSGFMT=":"
+    fi
+  fi
+
+  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
+  dnl Test whether we really found GNU xgettext.
+  if test "$XGETTEXT" != ":"; then
+    dnl If it is no GNU xgettext we define it as : so that the
+    dnl Makefiles still can work.
+    if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
+       (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+      : ;
+    else
+      AC_MSG_RESULT(
+        [found xgettext program is not GNU xgettext; ignore it])
+      XGETTEXT=":"
+    fi
+    dnl Remove leftover from FreeBSD xgettext call.
+    rm -f messages.po
+  fi
+
+  AC_OUTPUT_COMMANDS([
+    for ac_file in $CONFIG_FILES; do
+      # Support "outfile[:infile[:infile...]]"
+      case "$ac_file" in
+        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+      esac
+      # PO directories have a Makefile.in generated from Makefile.in.in.
+      case "$ac_file" in */Makefile.in)
+        # Adjust a relative srcdir.
+        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+        # In autoconf-2.13 it is called $ac_given_srcdir.
+        # In autoconf-2.50 it is called $srcdir.
+        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+        case "$ac_given_srcdir" in
+          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+          /*) top_srcdir="$ac_given_srcdir" ;;
+          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
+        esac
+        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+          rm -f "$ac_dir/POTFILES"
+          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[  ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+          POMAKEFILEDEPS="POTFILES.in"
+          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+          # on $ac_dir but don't depend on user-specified configuration
+          # parameters.
+          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+            # The LINGUAS file contains the set of available languages.
+            if test -n "$OBSOLETE_ALL_LINGUAS"; then
+              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+            fi
+            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+            # Hide the ALL_LINGUAS assigment from automake.
+            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+          else
+            # The set of available languages was given in configure.in.
+            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+          fi
+          # Compute POFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+          # Compute UPDATEPOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+          # Compute DUMMYPOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+          # Compute GMOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+          case "$ac_given_srcdir" in
+            .) srcdirpre= ;;
+            *) srcdirpre='$(srcdir)/' ;;
+          esac
+          POFILES=
+          UPDATEPOFILES=
+          DUMMYPOFILES=
+          GMOFILES=
+          for lang in $ALL_LINGUAS; do
+            POFILES="$POFILES $srcdirpre$lang.po"
+            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+          done
+          # CATALOGS depends on both $ac_dir and the user's LINGUAS
+          # environment variable.
+          INST_LINGUAS=
+          if test -n "$ALL_LINGUAS"; then
+            for presentlang in $ALL_LINGUAS; do
+              useit=no
+              if test "%UNSET%" != "$LINGUAS"; then
+                desiredlanguages="$LINGUAS"
+              else
+                desiredlanguages="$ALL_LINGUAS"
+              fi
+              for desiredlang in $desiredlanguages; do
+                # Use the presentlang catalog if desiredlang is
+                #   a. equal to presentlang, or
+                #   b. a variant of presentlang (because in this case,
+                #      presentlang can be used as a fallback for messages
+                #      which are not translated in the desiredlang catalog).
+                case "$desiredlang" in
+                  "$presentlang"*) useit=yes;;
+                esac
+              done
+              if test $useit = yes; then
+                INST_LINGUAS="$INST_LINGUAS $presentlang"
+              fi
+            done
+          fi
+          CATALOGS=
+          if test -n "$INST_LINGUAS"; then
+            for lang in $INST_LINGUAS; do
+              CATALOGS="$CATALOGS $lang.gmo"
+            done
+          fi
+          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+            if test -f "$f"; then
+              case "$f" in
+                *.orig | *.bak | *~) ;;
+                *) cat "$f" >> "$ac_dir/Makefile" ;;
+              esac
+            fi
+          done
+        fi
+        ;;
+      esac
+    done],
+   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+    # from automake.
+    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+    # Capture the value of LINGUAS because we need it to compute CATALOGS.
+    LINGUAS="${LINGUAS-%UNSET%}"
+   ])
+])
+
+dnl Postprocesses a Makefile in a directory containing PO files.
+AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
+[
+  # When this code is run, in config.status, two variables have already been
+  # set:
+  # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
+  # - LINGUAS is the value of the environment variable LINGUAS at configure
+  #   time.
+
+changequote(,)dnl
+  # Adjust a relative srcdir.
+  ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+  ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+  ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+  # In autoconf-2.13 it is called $ac_given_srcdir.
+  # In autoconf-2.50 it is called $srcdir.
+  test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+  case "$ac_given_srcdir" in
+    .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+    /*) top_srcdir="$ac_given_srcdir" ;;
+    *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  # Find a way to echo strings without interpreting backslash.
+  if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
+    gt_echo='echo'
+  else
+    if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
+      gt_echo='printf %s\n'
+    else
+      echo_func () {
+        cat <<EOT
+$*
+EOT
+      }
+      gt_echo='echo_func'
+    fi
+  fi
+
+  # A sed script that extracts the value of VARIABLE from a Makefile.
+  sed_x_variable='
+# Test if the hold space is empty.
+x
+s/P/P/
+x
+ta
+# Yes it was empty. Look if we have the expected variable definition.
+/^[     ]*VARIABLE[     ]*=/{
+  # Seen the first line of the variable definition.
+  s/^[  ]*VARIABLE[     ]*=//
+  ba
+}
+bd
+:a
+# Here we are processing a line from the variable definition.
+# Remove comment, more precisely replace it with a space.
+s/#.*$/ /
+# See if the line ends in a backslash.
+tb
+:b
+s/\\$//
+# Print the line, without the trailing backslash.
+p
+tc
+# There was no trailing backslash. The end of the variable definition is
+# reached. Clear the hold space.
+s/^.*$//
+x
+bd
+:c
+# A trailing backslash means that the variable definition continues in the
+# next line. Put a nonempty string into the hold space to indicate this.
+s/^.*$/P/
+x
+:d
+'
+changequote([,])dnl
+
+  # Set POTFILES to the value of the Makefile variable POTFILES.
+  sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
+  POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
+  # Compute POTFILES_DEPS as
+  #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
+  POTFILES_DEPS=
+  for file in $POTFILES; do
+    POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
+  done
+  POMAKEFILEDEPS=""
+
+  if test -n "$OBSOLETE_ALL_LINGUAS"; then
+    test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+  fi
+  if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+    # The LINGUAS file contains the set of available languages.
+    ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+    POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+  else
+    # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
+    sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
+    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
+  fi
+  # Hide the ALL_LINGUAS assigment from automake.
+  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+  # Compute POFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+  # Compute UPDATEPOFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+  # Compute DUMMYPOFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+  # Compute GMOFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+  # Compute PROPERTIESFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
+  # Compute CLASSFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
+  # Compute QMFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
+  # Compute MSGFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
+  # Compute RESOURCESDLLFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
+  case "$ac_given_srcdir" in
+    .) srcdirpre= ;;
+    *) srcdirpre='$(srcdir)/' ;;
+  esac
+  POFILES=
+  UPDATEPOFILES=
+  DUMMYPOFILES=
+  GMOFILES=
+  PROPERTIESFILES=
+  CLASSFILES=
+  QMFILES=
+  MSGFILES=
+  RESOURCESDLLFILES=
+  for lang in $ALL_LINGUAS; do
+    POFILES="$POFILES $srcdirpre$lang.po"
+    UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+    DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+    GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+    PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
+    CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
+    QMFILES="$QMFILES $srcdirpre$lang.qm"
+    frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+    MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
+    frobbedlang=`echo $lang | sed -e 's/_/-/g'`
+    RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
+  done
+  # CATALOGS depends on both $ac_dir and the user's LINGUAS
+  # environment variable.
+  INST_LINGUAS=
+  if test -n "$ALL_LINGUAS"; then
+    for presentlang in $ALL_LINGUAS; do
+      useit=no
+      if test "%UNSET%" != "$LINGUAS"; then
+        desiredlanguages="$LINGUAS"
+      else
+        desiredlanguages="$ALL_LINGUAS"
+      fi
+      for desiredlang in $desiredlanguages; do
+        # Use the presentlang catalog if desiredlang is
+        #   a. equal to presentlang, or
+        #   b. a variant of presentlang (because in this case,
+        #      presentlang can be used as a fallback for messages
+        #      which are not translated in the desiredlang catalog).
+        case "$desiredlang" in
+          "$presentlang"*) useit=yes;;
+        esac
+      done
+      if test $useit = yes; then
+        INST_LINGUAS="$INST_LINGUAS $presentlang"
+      fi
+    done
+  fi
+  CATALOGS=
+  JAVACATALOGS=
+  QTCATALOGS=
+  TCLCATALOGS=
+  CSHARPCATALOGS=
+  if test -n "$INST_LINGUAS"; then
+    for lang in $INST_LINGUAS; do
+      CATALOGS="$CATALOGS $lang.gmo"
+      JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
+      QTCATALOGS="$QTCATALOGS $lang.qm"
+      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+      TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
+      frobbedlang=`echo $lang | sed -e 's/_/-/g'`
+      CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
+    done
+  fi
+
+  sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
+  if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
+    # Add dependencies that cannot be formulated as a simple suffix rule.
+    for lang in $ALL_LINGUAS; do
+      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+      cat >> "$ac_file.tmp" <<EOF
+$frobbedlang.msg: $lang.po
+       @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+       \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+    done
+  fi
+  if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
+    # Add dependencies that cannot be formulated as a simple suffix rule.
+    for lang in $ALL_LINGUAS; do
+      frobbedlang=`echo $lang | sed -e 's/_/-/g'`
+      cat >> "$ac_file.tmp" <<EOF
+$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
+       @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+       \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+    done
+  fi
+  if test -n "$POMAKEFILEDEPS"; then
+    cat >> "$ac_file.tmp" <<EOF
+Makefile: $POMAKEFILEDEPS
+EOF
+  fi
+  mv "$ac_file.tmp" "$ac_file"
+])
diff --git a/m4/printf-posix.m4 b/m4/printf-posix.m4
new file mode 100644 (file)
index 0000000..186ba6a
--- /dev/null
@@ -0,0 +1,46 @@
+# printf-posix.m4 serial 2 (gettext-0.13.1)
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+dnl Test whether the printf() function supports POSIX/XSI format strings with
+dnl positions.
+
+AC_DEFUN([gt_PRINTF_POSIX],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
+    gt_cv_func_printf_posix,
+    [
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <string.h>
+/* The string "%2$d %1$d", with dollar characters protected from the shell's
+   dollar expansion (possibly an autoconf bug).  */
+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
+static char buf[100];
+int main ()
+{
+  sprintf (buf, format, 33, 55);
+  return (strcmp (buf, "55 33") != 0);
+}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
+      [
+        AC_EGREP_CPP(notposix, [
+#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
+  notposix
+#endif
+        ], gt_cv_func_printf_posix="guessing no",
+           gt_cv_func_printf_posix="guessing yes")
+      ])
+    ])
+  case $gt_cv_func_printf_posix in
+    *yes)
+      AC_DEFINE(HAVE_POSIX_PRINTF, 1,
+        [Define if your printf() function supports format strings with positions.])
+      ;;
+  esac
+])
diff --git a/m4/progtest.m4 b/m4/progtest.m4
new file mode 100644 (file)
index 0000000..8fe527c
--- /dev/null
@@ -0,0 +1,91 @@
+# progtest.m4 serial 3 (gettext-0.12)
+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+# Search path for a program which passes the given test.
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([AM_PATH_PROG_WITH_TEST],
+[
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  ac_executable_p="test -x"
+else
+  ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+  [[\\/]]* | ?:[[\\/]]*)
+    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+    ;;
+  *)
+    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in ifelse([$5], , $PATH, [$5]); do
+      IFS="$ac_save_IFS"
+      test -z "$ac_dir" && ac_dir=.
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          if [$3]; then
+            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
+            break 2
+          fi
+        fi
+      done
+    done
+    IFS="$ac_save_IFS"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+    ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
+  AC_MSG_RESULT([$]$1)
+else
+  AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
diff --git a/m4/readline.m4 b/m4/readline.m4
new file mode 100644 (file)
index 0000000..8e2cd40
--- /dev/null
@@ -0,0 +1,59 @@
+dnl Check for readline and dependencies
+dnl Copyright (C) 2004 Free Software Foundation, Inc.
+dnl
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl Defines WITH_READLINE to 1 if a working readline setup is
+dnl found, and sets @LIBREADLINE@ to the necessary libraries.
+
+AC_DEFUN([SDCV_CHECK_READLINE],
+[
+  AC_ARG_WITH(readline,
+     AC_HELP_STRING([--with-readline=DIR],
+       [look for the readline library in DIR]),
+     [_do_readline=$withval],[_do_readline=yes])
+
+  if test "$_do_readline" != "no" ; then
+     if test -d "$withval" ; then
+        CPPFLAGS="${CPPFLAGS} -I$withval/include"
+        LDFLAGS="${LDFLAGS} -L$withval/lib"
+     fi
+
+     for _termcap in "" "-ltermcap" "-lcurses" "-lncurses" ; do
+        _readline_save_libs=$LIBS
+        _combo="-lreadline${_termcap:+ $_termcap}"
+        LIBS="$LIBS $_combo"
+
+        AC_MSG_CHECKING([whether readline via \"$_combo\" is present and sane])
+
+        AC_LINK_IFELSE(AC_LANG_PROGRAM([
+#include <stdio.h>
+#include <readline/readline.h>
+#include <readline/history.h>
+],[
+add_history("foobar");
+rl_catch_signals=0;
+]),_found_readline=yes,_found_readline=no)
+
+        AC_MSG_RESULT([$_found_readline])
+
+        LIBS=$_readline_save_libs
+
+        if test $_found_readline = yes ; then
+           AC_DEFINE(WITH_READLINE,1,
+             [Define to 1 if you have a fully functional readline library.])
+           AC_SUBST(LIBREADLINE,$_combo)
+           break
+        fi
+     done
+
+     unset _termcap
+     unset _readline_save_libs
+     unset _combo
+     unset _found_readline
+  fi
+])dnl
diff --git a/m4/signed.m4 b/m4/signed.m4
new file mode 100644 (file)
index 0000000..dc1f54f
--- /dev/null
@@ -0,0 +1,19 @@
+# signed.m4 serial 1 (gettext-0.10.40)
+dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([bh_C_SIGNED],
+[
+  AC_CACHE_CHECK([for signed], bh_cv_c_signed,
+   [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
+  if test $bh_cv_c_signed = no; then
+    AC_DEFINE(signed, ,
+              [Define to empty if the C compiler doesn't support this keyword.])
+  fi
+])
diff --git a/m4/size_max.m4 b/m4/size_max.m4
new file mode 100644 (file)
index 0000000..5762fc3
--- /dev/null
@@ -0,0 +1,61 @@
+# size_max.m4 serial 2
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_SIZE_MAX],
+[
+  AC_CHECK_HEADERS(stdint.h)
+  dnl First test whether the system already has SIZE_MAX.
+  AC_MSG_CHECKING([for SIZE_MAX])
+  result=
+  AC_EGREP_CPP([Found it], [
+#include <limits.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef SIZE_MAX
+Found it
+#endif
+], result=yes)
+  if test -z "$result"; then
+    dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
+    dnl than the type 'unsigned long'.
+    dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
+    dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
+    _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
+      [#include <stddef.h>], result=?)
+    _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
+      [#include <stddef.h>], result=?)
+    _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
+      [#include <stddef.h>], result=?)
+    if test "$fits_in_uint" = 1; then
+      dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
+      dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
+      AC_TRY_COMPILE([#include <stddef.h>
+        extern size_t foo;
+        extern unsigned long foo;
+        ], [], fits_in_uint=0)
+    fi
+    if test -z "$result"; then
+      if test "$fits_in_uint" = 1; then
+        result="$res_hi$res_lo"U
+      else
+        result="$res_hi$res_lo"UL
+      fi
+    else
+      dnl Shouldn't happen, but who knows...
+      result='~(size_t)0'
+    fi
+  fi
+  AC_MSG_RESULT([$result])
+  if test "$result" != yes; then
+    AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
+      [Define as the maximum value of type 'size_t', if the system doesn't define it.])
+  fi
+])
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4
new file mode 100644 (file)
index 0000000..32ba7ae
--- /dev/null
@@ -0,0 +1,28 @@
+# stdint_h.m4 serial 3 (gettext-0.12)
+dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([jm_AC_HEADER_STDINT_H],
+[
+  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
+  [AC_TRY_COMPILE(
+    [#include <sys/types.h>
+#include <stdint.h>],
+    [uintmax_t i = (uintmax_t) -1;],
+    jm_ac_cv_header_stdint_h=yes,
+    jm_ac_cv_header_stdint_h=no)])
+  if test $jm_ac_cv_header_stdint_h = yes; then
+    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
+      [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
+       and declares uintmax_t. ])
+  fi
+])
diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4
new file mode 100644 (file)
index 0000000..b5f28d4
--- /dev/null
@@ -0,0 +1,32 @@
+# uintmax_t.m4 serial 7 (gettext-0.12)
+dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+AC_PREREQ(2.13)
+
+# Define uintmax_t to 'unsigned long' or 'unsigned long long'
+# if it is not already defined in <stdint.h> or <inttypes.h>.
+
+AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
+[
+  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
+  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
+  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
+    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
+    test $ac_cv_type_unsigned_long_long = yes \
+      && ac_type='unsigned long long' \
+      || ac_type='unsigned long'
+    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
+      [Define to unsigned long or unsigned long long
+       if <stdint.h> and <inttypes.h> don't define.])
+  else
+    AC_DEFINE(HAVE_UINTMAX_T, 1,
+      [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
+  fi
+])
diff --git a/m4/ulonglong.m4 b/m4/ulonglong.m4
new file mode 100644 (file)
index 0000000..1da8b80
--- /dev/null
@@ -0,0 +1,25 @@
+# ulonglong.m4 serial 3
+dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Paul Eggert.
+
+# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
+
+AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
+[
+  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
+  [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
+    [unsigned long long ullmax = (unsigned long long) -1;
+     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
+    ac_cv_type_unsigned_long_long=yes,
+    ac_cv_type_unsigned_long_long=no)])
+  if test $ac_cv_type_unsigned_long_long = yes; then
+    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
+      [Define if you have the 'unsigned long long' type.])
+  fi
+])
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4
new file mode 100644 (file)
index 0000000..d8fd1ec
--- /dev/null
@@ -0,0 +1,22 @@
+# wchar_t.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+dnl Test whether <stddef.h> has the 'wchar_t' type.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_WCHAR_T],
+[
+  AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
+    [AC_TRY_COMPILE([#include <stddef.h>
+       wchar_t foo = (wchar_t)'\0';], ,
+       gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
+  if test $gt_cv_c_wchar_t = yes; then
+    AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
+  fi
+])
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4
new file mode 100644 (file)
index 0000000..3d8d215
--- /dev/null
@@ -0,0 +1,22 @@
+# wint_t.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl From Bruno Haible.
+dnl Test whether <wchar.h> has the 'wint_t' type.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_WINT_T],
+[
+  AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
+    [AC_TRY_COMPILE([#include <wchar.h>
+       wint_t foo = (wchar_t)'\0';], ,
+       gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
+  if test $gt_cv_c_wint_t = yes; then
+    AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
+  fi
+])
diff --git a/m4/xsize.m4 b/m4/xsize.m4
new file mode 100644 (file)
index 0000000..9b7cf9b
--- /dev/null
@@ -0,0 +1,14 @@
+# xsize.m4 serial 2
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+AC_DEFUN([gl_XSIZE],
+[
+  dnl Prerequisites of lib/xsize.h.
+  AC_REQUIRE([gl_SIZE_MAX])
+  AC_CHECK_HEADERS(stdint.h)
+])
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644 (file)
index 0000000..ab287ca
--- /dev/null
@@ -0,0 +1,2 @@
+# Set of available languages.
+sk
\ No newline at end of file
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644 (file)
index 0000000..aa15d0b
--- /dev/null
@@ -0,0 +1,2 @@
+# Package source files
+src/mstardict.cpp
diff --git a/po/sk.po b/po/sk.po
new file mode 100644 (file)
index 0000000..fddf3df
--- /dev/null
+++ b/po/sk.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Roman Moravčík <roman.moravcik@gmail.com>, 2010.
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: mstardict\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-01-27 11:20+0100\n"
+"PO-Revision-Date: 2010-01-27 11:21+0100\n"
+"Last-Translator: Roman Moravčík <roman.moravcik@gmail.com>\n"
+"Language-Team: Slovak\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/mstardict.cpp:73
+msgid "Translation"
+msgstr "Preklad"
+
+#: ../src/mstardict.cpp:209
+msgid "MStardict"
+msgstr "Slovník"
+
+#: ../src/mstardict.cpp:217
+msgid "No search result"
+msgstr "Žiadne výsledky hľadania"
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..1d9e885
--- /dev/null
@@ -0,0 +1,12 @@
+SUBDIRS=lib
+bin_PROGRAMS = mstardict
+mstardict_SOURCES = \
+       mstardict.cpp mstardict.hpp \
+       libwrapper.cpp libwrapper.hpp
+
+mstardict_DEPENDENCIES = lib/libstardict.a
+mstardict_LDADD = @MSTARDICT_LIBS@ @LIBINTL@ lib/libstardict.a
+localedir = $(datadir)/locale
+
+INCLUDES = @MSTARDICT_CFLAGS@  -I$(top_builddir) -Ilib
+DEFS=-DLOCALEDIR=\"$(localedir)\" @DEFS@
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
new file mode 100644 (file)
index 0000000..e3a9921
--- /dev/null
@@ -0,0 +1,34 @@
+noinst_LIBRARIES = libstardict.a
+
+libstardict_a_SOURCES = \
+       lib.cpp lib.h   \
+       dictziplib.cpp dictziplib.hpp   \
+       distance.cpp distance.h \
+       mapfile.hpp file.hpp    \
+       kmp.cpp kmp.h   \
+       my_global.h m_ctype.h m_string.h        \
+       ctype-mb.cpp ctype-utf8.cpp ctype-uca.cpp       \
+       collation.cpp collation.h \
+       data.hpp data.cpp \
+       stddict.cpp stddict.hpp \
+       storage.cpp storage.h   \
+       treedict.cpp treedict.hpp       \
+       common.cpp common.hpp \
+       md5.c md5.h     \
+       stardict_client.cpp stardict_client.hpp \
+       sockets.cpp sockets.hpp \
+       http_client.cpp http_client.h   \
+       httpmanager.cpp httpmanager.h   \
+       plugin.cpp plugin.h \
+       virtualdictplugin.cpp virtualdictplugin.h \
+       netdictplugin.cpp netdictplugin.h \
+       specialdictplugin.cpp specialdictplugin.h \
+       netdictcache.cpp netdictcache.h \
+       ttsplugin.cpp ttsplugin.h       \
+       parsedata_plugin.cpp parsedata_plugin.h \
+       pluginmanager.cpp pluginmanager.h       \
+       dictmask.h      \
+       getuint32.h     \
+       stardict_libconfig.h
+
+INCLUDES = @LIB_STARDICT_CFLAGS@
diff --git a/src/lib/collation.cpp b/src/lib/collation.cpp
new file mode 100644 (file)
index 0000000..aa6827a
--- /dev/null
@@ -0,0 +1,121 @@
+#include "my_global.h"
+#include "m_ctype.h"
+
+#include <string.h>
+#include <glib.h>
+
+#include "collation.h"
+
+using namespace stardict_collation;
+
+static CHARSET_INFO *get_cs(CollateFunctions func)
+{
+       CHARSET_INFO *cs;
+       if (func == UTF8_GENERAL_CI)
+               cs = &my_charset_utf8_general_ci;
+       else if (func == UTF8_BIN)
+               cs = &my_charset_utf8_bin;
+       else if (func == UTF8_UNICODE_CI)
+               cs = &my_charset_utf8_general_uca_ci;
+       else if (func == UTF8_ICELANDIC_CI)
+               cs = &my_charset_utf8_icelandic_uca_ci;
+       else if (func == UTF8_LATVIAN_CI)
+               cs = &my_charset_utf8_latvian_uca_ci;
+       else if (func == UTF8_ROMANIAN_CI)
+               cs = &my_charset_utf8_romanian_uca_ci;
+       else if (func == UTF8_SLOVENIAN_CI)
+               cs = &my_charset_utf8_slovenian_uca_ci;
+       else if (func == UTF8_POLISH_CI)
+               cs = &my_charset_utf8_polish_uca_ci;
+       else if (func == UTF8_ESTONIAN_CI)
+               cs = &my_charset_utf8_estonian_uca_ci;
+       else if (func == UTF8_SPANISH_CI)
+               cs = &my_charset_utf8_spanish_uca_ci;
+       else if (func == UTF8_SWEDISH_CI)
+               cs = &my_charset_utf8_swedish_uca_ci;
+       else if (func == UTF8_TURKISH_CI)
+               cs = &my_charset_utf8_turkish_uca_ci;
+       else if (func == UTF8_CZECH_CI)
+               cs = &my_charset_utf8_czech_uca_ci;
+       else if (func == UTF8_DANISH_CI)
+               cs = &my_charset_utf8_danish_uca_ci;
+       else if (func == UTF8_LITHUANIAN_CI)
+               cs = &my_charset_utf8_lithuanian_uca_ci;
+       else if (func == UTF8_SLOVAK_CI)
+               cs = &my_charset_utf8_slovak_uca_ci;
+       else if (func == UTF8_SPANISH2_CI)
+               cs = &my_charset_utf8_spanish2_uca_ci;
+       else if (func == UTF8_ROMAN_CI)
+               cs = &my_charset_utf8_roman_uca_ci;
+       else if (func == UTF8_PERSIAN_CI)
+               cs = &my_charset_utf8_persian_uca_ci;
+       else if (func == UTF8_ESPERANTO_CI)
+               cs = &my_charset_utf8_esperanto_uca_ci;
+       else if (func == UTF8_HUNGARIAN_CI)
+               cs = &my_charset_utf8_hungarian_uca_ci;
+       else
+               cs = NULL;
+       return cs;
+}
+
+static GSList *my_once_root_block = NULL;
+
+static void *my_once_alloc(uint size)
+{
+       void *mem = g_malloc(size);
+       my_once_root_block = g_slist_prepend (my_once_root_block, mem);
+       return mem;
+}
+
+static void my_once_free()
+{
+       GSList *list = my_once_root_block;
+       while (list) {
+               g_free(list->data);
+               list = list->next;
+       }
+       g_slist_free(my_once_root_block);
+       my_once_root_block = NULL;
+}
+
+int utf8_collate_init(CollateFunctions func)
+{
+       CHARSET_INFO *cs = get_cs(func);
+       if (cs) {
+               if ((cs->cset->init && cs->cset->init(cs, my_once_alloc)) ||
+                       (cs->coll->init && cs->coll->init(cs, my_once_alloc)))
+                       return TRUE;
+               else
+                       return FALSE;
+       } else
+               return TRUE;
+}
+
+int utf8_collate_init_all()
+{
+       CHARSET_INFO *cs;
+       for (int func=0; func<COLLATE_FUNC_NUMS; func++) {
+               cs = get_cs((CollateFunctions)func);
+               if (cs) {
+                       if ((cs->cset->init && cs->cset->init(cs, my_once_alloc)) ||
+                               (cs->coll->init && cs->coll->init(cs, my_once_alloc)))
+                               return TRUE;
+               } else
+                       return TRUE;
+       }
+       return FALSE;
+}
+
+int utf8_collate(const char *str1, const char *str2, CollateFunctions func)
+{
+       CHARSET_INFO *cs = get_cs(func);
+       if (cs) {
+               return cs->coll->strnncoll(cs, (const uchar*)str1, strlen(str1), (const uchar*)str2, strlen(str2), 0);
+       } else
+               return 0; //Should never happen.
+}
+
+void utf8_collate_end()
+{
+       my_once_free();
+}
diff --git a/src/lib/collation.h b/src/lib/collation.h
new file mode 100644 (file)
index 0000000..47503de
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef _COLLATION_H_
+#define _COLLATION_H_
+
+typedef enum {
+       UTF8_GENERAL_CI = 0,
+       UTF8_UNICODE_CI,
+       UTF8_BIN,
+       UTF8_CZECH_CI,
+       UTF8_DANISH_CI,
+       UTF8_ESPERANTO_CI,
+       UTF8_ESTONIAN_CI,
+       UTF8_HUNGARIAN_CI,
+       UTF8_ICELANDIC_CI,
+       UTF8_LATVIAN_CI,
+       UTF8_LITHUANIAN_CI,
+       UTF8_PERSIAN_CI,
+       UTF8_POLISH_CI,
+       UTF8_ROMAN_CI,
+       UTF8_ROMANIAN_CI,
+       UTF8_SLOVAK_CI,
+       UTF8_SLOVENIAN_CI,
+       UTF8_SPANISH_CI,
+       UTF8_SPANISH2_CI,
+       UTF8_SWEDISH_CI,
+       UTF8_TURKISH_CI,
+       COLLATE_FUNC_NUMS
+} CollateFunctions;
+
+extern int utf8_collate_init(CollateFunctions func);
+extern int utf8_collate_init_all();
+extern int utf8_collate(const char *str1, const char *str2, CollateFunctions func);
+extern void utf8_collate_end();
+
+
+#endif
diff --git a/src/lib/common.cpp b/src/lib/common.cpp
new file mode 100644 (file)
index 0000000..6575ad9
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+ * This file part of StarDict - A international dictionary for GNOME.
+ * http://stardict.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * implementation of methods of common for dictionaries structures
+ */
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "common.hpp"
+
+static void parse_description(const char *p, long len, std::string &description)
+{
+       description.clear();
+       const char *p1 = p;
+       while (p1 - p < len) {
+               if (*p1 == '<') {
+                       p1++;
+                       if ((*p1 == 'b' || *p1 == 'B') && (*(p1+1)=='r' || *(p1+1)=='R') && *(p1+2)=='>') {
+                               description += '\n';
+                               p1+=3;
+                       } else {
+                               description += '<';
+                       }
+               } else {
+                       description += *p1;
+                       p1++;
+               }
+       }
+}
+
+//looks not optimal, TODO: refactor
+bool DictInfo::load_from_ifo_file(const std::string& ifofilename,
+                                 bool istreedict)
+{
+       ifo_file_name=ifofilename;
+       gchar *buffer;
+       if (!g_file_get_contents(ifofilename.c_str(), &buffer, NULL, NULL))
+               return false;
+
+#define TREEDICT_MAGIC_DATA "StarDict's treedict ifo file\nversion="
+#define DICT_MAGIC_DATA "StarDict's dict ifo file\nversion="
+       const gchar *magic_data=istreedict ? TREEDICT_MAGIC_DATA : DICT_MAGIC_DATA;
+       if (!g_str_has_prefix(buffer, magic_data)) {
+               g_free(buffer);
+               return false;
+       }
+
+       bool is_dict_300 = false;
+       gchar *p1;
+       if (istreedict) {
+               p1 = buffer + sizeof(TREEDICT_MAGIC_DATA) -1;
+#define TREEDICT_VERSION_242 "2.4.2\n"
+               if (g_str_has_prefix(p1, TREEDICT_VERSION_242)) {
+                       p1 += sizeof(TREEDICT_VERSION_242) -2;
+               } else {
+                       g_print("Load %s failed: Unknown version.\n", ifofilename.c_str());
+                       g_free(buffer);
+                       return false;
+               }
+       } else {
+               p1 = buffer + sizeof(DICT_MAGIC_DATA) -1;
+#define DICT_VERSION_242 "2.4.2\n"
+#define DICT_VERSION_300 "3.0.0\n"
+               if (g_str_has_prefix(p1, DICT_VERSION_242)) {
+                       p1 += sizeof(DICT_VERSION_242) -2;
+               } else if (g_str_has_prefix(p1, DICT_VERSION_300)) {
+                       p1 += sizeof(DICT_VERSION_300) -2;
+                       is_dict_300 = true;
+               } else {
+                       g_print("Load %s failed: Unknown version.\n", ifofilename.c_str());
+                       g_free(buffer);
+                       return false;
+               }
+       }
+
+       gchar *p2,*p3;
+
+       if (is_dict_300) {
+               p2 = strstr(p1,"\nidxoffsetbits=");
+               if (p2) {
+                       p2 = p2 + sizeof("\nidxoffsetbits=") -1;
+                       if (g_str_has_prefix(p2, "64\n")) {
+                               // TODO
+                               g_print("Load %s failed: not supported presently.\n", ifofilename.c_str());
+                               g_free(buffer);
+                               return false;
+                       }
+               }
+       }
+
+       p2 = strstr(p1,"\nwordcount=");
+       if (!p2) {
+               g_free(buffer);
+               return false;
+       }
+
+       p3 = strchr(p2+ sizeof("\nwordcount=")-1,'\n');
+       gchar *tmpstr = (gchar *)g_memdup(p2+sizeof("\nwordcount=")-1, p3-(p2+sizeof("\nwordcount=")-1)+1);
+       tmpstr[p3-(p2+sizeof("\nwordcount=")-1)] = '\0';
+       wordcount = atol(tmpstr);
+       g_free(tmpstr);
+
+       p2 = strstr(p1,"\nsynwordcount=");
+       if (p2) {
+               p3 = strchr(p2+ sizeof("\nsynwordcount=")-1,'\n');
+               gchar *tmpstr = (gchar *)g_memdup(p2+sizeof("\nsynwordcount=")-1, p3-(p2+sizeof("\nsynwordcount=")-1)+1);
+               tmpstr[p3-(p2+sizeof("\nsynwordcount=")-1)] = '\0';
+               synwordcount = atol(tmpstr);
+               g_free(tmpstr);
+       } else {
+               synwordcount = 0;
+       }
+
+       if (istreedict) {
+               p2 = strstr(p1,"\ntdxfilesize=");
+               if (!p2) {
+                       g_free(buffer);
+                       return false;
+               }
+               p3 = strchr(p2+ sizeof("\ntdxfilesize=")-1,'\n');
+               tmpstr = (gchar *)g_memdup(p2+sizeof("\ntdxfilesize=")-1, p3-(p2+sizeof("\ntdxfilesize=")-1)+1);
+               tmpstr[p3-(p2+sizeof("\ntdxfilesize=")-1)] = '\0';
+               index_file_size = atol(tmpstr);
+               g_free(tmpstr);
+       } else {
+               p2 = strstr(p1,"\nidxfilesize=");
+               if (!p2) {
+                       g_free(buffer);
+                       return false;
+               }
+
+               p3 = strchr(p2+ sizeof("\nidxfilesize=")-1,'\n');
+               tmpstr = (gchar *)g_memdup(p2+sizeof("\nidxfilesize=")-1, p3-(p2+sizeof("\nidxfilesize=")-1)+1);
+               tmpstr[p3-(p2+sizeof("\nidxfilesize=")-1)] = '\0';
+               index_file_size = atol(tmpstr);
+               g_free(tmpstr);
+
+               p2 = strstr(p1,"\ndicttype=");
+               if (p2) {
+                       p2+=sizeof("\ndicttype=")-1;
+                       p3 = strchr(p2, '\n');
+                       dicttype.assign(p2, p3-p2);
+               }
+       }
+
+       p2 = strstr(p1,"\nbookname=");
+
+       if (!p2) {
+               g_free(buffer);
+               return false;
+       }
+
+       p2 = p2 + sizeof("\nbookname=") -1;
+       p3 = strchr(p2, '\n');
+       bookname.assign(p2, p3-p2);
+
+       p2 = strstr(p1,"\nauthor=");
+       if (p2) {
+               p2 = p2 + sizeof("\nauthor=") -1;
+               p3 = strchr(p2, '\n');
+               author.assign(p2, p3-p2);
+       }
+
+       p2 = strstr(p1,"\nemail=");
+       if (p2) {
+               p2 = p2 + sizeof("\nemail=") -1;
+               p3 = strchr(p2, '\n');
+               email.assign(p2, p3-p2);
+       }
+
+       p2 = strstr(p1,"\nwebsite=");
+       if (p2) {
+               p2 = p2 + sizeof("\nwebsite=") -1;
+               p3 = strchr(p2, '\n');
+               website.assign(p2, p3-p2);
+       }
+
+       p2 = strstr(p1,"\ndate=");
+       if (p2) {
+               p2 = p2 + sizeof("\ndate=") -1;
+               p3 = strchr(p2, '\n');
+               date.assign(p2, p3-p2);
+       }
+
+       p2 = strstr(p1,"\ndescription=");
+       if (p2) {
+               p2 = p2 + sizeof("\ndescription=")-1;
+               p3 = strchr(p2, '\n');
+               parse_description(p2, p3-p2, description);
+       }
+
+       p2 = strstr(p1,"\nsametypesequence=");
+       if (p2) {
+               p2+=sizeof("\nsametypesequence=")-1;
+               p3 = strchr(p2, '\n');
+               sametypesequence.assign(p2, p3-p2);
+       }
+
+       g_free(buffer);
+
+       return true;
+}
+
diff --git a/src/lib/common.hpp b/src/lib/common.hpp
new file mode 100644 (file)
index 0000000..f26335b
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _COMMON_HPP_
+#define _COMMON_HPP_
+
+#include <glib.h>
+#include <list>
+#include <string>
+
+//this structure contain all information about dictionary
+struct DictInfo {
+  std::string ifo_file_name;
+  guint32 wordcount;
+  guint32 synwordcount;
+  std::string bookname;
+  std::string author;
+  std::string email;
+  std::string website;
+  std::string date;
+  std::string description;
+  guint32 index_file_size;
+  std::string sametypesequence;
+  std::string dicttype;
+  bool load_from_ifo_file(const std::string& ifofilename, bool istreedict);
+};
+
+typedef std::list<std::string> strlist_t;
+
+#endif//!_COMMON_HPP_
diff --git a/src/lib/ctype-mb.cpp b/src/lib/ctype-mb.cpp
new file mode 100644 (file)
index 0000000..1922806
--- /dev/null
@@ -0,0 +1,958 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "my_global.h"
+#include "m_ctype.h"
+#include "m_string.h"
+
+using namespace stardict_collation;
+
+//#ifdef USE_MB
+#if 0
+
+
+void my_caseup_str_mb(CHARSET_INFO * cs, char *str)
+{
+  register uint32 l;
+  register char *end=str+strlen(str); /* BAR TODO: remove strlen() call */
+  register uchar *map=cs->to_upper;
+  
+  while (*str)
+  {
+    if ((l=my_ismbchar(cs, str,end)))
+      str+=l;
+    else
+    { 
+      *str=(char) map[(uchar)*str];
+      str++;
+    }
+  }
+}
+
+void my_casedn_str_mb(CHARSET_INFO * cs, char *str)
+{
+  register uint32 l;
+  register char *end=str+strlen(str);
+  register uchar *map=cs->to_lower;
+  
+  while (*str)
+  {
+    if ((l=my_ismbchar(cs, str,end)))
+      str+=l;
+    else
+    {
+      *str=(char) map[(uchar)*str];
+      str++;
+    }
+  }
+}
+
+uint my_caseup_mb(CHARSET_INFO * cs, char *src, uint srclen,
+                  char *dst __attribute__((unused)),
+                  uint dstlen __attribute__((unused)))
+{
+  register uint32 l;
+  register char *srcend= src + srclen;
+  register uchar *map= cs->to_upper;
+
+  DBUG_ASSERT(src == dst && srclen == dstlen);
+  while (src < srcend)
+  {
+    if ((l=my_ismbchar(cs, src, srcend)))
+      src+= l;
+    else 
+    {
+      *src=(char) map[(uchar) *src];
+      src++;
+    }
+  }
+  return srclen;
+}
+
+uint my_casedn_mb(CHARSET_INFO * cs, char *src, uint srclen,
+                  char *dst __attribute__((unused)),
+                  uint dstlen __attribute__((unused)))
+{
+  register uint32 l;
+  register char *srcend= src + srclen;
+  register uchar *map=cs->to_lower;
+
+  DBUG_ASSERT(src == dst && srclen == dstlen);  
+  while (src < srcend)
+  {
+    if ((l= my_ismbchar(cs, src, srcend)))
+      src+= l;
+    else
+    {
+      *src= (char) map[(uchar)*src];
+      src++;
+    }
+  }
+  return srclen;
+}
+
+int my_strcasecmp_mb(CHARSET_INFO * cs,const char *s, const char *t)
+{
+  register uint32 l;
+  register const char *end=s+strlen(s);
+  register uchar *map=cs->to_upper;
+  
+  while (s<end)
+  {
+    if ((l=my_ismbchar(cs, s,end)))
+    {
+      while (l--)
+        if (*s++ != *t++) 
+          return 1;
+    }
+    else if (my_mbcharlen(cs, *t) > 1)
+      return 1;
+    else if (map[(uchar) *s++] != map[(uchar) *t++])
+      return 1;
+  }
+  return *t;
+}
+
+
+/*
+** Compare string against string with wildcard
+**     0 if matched
+**     -1 if not matched with wildcard
+**      1 if matched with wildcard
+*/
+
+#define INC_PTR(cs,A,B) A+=(my_ismbchar(cs,A,B) ? my_ismbchar(cs,A,B) : 1)
+
+#define likeconv(s,A) (uchar) (s)->sort_order[(uchar) (A)]
+
+int my_wildcmp_mb(CHARSET_INFO *cs,
+                 const char *str,const char *str_end,
+                 const char *wildstr,const char *wildend,
+                 int escape, int w_one, int w_many)
+{
+  int result= -1;                              /* Not found, using wildcards */
+
+  while (wildstr != wildend)
+  {
+    while (*wildstr != w_many && *wildstr != w_one)
+    {
+      int l;
+      if (*wildstr == escape && wildstr+1 != wildend)
+       wildstr++;
+      if ((l = my_ismbchar(cs, wildstr, wildend)))
+      {
+         if (str+l > str_end || memcmp(str, wildstr, l) != 0)
+             return 1;
+         str += l;
+         wildstr += l;
+      }
+      else
+      if (str == str_end || likeconv(cs,*wildstr++) != likeconv(cs,*str++))
+       return(1);                              /* No match */
+      if (wildstr == wildend)
+       return (str != str_end);                /* Match if both are at end */
+      result=1;                                        /* Found an anchor char */
+    }
+    if (*wildstr == w_one)
+    {
+      do
+      {
+       if (str == str_end)                     /* Skip one char if possible */
+         return (result);
+       INC_PTR(cs,str,str_end);
+      } while (++wildstr < wildend && *wildstr == w_one);
+      if (wildstr == wildend)
+       break;
+    }
+    if (*wildstr == w_many)
+    {                                          /* Found w_many */
+      uchar cmp;
+      const char* mb = wildstr;
+      int mblen=0;
+      
+      wildstr++;
+      /* Remove any '%' and '_' from the wild search string */
+      for (; wildstr != wildend ; wildstr++)
+      {
+       if (*wildstr == w_many)
+         continue;
+       if (*wildstr == w_one)
+       {
+         if (str == str_end)
+           return (-1);
+         INC_PTR(cs,str,str_end);
+         continue;
+       }
+       break;                                  /* Not a wild character */
+      }
+      if (wildstr == wildend)
+       return(0);                              /* Ok if w_many is last */
+      if (str == str_end)
+       return -1;
+      
+      if ((cmp= *wildstr) == escape && wildstr+1 != wildend)
+       cmp= *++wildstr;
+       
+      mb=wildstr;
+      mblen= my_ismbchar(cs, wildstr, wildend);
+      INC_PTR(cs,wildstr,wildend);             /* This is compared trough cmp */
+      cmp=likeconv(cs,cmp);   
+      do
+      {
+        for (;;)
+        {
+          if (str >= str_end)
+            return -1;
+          if (mblen)
+          {
+            if (str+mblen <= str_end && memcmp(str, mb, mblen) == 0)
+            {
+              str += mblen;
+              break;
+            }
+          }
+          else if (!my_ismbchar(cs, str, str_end) &&
+                   likeconv(cs,*str) == cmp)
+          {
+            str++;
+            break;
+          }
+          INC_PTR(cs,str, str_end);
+        }
+       {
+         int tmp=my_wildcmp_mb(cs,str,str_end,wildstr,wildend,escape,w_one,
+                                w_many);
+         if (tmp <= 0)
+           return (tmp);
+       }
+      } while (str != str_end && wildstr[0] != w_many);
+      return(-1);
+    }
+  }
+  return (str != str_end ? 1 : 0);
+}
+
+
+uint my_numchars_mb(CHARSET_INFO *cs __attribute__((unused)),
+                     const char *pos, const char *end)
+{
+  register uint32 count=0;
+  while (pos < end) 
+  {
+    uint mblen;
+    pos+= (mblen= my_ismbchar(cs,pos,end)) ? mblen : 1;
+    count++;
+  }
+  return count;
+}
+
+
+uint my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)),
+                    const char *pos, const char *end, uint length)
+{
+  const char *start= pos;
+  
+  while (length && pos < end)
+  {
+    uint mblen;
+    pos+= (mblen= my_ismbchar(cs, pos, end)) ? mblen : 1;
+    length--;
+  }
+  return (uint) (length ? end+2-start : pos-start);
+}
+
+
+uint my_well_formed_len_mb(CHARSET_INFO *cs, const char *b, const char *e,
+                           uint pos, int *error)
+{
+  const char *b_start= b;
+  *error= 0;
+  while (pos)
+  {
+    my_wc_t wc;
+    int mblen;
+
+    if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <= 0)
+    {
+      *error= b < e ? 1 : 0;
+      break;
+    }
+    b+= mblen;
+    pos--;
+  }
+  return (uint) (b - b_start);
+}
+
+
+
+uint my_instr_mb(CHARSET_INFO *cs,
+                 const char *b, uint b_length, 
+                 const char *s, uint s_length,
+                 my_match_t *match, uint nmatch)
+{
+  register const char *end, *b0;
+  int res= 0;
+  
+  if (s_length <= b_length)
+  {
+    if (!s_length)
+    {
+      if (nmatch)
+      {
+        match->beg= 0;
+        match->end= 0;
+        match->mblen= 0;
+      }
+      return 1;                /* Empty string is always found */
+    }
+    
+    b0= b;
+    end= b+b_length-s_length+1;
+    
+    while (b < end)
+    {
+      int mblen;
+      
+      if (!cs->coll->strnncoll(cs, (unsigned char*) b,   s_length, 
+                                  (unsigned char*) s, s_length, 0))
+      {
+        if (nmatch)
+        {
+          match[0].beg= 0;
+          match[0].end= (uint) (b-b0);
+          match[0].mblen= res;
+          if (nmatch > 1)
+          {
+            match[1].beg= match[0].end;
+            match[1].end= match[0].end+s_length;
+            match[1].mblen= 0; /* Not computed */
+          }
+        }
+        return 2;
+      }
+      mblen= (mblen= my_ismbchar(cs, b, end)) ? mblen : 1;
+      b+= mblen;
+      b_length-= mblen;
+      res++;
+    }
+  }
+  return 0;
+}
+#endif
+
+/* BINARY collations handlers for MB charsets */
+
+static int my_strnncoll_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
+                               const uchar *s, uint slen,
+                               const uchar *t, uint tlen,
+                                my_bool t_is_prefix)
+{
+  uint len=min(slen,tlen);
+  int cmp= memcmp(s,t,len);
+  return cmp ? cmp : (int) ((t_is_prefix ? len : slen) - tlen);
+}
+
+#if 0
+/*
+  Compare two strings. 
+  
+  SYNOPSIS
+    my_strnncollsp_mb_bin()
+    cs                 Chararacter set
+    s                  String to compare
+    slen               Length of 's'
+    t                  String to compare
+    tlen               Length of 't'
+    diff_if_only_endspace_difference
+                       Set to 1 if the strings should be regarded as different
+                        if they only difference in end space
+
+  NOTE
+   This function is used for character strings with binary collations.
+   The shorter string is extended with end space to be as long as the longer
+   one.
+
+  RETURN
+    A negative number if s < t
+    A positive number if s > t
+    0 if strings are equal
+*/
+
+static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
+                                 const uchar *a, uint a_length, 
+                                 const uchar *b, uint b_length,
+                                 my_bool diff_if_only_endspace_difference)
+{
+  const uchar *end;
+  uint length;
+  int res;
+
+#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
+  diff_if_only_endspace_difference= 0;
+#endif
+  
+  end= a + (length= min(a_length, b_length));
+  while (a < end)
+  {
+    if (*a++ != *b++)
+      return ((int) a[-1] - (int) b[-1]);
+  }
+  res= 0;
+  if (a_length != b_length)
+  {
+    int swap= 1;
+    if (diff_if_only_endspace_difference)
+      res= 1;                                   /* Assume 'a' is bigger */
+    /*
+      Check the next not space character of the longer key. If it's < ' ',
+      then it's smaller than the other key.
+    */
+    if (a_length < b_length)
+    {
+      /* put shorter key in s */
+      a_length= b_length;
+      a= b;
+      swap= -1;                                        /* swap sign of result */
+      res= -res;
+    }
+    for (end= a + a_length-length; a < end ; a++)
+    {
+      if (*a != ' ')
+       return (*a < ' ') ? -swap : swap;
+    }
+  }
+  return res;
+}
+
+
+static int my_strnxfrm_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
+                              uchar * dest, uint dstlen,
+                              const uchar *src, uint srclen)
+{
+  if (dest != src)
+    memcpy(dest, src, min(dstlen, srclen));
+  if (dstlen > srclen)
+    bfill(dest + srclen, dstlen - srclen, ' ');
+  return dstlen;
+}
+
+
+static int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
+                     const char *s, const char *t)
+{
+  return strcmp(s,t);
+}
+
+static void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
+                     const uchar *key, uint len,ulong *nr1, ulong *nr2)
+{
+  const uchar *pos = key;
+  
+  key+= len;
+  
+  for (; pos < (uchar*) key ; pos++)
+  {
+    nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * 
+            ((uint)*pos)) + (nr1[0] << 8);
+    nr2[0]+=3;
+  }
+}
+
+
+/* 
+  Write max key: create a buffer with multibyte
+  representation of the max_sort_char character,
+  and copy it into max_str in a loop. 
+*/
+static void pad_max_char(CHARSET_INFO *cs, char *str, char *end)
+{
+  char buf[10];
+  char buflen= cs->cset->wc_mb(cs, cs->max_sort_char, (uchar*) buf,
+                               (uchar*) buf + sizeof(buf));
+  DBUG_ASSERT(buflen > 0);
+  do
+  {
+    if ((str + buflen) < end)
+    {
+      /* Enough space for the characer */
+      memcpy(str, buf, buflen);
+      str+= buflen;
+    }
+    else
+    {
+      /* 
+        There is no space for whole multibyte
+        character, then add trailing spaces.
+      */  
+      *str++= ' ';
+    }
+  } while (str < end);
+}
+
+/*
+** Calculate min_str and max_str that ranges a LIKE string.
+** Arguments:
+** ptr         Pointer to LIKE string.
+** ptr_length  Length of LIKE string.
+** escape      Escape character in LIKE.  (Normally '\').
+**             All escape characters should be removed from min_str and max_str
+** res_length  Length of min_str and max_str.
+** min_str     Smallest case sensitive string that ranges LIKE.
+**             Should be space padded to res_length.
+** max_str     Largest case sensitive string that ranges LIKE.
+**             Normally padded with the biggest character sort value.
+**
+** The function should return 0 if ok and 1 if the LIKE string can't be
+** optimized !
+*/
+
+my_bool my_like_range_mb(CHARSET_INFO *cs,
+                        const char *ptr,uint ptr_length,
+                        pbool escape, pbool w_one, pbool w_many,
+                        uint res_length,
+                        char *min_str,char *max_str,
+                        uint *min_length,uint *max_length)
+{
+  const char *end= ptr + ptr_length;
+  char *min_org= min_str;
+  char *min_end= min_str + res_length;
+  char *max_end= max_str + res_length;
+  uint charlen= res_length / cs->mbmaxlen;
+
+  for (; ptr != end && min_str != min_end && charlen > 0 ; ptr++, charlen--)
+  {
+    if (*ptr == escape && ptr+1 != end)
+    {
+      ptr++;                                   /* Skip escape */
+      *min_str++= *max_str++ = *ptr;
+      continue;
+    }
+    if (*ptr == w_one || *ptr == w_many)       /* '_' and '%' in SQL */
+    {
+      charlen= my_charpos(cs, min_org, min_str, res_length/cs->mbmaxlen);
+      
+      if (charlen < (uint) (min_str - min_org))
+        min_str= min_org + charlen;
+      
+      /*
+        Calculate length of keys:
+        'a\0\0... is the smallest possible string when we have space expand
+        a\ff\ff... is the biggest possible string
+      */
+      *min_length= ((cs->state & MY_CS_BINSORT) ? (uint) (min_str - min_org) :
+                    res_length);
+      *max_length= res_length;
+      /* Create min key  */
+      do
+      {
+       *min_str++= (char) cs->min_sort_char;
+      } while (min_str != min_end);
+      
+      /* 
+        Write max key: create a buffer with multibyte
+        representation of the max_sort_char character,
+        and copy it into max_str in a loop. 
+      */
+      *max_length= res_length;
+      pad_max_char(cs, max_str, max_end);
+      return 0;
+    }
+    *min_str++= *max_str++ = *ptr;
+  }
+
+  *min_length= *max_length = (uint) (min_str - min_org);
+  while (min_str != min_end)
+    *min_str++= *max_str++= ' ';           /* Because if key compression */
+  return 0;
+}
+
+
+static int my_wildcmp_mb_bin(CHARSET_INFO *cs,
+                 const char *str,const char *str_end,
+                 const char *wildstr,const char *wildend,
+                 int escape, int w_one, int w_many)
+{
+  int result= -1;                              /* Not found, using wildcards */
+
+  while (wildstr != wildend)
+  {
+    while (*wildstr != w_many && *wildstr != w_one)
+    {
+      int l;
+      if (*wildstr == escape && wildstr+1 != wildend)
+       wildstr++;
+      if ((l = my_ismbchar(cs, wildstr, wildend)))
+      {
+         if (str+l > str_end || memcmp(str, wildstr, l) != 0)
+             return 1;
+         str += l;
+         wildstr += l;
+      }
+      else
+      if (str == str_end || *wildstr++ != *str++)
+       return(1);                              /* No match */
+      if (wildstr == wildend)
+       return (str != str_end);                /* Match if both are at end */
+      result=1;                                        /* Found an anchor char */
+    }
+    if (*wildstr == w_one)
+    {
+      do
+      {
+       if (str == str_end)                     /* Skip one char if possible */
+         return (result);
+       INC_PTR(cs,str,str_end);
+      } while (++wildstr < wildend && *wildstr == w_one);
+      if (wildstr == wildend)
+       break;
+    }
+    if (*wildstr == w_many)
+    {                                          /* Found w_many */
+      uchar cmp;
+      const char* mb = wildstr;
+      int mblen=0;
+      
+      wildstr++;
+      /* Remove any '%' and '_' from the wild search string */
+      for (; wildstr != wildend ; wildstr++)
+      {
+       if (*wildstr == w_many)
+         continue;
+       if (*wildstr == w_one)
+       {
+         if (str == str_end)
+           return (-1);
+         INC_PTR(cs,str,str_end);
+         continue;
+       }
+       break;                                  /* Not a wild character */
+      }
+      if (wildstr == wildend)
+       return(0);                              /* Ok if w_many is last */
+      if (str == str_end)
+       return -1;
+      
+      if ((cmp= *wildstr) == escape && wildstr+1 != wildend)
+       cmp= *++wildstr;
+       
+      mb=wildstr;
+      mblen= my_ismbchar(cs, wildstr, wildend);
+      INC_PTR(cs,wildstr,wildend);             /* This is compared trough cmp */
+      do
+      {
+        for (;;)
+        {
+          if (str >= str_end)
+            return -1;
+          if (mblen)
+          {
+            if (str+mblen <= str_end && memcmp(str, mb, mblen) == 0)
+            {
+              str += mblen;
+              break;
+            }
+          }
+          else if (!my_ismbchar(cs, str, str_end) && *str == cmp)
+          {
+            str++;
+            break;
+          }
+          INC_PTR(cs,str, str_end);
+        }
+       {
+         int tmp=my_wildcmp_mb_bin(cs,str,str_end,wildstr,wildend,escape,w_one,w_many);
+         if (tmp <= 0)
+           return (tmp);
+       }
+      } while (str != str_end && wildstr[0] != w_many);
+      return(-1);
+    }
+  }
+  return (str != str_end ? 1 : 0);
+}
+
+
+/*
+  Data was produced from EastAsianWidth.txt 
+  using utt11-dump utility.
+*/
+static char pg11[256]=
+{
+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,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,0,0,0,0,0,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,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 char pg23[256]=
+{
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,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 char pg2E[256]=
+{
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0
+};
+
+static char pg2F[256]=
+{
+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,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,
+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,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,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,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,0,0,0,0
+};
+
+static char pg30[256]=
+{
+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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,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,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,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,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,1,1,1,1,1,1,1
+};
+
+static char pg31[256]=
+{
+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,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,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,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,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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
+};
+
+static char pg32[256]=
+{
+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,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,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,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,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,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,0
+};
+
+static char pg4D[256]=
+{
+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,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,
+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,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,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,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 char pg9F[256]=
+{
+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,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,
+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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,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 char pgA4[256]=
+{
+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,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,
+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,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,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,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 char pgD7[256]=
+{
+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,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,
+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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,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 char pgFA[256]=
+{
+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,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,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,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 char pgFE[256]=
+{
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,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 char pgFF[256]=
+{
+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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,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,0,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 struct {int page; char *p;} utr11_data[256]=
+{
+{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},
+{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},
+{0,NULL},{0,pg11},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},
+{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},
+{0,NULL},{0,NULL},{0,NULL},{0,pg23},{0,NULL},{0,NULL},{0,NULL},{0,NULL},
+{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,pg2E},{0,pg2F},
+{0,pg30},{0,pg31},{0,pg32},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{0,pg4D},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{0,pg9F},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{0,pgA4},{0,NULL},{0,NULL},{0,NULL},
+{0,NULL},{0,NULL},{0,NULL},{0,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},
+{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{1,NULL},{0,pgD7},
+{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},
+{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},
+{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},
+{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},{0,NULL},
+{0,NULL},{1,NULL},{0,pgFA},{0,NULL},{0,NULL},{0,NULL},{0,pgFE},{0,pgFF}
+};
+
+uint my_numcells_mb(CHARSET_INFO *cs, const char *b, const char *e)
+{
+  my_wc_t wc;
+  int clen= 0;
+  
+  while (b < e)
+  {
+    int mblen;
+    uint pg;
+    if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <= 0)
+    {
+      mblen= 1; /* Let's think a wrong sequence takes 1 dysplay cell */
+      b++;
+      continue;
+    }
+    b+= mblen;
+    pg= (wc >> 8) & 0xFF;
+    clen+= utr11_data[pg].p ? utr11_data[pg].p[wc & 0xFF] : utr11_data[pg].page;
+    clen++;
+  }
+  return clen;
+}
+
+
+int my_mb_ctype_mb(CHARSET_INFO *cs, int *ctype,
+                   const unsigned char *s, const unsigned char *e)
+{
+  my_wc_t wc;
+  int res= cs->cset->mb_wc(cs, &wc, s, e);
+  if (res <= 0)
+    *ctype= 0;
+  else
+    *ctype= my_uni_ctype[wc>>8].ctype ?
+            my_uni_ctype[wc>>8].ctype[wc&0xFF] :
+            my_uni_ctype[wc>>8].pctype;    
+  return res;
+}
+#endif
+
+
+namespace stardict_collation {
+
+MY_COLLATION_HANDLER my_collation_mb_bin_handler =
+{
+    NULL,              /* init */
+    my_strnncoll_mb_bin,
+    //my_strnncollsp_mb_bin,
+    //my_strnxfrm_mb_bin,
+    //my_strnxfrmlen_simple,
+    //my_like_range_simple,
+    //my_wildcmp_mb_bin,
+    //my_strcasecmp_mb_bin,
+    //my_instr_mb,
+    //my_hash_sort_mb_bin,
+    //my_propagate_simple
+};
+
+}; //namespace
+
diff --git a/src/lib/ctype-uca.cpp b/src/lib/ctype-uca.cpp
new file mode 100644 (file)
index 0000000..9c38d02
--- /dev/null
@@ -0,0 +1,9350 @@
+/* Copyright (C) 2004 MySQL AB
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+   
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+   
+   You should have received a copy of the GNU Library General Public
+   License along with this library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+   MA 02111-1307, USA */
+
+/* 
+   UCA (Unicode Collation Algorithm) support. 
+   Written by Alexander Barkov <bar@mysql.com>
+   
+   Currently supports only subset of the full UCA:
+   - Only Primary level key comparison
+   - Basic Latin letters contraction is implemented
+   - Variable weighting is done for Non-ignorable option
+   
+   Features that are not implemented yet:
+   - No Normalization From D is done
+     + No decomposition is done
+     + No Thai/Lao orderding is done
+   - No combining marks processing is done
+*/
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "my_global.h"
+#include "m_string.h"
+#include "m_ctype.h"
+
+using namespace stardict_collation;
+
+#define HAVE_UCA_COLLATIONS
+#define HAVE_CHARSET_utf8
+
+#ifdef HAVE_UCA_COLLATIONS
+
+#define MY_UCA_NPAGES 256
+#define MY_UCA_NCHARS 256
+#define MY_UCA_CMASK  255
+#define MY_UCA_PSHIFT 8
+
+static uint16 page000data[]= { /* 0000 (4 weights per char) */
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0201,0x0000,0x0000,0x0000,
+0x0202,0x0000,0x0000,0x0000, 0x0203,0x0000,0x0000,0x0000,
+0x0204,0x0000,0x0000,0x0000, 0x0205,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000, 0x0251,0x0000,0x0000,0x0000,
+0x027E,0x0000,0x0000,0x0000, 0x02D2,0x0000,0x0000,0x0000,
+0x0E0F,0x0000,0x0000,0x0000, 0x02D3,0x0000,0x0000,0x0000,
+0x02CF,0x0000,0x0000,0x0000, 0x0277,0x0000,0x0000,0x0000,
+0x0288,0x0000,0x0000,0x0000, 0x0289,0x0000,0x0000,0x0000,
+0x02C8,0x0000,0x0000,0x0000, 0x0428,0x0000,0x0000,0x0000,
+0x022F,0x0000,0x0000,0x0000, 0x0221,0x0000,0x0000,0x0000,
+0x025D,0x0000,0x0000,0x0000, 0x02CC,0x0000,0x0000,0x0000,
+0x0E29,0x0000,0x0000,0x0000, 0x0E2A,0x0000,0x0000,0x0000,
+0x0E2B,0x0000,0x0000,0x0000, 0x0E2C,0x0000,0x0000,0x0000,
+0x0E2D,0x0000,0x0000,0x0000, 0x0E2E,0x0000,0x0000,0x0000,
+0x0E2F,0x0000,0x0000,0x0000, 0x0E30,0x0000,0x0000,0x0000,
+0x0E31,0x0000,0x0000,0x0000, 0x0E32,0x0000,0x0000,0x0000,
+0x023D,0x0000,0x0000,0x0000, 0x023A,0x0000,0x0000,0x0000,
+0x042C,0x0000,0x0000,0x0000, 0x042D,0x0000,0x0000,0x0000,
+0x042E,0x0000,0x0000,0x0000, 0x0255,0x0000,0x0000,0x0000,
+0x02C7,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E4A,0x0000,0x0000,0x0000, 0x0E60,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000,
+0x0EB9,0x0000,0x0000,0x0000, 0x0EC1,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0F10,0x0000,0x0000,0x0000, 0x0F21,0x0000,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000, 0x0F5B,0x0000,0x0000,0x0000,
+0x0F64,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000,
+0x0FA7,0x0000,0x0000,0x0000, 0x0FB4,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000, 0x0FEA,0x0000,0x0000,0x0000,
+0x1002,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000, 0x1051,0x0000,0x0000,0x0000,
+0x105A,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000,
+0x106A,0x0000,0x0000,0x0000, 0x028A,0x0000,0x0000,0x0000,
+0x02CE,0x0000,0x0000,0x0000, 0x028B,0x0000,0x0000,0x0000,
+0x020F,0x0000,0x0000,0x0000, 0x021B,0x0000,0x0000,0x0000,
+0x020C,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E4A,0x0000,0x0000,0x0000, 0x0E60,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000,
+0x0EB9,0x0000,0x0000,0x0000, 0x0EC1,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0F10,0x0000,0x0000,0x0000, 0x0F21,0x0000,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000, 0x0F5B,0x0000,0x0000,0x0000,
+0x0F64,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000,
+0x0FA7,0x0000,0x0000,0x0000, 0x0FB4,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000, 0x0FEA,0x0000,0x0000,0x0000,
+0x1002,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000, 0x1051,0x0000,0x0000,0x0000,
+0x105A,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000,
+0x106A,0x0000,0x0000,0x0000, 0x028C,0x0000,0x0000,0x0000,
+0x0430,0x0000,0x0000,0x0000, 0x028D,0x0000,0x0000,0x0000,
+0x0433,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0206,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000, 0x0252,0x0000,0x0000,0x0000,
+0x0E0E,0x0000,0x0000,0x0000, 0x0E10,0x0000,0x0000,0x0000,
+0x0E0D,0x0000,0x0000,0x0000, 0x0E11,0x0000,0x0000,0x0000,
+0x0431,0x0000,0x0000,0x0000, 0x02C2,0x0000,0x0000,0x0000,
+0x0214,0x0000,0x0000,0x0000, 0x02C5,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0286,0x0000,0x0000,0x0000,
+0x042F,0x0000,0x0000,0x0000, 0x0220,0x0000,0x0000,0x0000,
+0x02C6,0x0000,0x0000,0x0000, 0x0210,0x0000,0x0000,0x0000,
+0x034A,0x0000,0x0000,0x0000, 0x0429,0x0000,0x0000,0x0000,
+0x0E2B,0x0000,0x0000,0x0000, 0x0E2C,0x0000,0x0000,0x0000,
+0x020D,0x0000,0x0000,0x0000, 0x10F8,0x0000,0x0000,0x0000,
+0x02C3,0x0000,0x0000,0x0000, 0x0267,0x0000,0x0000,0x0000,
+0x0219,0x0000,0x0000,0x0000, 0x0E2A,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x0287,0x0000,0x0000,0x0000,
+0x0E2A,0x02CD,0x0E2D,0x0000, 0x0E2A,0x02CD,0x0E2B,0x0000,
+0x0E2C,0x02CD,0x0E2D,0x0000, 0x0256,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E38,0x0000,0x0000,0x0000, 0x0E60,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0E86,0x0000,0x0000,0x0000, 0x0F64,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x042B,0x0000,0x0000,0x0000,
+0x0F8D,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x101F,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x101F,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000,
+0x1094,0x0000,0x0000,0x0000, 0x0FEA,0x0FEA,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E38,0x0000,0x0000,0x0000, 0x0E60,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0E86,0x0000,0x0000,0x0000, 0x0F64,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x042A,0x0000,0x0000,0x0000,
+0x0F8D,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x101F,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x101F,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000,
+0x1094,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000
+};
+
+static uint16 page001data[]= { /* 0100 (3 weights per char) */
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000,
+0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000,
+0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E6D,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E72,0x0000,0x0000, 0x0E72,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EED,0x0000,0x0000,
+0x0EED,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFF,0x0000,0x0000, 0x0EFB,0x0F10,0x0000,
+0x0EFB,0x0F10,0x0000, 0x0F10,0x0000,0x0000, 0x0F10,0x0000,0x0000,
+0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0FBC,0x0000,0x0000,
+0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000,
+0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000,
+0x0F2E,0x0267,0x0000, 0x0F2E,0x0267,0x0000, 0x0F36,0x0000,0x0000,
+0x0F36,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x10B1,0x0F64,0x0000, 0x0F7E,0x0000,0x0000,
+0x0F7E,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0E8B,0x0000, 0x0F82,0x0E8B,0x0000,
+0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x1002,0x0000,0x0000,
+0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000,
+0x1007,0x0000,0x0000, 0x1007,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x1051,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000,
+0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000,
+0x106A,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0E52,0x0000,0x0000,
+0x0E58,0x0000,0x0000, 0x0E5C,0x0000,0x0000, 0x0E5C,0x0000,0x0000,
+0x10A8,0x0000,0x0000, 0x10A8,0x0000,0x0000, 0x0F92,0x0000,0x0000,
+0x0E65,0x0000,0x0000, 0x0E65,0x0000,0x0000, 0x0E76,0x0000,0x0000,
+0x0E7A,0x0000,0x0000, 0x0E7E,0x0000,0x0000, 0x0E7E,0x0000,0x0000,
+0x106A,0x1051,0x0000, 0x0E90,0x0000,0x0000, 0x0E94,0x0000,0x0000,
+0x0E98,0x0000,0x0000, 0x0EBD,0x0000,0x0000, 0x0EBD,0x0000,0x0000,
+0x0ED1,0x0000,0x0000, 0x0ED9,0x0000,0x0000, 0x0EE9,0x0000,0x0000,
+0x0F0C,0x0000,0x0000, 0x0F08,0x0000,0x0000, 0x0F26,0x0000,0x0000,
+0x0F26,0x0000,0x0000, 0x0F3B,0x0000,0x0000, 0x0F53,0x0000,0x0000,
+0x1037,0x0000,0x0000, 0x0F6E,0x0000,0x0000, 0x0F72,0x0000,0x0000,
+0x0F9A,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0EDD,0x0000,0x0000, 0x0EDD,0x0000,0x0000, 0x0FAC,0x0000,0x0000,
+0x0FAC,0x0000,0x0000, 0x0FC4,0x0000,0x0000, 0x10A0,0x0000,0x0000,
+0x10A0,0x0000,0x0000, 0x0FF2,0x0000,0x0000, 0x0FF6,0x0000,0x0000,
+0x100B,0x0000,0x0000, 0x100F,0x0000,0x0000, 0x100F,0x0000,0x0000,
+0x1013,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x1040,0x0000,0x0000, 0x1049,0x0000,0x0000, 0x1066,0x0000,0x0000,
+0x1066,0x0000,0x0000, 0x106F,0x0000,0x0000, 0x106F,0x0000,0x0000,
+0x107F,0x0000,0x0000, 0x1084,0x0000,0x0000, 0x1084,0x0000,0x0000,
+0x1088,0x0000,0x0000, 0x109C,0x0000,0x0000, 0x10A4,0x0000,0x0000,
+0x10A4,0x0000,0x0000, 0x1002,0x0FEA,0x0000, 0x1098,0x0000,0x0000,
+0x10C8,0x0000,0x0000, 0x10CC,0x0000,0x0000, 0x10D0,0x0000,0x0000,
+0x10D4,0x0000,0x0000, 0x0E6D,0x106A,0x0000, 0x0E6D,0x106A,0x0000,
+0x0E6D,0x106A,0x0000, 0x0F2E,0x0F10,0x0000, 0x0F2E,0x0F10,0x0000,
+0x0F2E,0x0F10,0x0000, 0x0F64,0x0F10,0x0000, 0x0F64,0x0F10,0x0000,
+0x0F64,0x0F10,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x0E90,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E38,0x0000,0x0000, 0x0E38,0x0000,0x0000,
+0x0ECD,0x0000,0x0000, 0x0ECD,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EC1,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x107F,0x0000,0x0000, 0x107F,0x0000,0x0000,
+0x0F10,0x0000,0x0000, 0x0E6D,0x106A,0x0000, 0x0E6D,0x106A,0x0000,
+0x0E6D,0x106A,0x0000, 0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EE9,0x0000,0x0000, 0x1098,0x0000,0x0000, 0x0F64,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E38,0x0000,0x0000, 0x0E38,0x0000,0x0000, 0x0F8D,0x0000,0x0000,
+0x0F8D,0x0000,0x0000 };
+
+static uint16 page002data[]= { /* 0200 (3 weights per char) */
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x1002,0x0000,0x0000,
+0x1002,0x0000,0x0000, 0x1090,0x0000,0x0000, 0x1090,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0F72,0x0000,0x0000,
+0x0E82,0x0000,0x0000, 0x0FA2,0x0000,0x0000, 0x0FA2,0x0000,0x0000,
+0x1073,0x0000,0x0000, 0x1073,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0x0F4B,0x0000,0x0000, 0x0F7A,0x0000,0x0000,
+0x1017,0x0000,0x0000, 0xFBC0,0x8237,0x0000, 0xFBC0,0x8238,0x0000,
+0xFBC0,0x8239,0x0000, 0xFBC0,0x823A,0x0000, 0xFBC0,0x823B,0x0000,
+0xFBC0,0x823C,0x0000, 0xFBC0,0x823D,0x0000, 0xFBC0,0x823E,0x0000,
+0xFBC0,0x823F,0x0000, 0xFBC0,0x8240,0x0000, 0xFBC0,0x8241,0x0000,
+0xFBC0,0x8242,0x0000, 0xFBC0,0x8243,0x0000, 0xFBC0,0x8244,0x0000,
+0xFBC0,0x8245,0x0000, 0xFBC0,0x8246,0x0000, 0xFBC0,0x8247,0x0000,
+0xFBC0,0x8248,0x0000, 0xFBC0,0x8249,0x0000, 0xFBC0,0x824A,0x0000,
+0xFBC0,0x824B,0x0000, 0xFBC0,0x824C,0x0000, 0xFBC0,0x824D,0x0000,
+0xFBC0,0x824E,0x0000, 0xFBC0,0x824F,0x0000, 0x0E3E,0x0000,0x0000,
+0x0E42,0x0000,0x0000, 0x0E46,0x0000,0x0000, 0x0E58,0x0000,0x0000,
+0x0F92,0x0000,0x0000, 0x0E69,0x0000,0x0000, 0x0E76,0x0000,0x0000,
+0x0E7A,0x0000,0x0000, 0x0E9C,0x0000,0x0000, 0x0E94,0x0000,0x0000,
+0x0EA0,0x0000,0x0000, 0x0E98,0x0000,0x0000, 0x0EA4,0x0000,0x0000,
+0x0EA9,0x0000,0x0000, 0x0EAD,0x0000,0x0000, 0x0F19,0x0000,0x0000,
+0x0ED1,0x0000,0x0000, 0x0EC5,0x0000,0x0000, 0x0EC9,0x0000,0x0000,
+0x0ED9,0x0000,0x0000, 0x0EB5,0x0000,0x0000, 0x102B,0x0000,0x0000,
+0x0EF1,0x0000,0x0000, 0x0EF5,0x0000,0x0000, 0x0F08,0x0000,0x0000,
+0x0F0C,0x0000,0x0000, 0x0F03,0x0000,0x0000, 0x0F3F,0x0000,0x0000,
+0x0F43,0x0000,0x0000, 0x0F47,0x0000,0x0000, 0x0F4F,0x0000,0x0000,
+0x1037,0x0000,0x0000, 0x103C,0x0000,0x0000, 0x0F60,0x0000,0x0000,
+0x0F6E,0x0000,0x0000, 0x0F76,0x0000,0x0000, 0x0F68,0x0000,0x0000,
+0x0F9A,0x0000,0x0000, 0x0F88,0x0000,0x0000, 0x0F9E,0x0000,0x0000,
+0x0FB0,0x0000,0x0000, 0x0FC9,0x0000,0x0000, 0x0FCE,0x0000,0x0000,
+0x0FD2,0x0000,0x0000, 0x0FD6,0x0000,0x0000, 0x0FDA,0x0000,0x0000,
+0x0FDE,0x0000,0x0000, 0x0FE2,0x0000,0x0000, 0x0FC4,0x0000,0x0000,
+0x0FE6,0x0000,0x0000, 0x0FEE,0x0000,0x0000, 0x0FF2,0x0000,0x0000,
+0x0F1D,0x0000,0x0000, 0x0FFA,0x0000,0x0000, 0x0FFE,0x0000,0x0000,
+0x101B,0x0000,0x0000, 0x1013,0x0000,0x0000, 0x1027,0x0000,0x0000,
+0x1040,0x0000,0x0000, 0x1049,0x0000,0x0000, 0x104D,0x0000,0x0000,
+0x1056,0x0000,0x0000, 0x0F57,0x0000,0x0000, 0x1062,0x0000,0x0000,
+0x1077,0x0000,0x0000, 0x107B,0x0000,0x0000, 0x107F,0x0000,0x0000,
+0x108C,0x0000,0x0000, 0x10AC,0x0000,0x0000, 0x10B4,0x0000,0x0000,
+0x10C4,0x0000,0x0000, 0x10D8,0x0000,0x0000, 0x10DC,0x0000,0x0000,
+0x0E4E,0x0000,0x0000, 0x0EB1,0x0000,0x0000, 0x0ED5,0x0000,0x0000,
+0x0EE5,0x0000,0x0000, 0x0F15,0x0000,0x0000, 0x0F2A,0x0000,0x0000,
+0x0F32,0x0000,0x0000, 0x0FB8,0x0000,0x0000, 0x10BC,0x0000,0x0000,
+0x10C0,0x0000,0x0000, 0x0E6D,0x106A,0x0000, 0x0E6D,0x107F,0x0000,
+0x0E6D,0x107B,0x0000, 0x1002,0x0FEA,0x0000, 0x1002,0x0FF2,0x0000,
+0x1002,0x0E69,0x0000, 0x0EB9,0x0F7E,0x0000, 0x0F2E,0x0FEA,0x0000,
+0x0F2E,0x106A,0x0000, 0x10E0,0x0000,0x0000, 0x10E4,0x0000,0x0000,
+0x102F,0x0000,0x0000, 0x1033,0x0000,0x0000, 0x0EE1,0x0000,0x0000,
+0x0EF1,0x0000,0x0000, 0x0F10,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FC9,0x0000,0x0000, 0x0FD2,0x0000,0x0000, 0x0FE6,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x0317,0x0000,0x0000,
+0x0319,0x0000,0x0000, 0x0EF9,0x0000,0x0000, 0x10B1,0x0000,0x0000,
+0x0EFA,0x0000,0x0000, 0x10B3,0x0000,0x0000, 0x10B8,0x0000,0x0000,
+0x10B0,0x0000,0x0000, 0x10B9,0x0000,0x0000, 0x031A,0x0000,0x0000,
+0x031B,0x0000,0x0000, 0x031C,0x0000,0x0000, 0x031D,0x0000,0x0000,
+0x031E,0x0000,0x0000, 0x031F,0x0000,0x0000, 0x0320,0x0000,0x0000,
+0x0321,0x0000,0x0000, 0x0322,0x0000,0x0000, 0x0323,0x0000,0x0000,
+0x0324,0x0000,0x0000, 0x0325,0x0000,0x0000, 0x0326,0x0000,0x0000,
+0x0327,0x0000,0x0000, 0x0E01,0x0000,0x0000, 0x0E02,0x0000,0x0000,
+0x0328,0x0000,0x0000, 0x0329,0x0000,0x0000, 0x032A,0x0000,0x0000,
+0x032B,0x0000,0x0000, 0x032C,0x0000,0x0000, 0x032D,0x0000,0x0000,
+0x0212,0x0000,0x0000, 0x0213,0x0000,0x0000, 0x0215,0x0000,0x0000,
+0x021A,0x0000,0x0000, 0x020E,0x0000,0x0000, 0x0216,0x0000,0x0000,
+0x032E,0x0000,0x0000, 0x032F,0x0000,0x0000, 0x0ED9,0x0000,0x0000,
+0x0F2E,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x105A,0x0000,0x0000,
+0x10B4,0x0000,0x0000, 0x0330,0x0000,0x0000, 0x0331,0x0000,0x0000,
+0x0332,0x0000,0x0000, 0x0333,0x0000,0x0000, 0x0334,0x0000,0x0000,
+0x0335,0x0000,0x0000, 0x0336,0x0000,0x0000, 0x0337,0x0000,0x0000,
+0x0338,0x0000,0x0000, 0x10B2,0x0000,0x0000, 0x0339,0x0000,0x0000,
+0x033A,0x0000,0x0000, 0x033B,0x0000,0x0000, 0x033C,0x0000,0x0000,
+0x033D,0x0000,0x0000, 0x033E,0x0000,0x0000, 0x033F,0x0000,0x0000,
+0x0340,0x0000,0x0000, 0x0341,0x0000,0x0000, 0x0342,0x0000,0x0000,
+0x0343,0x0000,0x0000, 0x0344,0x0000,0x0000, 0x0345,0x0000,0x0000,
+0x0346,0x0000,0x0000, 0x0347,0x0000,0x0000, 0x0348,0x0000,0x0000,
+0x0349,0x0000,0x0000 };
+
+static uint16 page003data[]= { /* 0300 (4 weights per char) */
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0x8358,0x0000,0x0000, 0xFBC0,0x8359,0x0000,0x0000,
+0xFBC0,0x835A,0x0000,0x0000, 0xFBC0,0x835B,0x0000,0x0000,
+0xFBC0,0x835C,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000, 0x0E6D,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000, 0x0F5B,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000, 0x1002,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000, 0x105A,0x0000,0x0000,0x0000,
+0xFBC0,0x8370,0x0000,0x0000, 0xFBC0,0x8371,0x0000,0x0000,
+0xFBC0,0x8372,0x0000,0x0000, 0xFBC0,0x8373,0x0000,0x0000,
+0x0317,0x0000,0x0000,0x0000, 0x0318,0x0000,0x0000,0x0000,
+0xFBC0,0x8376,0x0000,0x0000, 0xFBC0,0x8377,0x0000,0x0000,
+0xFBC0,0x8378,0x0000,0x0000, 0xFBC0,0x8379,0x0000,0x0000,
+0x10F3,0x0000,0x0000,0x0000, 0xFBC0,0x837B,0x0000,0x0000,
+0xFBC0,0x837C,0x0000,0x0000, 0xFBC0,0x837D,0x0000,0x0000,
+0x023A,0x0000,0x0000,0x0000, 0xFBC0,0x837F,0x0000,0x0000,
+0xFBC0,0x8380,0x0000,0x0000, 0xFBC0,0x8381,0x0000,0x0000,
+0xFBC0,0x8382,0x0000,0x0000, 0xFBC0,0x8383,0x0000,0x0000,
+0x020D,0x0000,0x0000,0x0000, 0x0214,0x0000,0x0000,0x0000,
+0x10E8,0x0000,0x0000,0x0000, 0x0267,0x0000,0x0000,0x0000,
+0x10ED,0x0000,0x0000,0x0000, 0x10F1,0x0000,0x0000,0x0000,
+0x10F3,0x0000,0x0000,0x0000, 0xFBC0,0x838B,0x0000,0x0000,
+0x10FB,0x0000,0x0000,0x0000, 0xFBC0,0x838D,0x0000,0x0000,
+0x1104,0x0000,0x0000,0x0000, 0x1109,0x0000,0x0000,0x0000,
+0x10F3,0x0000,0x0000,0x0000, 0x10E8,0x0000,0x0000,0x0000,
+0x10E9,0x0000,0x0000,0x0000, 0x10EA,0x0000,0x0000,0x0000,
+0x10EC,0x0000,0x0000,0x0000, 0x10ED,0x0000,0x0000,0x0000,
+0x10F0,0x0000,0x0000,0x0000, 0x10F1,0x0000,0x0000,0x0000,
+0x10F2,0x0000,0x0000,0x0000, 0x10F3,0x0000,0x0000,0x0000,
+0x10F5,0x0000,0x0000,0x0000, 0x10F6,0x0000,0x0000,0x0000,
+0x10F8,0x0000,0x0000,0x0000, 0x10F9,0x0000,0x0000,0x0000,
+0x10FA,0x0000,0x0000,0x0000, 0x10FB,0x0000,0x0000,0x0000,
+0x10FC,0x0000,0x0000,0x0000, 0x1100,0x0000,0x0000,0x0000,
+0xFBC0,0x83A2,0x0000,0x0000, 0x1102,0x0000,0x0000,0x0000,
+0x1103,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000,
+0x1105,0x0000,0x0000,0x0000, 0x1106,0x0000,0x0000,0x0000,
+0x1107,0x0000,0x0000,0x0000, 0x1109,0x0000,0x0000,0x0000,
+0x10F3,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000,
+0x10E8,0x0000,0x0000,0x0000, 0x10ED,0x0000,0x0000,0x0000,
+0x10F1,0x0000,0x0000,0x0000, 0x10F3,0x0000,0x0000,0x0000,
+0x1104,0x0000,0x0000,0x0000, 0x10E8,0x0000,0x0000,0x0000,
+0x10E9,0x0000,0x0000,0x0000, 0x10EA,0x0000,0x0000,0x0000,
+0x10EC,0x0000,0x0000,0x0000, 0x10ED,0x0000,0x0000,0x0000,
+0x10F0,0x0000,0x0000,0x0000, 0x10F1,0x0000,0x0000,0x0000,
+0x10F2,0x0000,0x0000,0x0000, 0x10F3,0x0000,0x0000,0x0000,
+0x10F5,0x0000,0x0000,0x0000, 0x10F6,0x0000,0x0000,0x0000,
+0x10F8,0x0000,0x0000,0x0000, 0x10F9,0x0000,0x0000,0x0000,
+0x10FA,0x0000,0x0000,0x0000, 0x10FB,0x0000,0x0000,0x0000,
+0x10FC,0x0000,0x0000,0x0000, 0x1100,0x0000,0x0000,0x0000,
+0x1102,0x0000,0x0000,0x0000, 0x1102,0x0000,0x0000,0x0000,
+0x1103,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000,
+0x1105,0x0000,0x0000,0x0000, 0x1106,0x0000,0x0000,0x0000,
+0x1107,0x0000,0x0000,0x0000, 0x1109,0x0000,0x0000,0x0000,
+0x10F3,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000,
+0x10FB,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000,
+0x1109,0x0000,0x0000,0x0000, 0xFBC0,0x83CF,0x0000,0x0000,
+0x10E9,0x0000,0x0000,0x0000, 0x10F2,0x0000,0x0000,0x0000,
+0x1104,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000,
+0x1104,0x0000,0x0000,0x0000, 0x1105,0x0000,0x0000,0x0000,
+0x10FC,0x0000,0x0000,0x0000, 0x10F5,0x10E8,0x10F3,0x0000,
+0x10FF,0x0000,0x0000,0x0000, 0x10FF,0x0000,0x0000,0x0000,
+0x10EF,0x0000,0x0000,0x0000, 0x10EF,0x0000,0x0000,0x0000,
+0x10EE,0x0000,0x0000,0x0000, 0x10EE,0x0000,0x0000,0x0000,
+0x10FE,0x0000,0x0000,0x0000, 0x10FE,0x0000,0x0000,0x0000,
+0x110A,0x0000,0x0000,0x0000, 0x110A,0x0000,0x0000,0x0000,
+0x110D,0x0000,0x0000,0x0000, 0x110D,0x0000,0x0000,0x0000,
+0x110E,0x0000,0x0000,0x0000, 0x110E,0x0000,0x0000,0x0000,
+0x110F,0x0000,0x0000,0x0000, 0x110F,0x0000,0x0000,0x0000,
+0x1110,0x0000,0x0000,0x0000, 0x1110,0x0000,0x0000,0x0000,
+0x1111,0x0000,0x0000,0x0000, 0x1111,0x0000,0x0000,0x0000,
+0x1112,0x0000,0x0000,0x0000, 0x1112,0x0000,0x0000,0x0000,
+0x1113,0x0000,0x0000,0x0000, 0x1113,0x0000,0x0000,0x0000,
+0x10F5,0x0000,0x0000,0x0000, 0x1100,0x0000,0x0000,0x0000,
+0x1102,0x0000,0x0000,0x0000, 0x10F4,0x0000,0x0000,0x0000,
+0x10F2,0x0000,0x0000,0x0000, 0x10ED,0x0000,0x0000,0x0000,
+0x0423,0x0000,0x0000,0x0000, 0x110B,0x0000,0x0000,0x0000,
+0x110B,0x0000,0x0000,0x0000, 0x1102,0x0000,0x0000,0x0000,
+0x110C,0x0000,0x0000,0x0000, 0x110C,0x0000,0x0000,0x0000,
+0xFBC0,0x83FC,0x0000,0x0000, 0xFBC0,0x83FD,0x0000,0x0000,
+0xFBC0,0x83FE,0x0000,0x0000, 0xFBC0,0x83FF,0x0000,0x0000
+};
+
+static uint16 page004data[]= { /* 0400 (3 weights per char) */
+0x1152,0x0000,0x0000, 0x1152,0x0000,0x0000, 0x1145,0x0000,0x0000,
+0x114A,0x0000,0x0000, 0x115A,0x0000,0x0000, 0x1173,0x0000,0x0000,
+0x1188,0x0000,0x0000, 0x118C,0x0000,0x0000, 0x1194,0x0000,0x0000,
+0x11B9,0x0000,0x0000, 0x11DA,0x0000,0x0000, 0x1215,0x0000,0x0000,
+0x1219,0x0000,0x0000, 0x117C,0x0000,0x0000, 0x1221,0x0000,0x0000,
+0x127D,0x0000,0x0000, 0x1114,0x0000,0x0000, 0x112C,0x0000,0x0000,
+0x1130,0x0000,0x0000, 0x1134,0x0000,0x0000, 0x1140,0x0000,0x0000,
+0x1152,0x0000,0x0000, 0x115E,0x0000,0x0000, 0x116A,0x0000,0x0000,
+0x117C,0x0000,0x0000, 0x1190,0x0000,0x0000, 0x1198,0x0000,0x0000,
+0x11B0,0x0000,0x0000, 0x11BE,0x0000,0x0000, 0x11C6,0x0000,0x0000,
+0x11DF,0x0000,0x0000, 0x11EF,0x0000,0x0000, 0x11FB,0x0000,0x0000,
+0x1203,0x0000,0x0000, 0x120C,0x0000,0x0000, 0x121D,0x0000,0x0000,
+0x1239,0x0000,0x0000, 0x123D,0x0000,0x0000, 0x1259,0x0000,0x0000,
+0x1261,0x0000,0x0000, 0x1281,0x0000,0x0000, 0x1285,0x0000,0x0000,
+0x1289,0x0000,0x0000, 0x128D,0x0000,0x0000, 0x1295,0x0000,0x0000,
+0x12A1,0x0000,0x0000, 0x12A9,0x0000,0x0000, 0x12AD,0x0000,0x0000,
+0x1114,0x0000,0x0000, 0x112C,0x0000,0x0000, 0x1130,0x0000,0x0000,
+0x1134,0x0000,0x0000, 0x1140,0x0000,0x0000, 0x1152,0x0000,0x0000,
+0x115E,0x0000,0x0000, 0x116A,0x0000,0x0000, 0x117C,0x0000,0x0000,
+0x1190,0x0000,0x0000, 0x1198,0x0000,0x0000, 0x11B0,0x0000,0x0000,
+0x11BE,0x0000,0x0000, 0x11C6,0x0000,0x0000, 0x11DF,0x0000,0x0000,
+0x11EF,0x0000,0x0000, 0x11FB,0x0000,0x0000, 0x1203,0x0000,0x0000,
+0x120C,0x0000,0x0000, 0x121D,0x0000,0x0000, 0x1239,0x0000,0x0000,
+0x123D,0x0000,0x0000, 0x1259,0x0000,0x0000, 0x1261,0x0000,0x0000,
+0x1281,0x0000,0x0000, 0x1285,0x0000,0x0000, 0x1289,0x0000,0x0000,
+0x128D,0x0000,0x0000, 0x1295,0x0000,0x0000, 0x12A1,0x0000,0x0000,
+0x12A9,0x0000,0x0000, 0x12AD,0x0000,0x0000, 0x1152,0x0000,0x0000,
+0x1152,0x0000,0x0000, 0x1145,0x0000,0x0000, 0x114A,0x0000,0x0000,
+0x115A,0x0000,0x0000, 0x1173,0x0000,0x0000, 0x1188,0x0000,0x0000,
+0x118C,0x0000,0x0000, 0x1194,0x0000,0x0000, 0x11B9,0x0000,0x0000,
+0x11DA,0x0000,0x0000, 0x1215,0x0000,0x0000, 0x1219,0x0000,0x0000,
+0x117C,0x0000,0x0000, 0x1221,0x0000,0x0000, 0x127D,0x0000,0x0000,
+0x1249,0x0000,0x0000, 0x1249,0x0000,0x0000, 0x129D,0x0000,0x0000,
+0x129D,0x0000,0x0000, 0x12B1,0x0000,0x0000, 0x12B1,0x0000,0x0000,
+0x12B5,0x0000,0x0000, 0x12B5,0x0000,0x0000, 0x12BD,0x0000,0x0000,
+0x12BD,0x0000,0x0000, 0x12B9,0x0000,0x0000, 0x12B9,0x0000,0x0000,
+0x12C1,0x0000,0x0000, 0x12C1,0x0000,0x0000, 0x12C5,0x0000,0x0000,
+0x12C5,0x0000,0x0000, 0x12C9,0x0000,0x0000, 0x12C9,0x0000,0x0000,
+0x12CD,0x0000,0x0000, 0x12CD,0x0000,0x0000, 0x12D1,0x0000,0x0000,
+0x12D1,0x0000,0x0000, 0x12D5,0x0000,0x0000, 0x12D5,0x0000,0x0000,
+0x1235,0x0000,0x0000, 0x1235,0x0000,0x0000, 0x1255,0x0000,0x0000,
+0x1255,0x0000,0x0000, 0x1251,0x0000,0x0000, 0x1251,0x0000,0x0000,
+0x124D,0x0000,0x0000, 0x124D,0x0000,0x0000, 0x11F7,0x0000,0x0000,
+0x11F7,0x0000,0x0000, 0x034B,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x8487,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x1180,0x0000,0x0000, 0x1180,0x0000,0x0000, 0x1299,0x0000,0x0000,
+0x1299,0x0000,0x0000, 0x11FF,0x0000,0x0000, 0x11FF,0x0000,0x0000,
+0x1134,0x0000,0x0000, 0x1134,0x0000,0x0000, 0x1138,0x0000,0x0000,
+0x1138,0x0000,0x0000, 0x113C,0x0000,0x0000, 0x113C,0x0000,0x0000,
+0x1166,0x0000,0x0000, 0x1166,0x0000,0x0000, 0x114E,0x0000,0x0000,
+0x114E,0x0000,0x0000, 0x119C,0x0000,0x0000, 0x119C,0x0000,0x0000,
+0x11AC,0x0000,0x0000, 0x11AC,0x0000,0x0000, 0x11A8,0x0000,0x0000,
+0x11A8,0x0000,0x0000, 0x11A4,0x0000,0x0000, 0x11A4,0x0000,0x0000,
+0x11CE,0x0000,0x0000, 0x11CE,0x0000,0x0000, 0x11D6,0x0000,0x0000,
+0x11D6,0x0000,0x0000, 0x11F3,0x0000,0x0000, 0x11F3,0x0000,0x0000,
+0x12D9,0x0000,0x0000, 0x12D9,0x0000,0x0000, 0x1208,0x0000,0x0000,
+0x1208,0x0000,0x0000, 0x1211,0x0000,0x0000, 0x1211,0x0000,0x0000,
+0x122D,0x0000,0x0000, 0x122D,0x0000,0x0000, 0x1231,0x0000,0x0000,
+0x1231,0x0000,0x0000, 0x1241,0x0000,0x0000, 0x1241,0x0000,0x0000,
+0x125D,0x0000,0x0000, 0x125D,0x0000,0x0000, 0x1269,0x0000,0x0000,
+0x1269,0x0000,0x0000, 0x1271,0x0000,0x0000, 0x1271,0x0000,0x0000,
+0x1245,0x0000,0x0000, 0x1245,0x0000,0x0000, 0x1275,0x0000,0x0000,
+0x1275,0x0000,0x0000, 0x1279,0x0000,0x0000, 0x1279,0x0000,0x0000,
+0x12DD,0x0000,0x0000, 0x115E,0x0000,0x0000, 0x115E,0x0000,0x0000,
+0x11A0,0x0000,0x0000, 0x11A0,0x0000,0x0000, 0x11B5,0x0000,0x0000,
+0x11B5,0x0000,0x0000, 0x11D2,0x0000,0x0000, 0x11D2,0x0000,0x0000,
+0x11CA,0x0000,0x0000, 0x11CA,0x0000,0x0000, 0x126D,0x0000,0x0000,
+0x126D,0x0000,0x0000, 0x11C2,0x0000,0x0000, 0x11C2,0x0000,0x0000,
+0xFBC0,0x84CF,0x0000, 0x1118,0x0000,0x0000, 0x1118,0x0000,0x0000,
+0x111C,0x0000,0x0000, 0x111C,0x0000,0x0000, 0x1128,0x0000,0x0000,
+0x1128,0x0000,0x0000, 0x1156,0x0000,0x0000, 0x1156,0x0000,0x0000,
+0x1120,0x0000,0x0000, 0x1120,0x0000,0x0000, 0x1124,0x0000,0x0000,
+0x1124,0x0000,0x0000, 0x1162,0x0000,0x0000, 0x1162,0x0000,0x0000,
+0x116F,0x0000,0x0000, 0x116F,0x0000,0x0000, 0x1177,0x0000,0x0000,
+0x1177,0x0000,0x0000, 0x117C,0x0000,0x0000, 0x117C,0x0000,0x0000,
+0x1184,0x0000,0x0000, 0x1184,0x0000,0x0000, 0x11E3,0x0000,0x0000,
+0x11E3,0x0000,0x0000, 0x11E7,0x0000,0x0000, 0x11E7,0x0000,0x0000,
+0x11EB,0x0000,0x0000, 0x11EB,0x0000,0x0000, 0x12A5,0x0000,0x0000,
+0x12A5,0x0000,0x0000, 0x121D,0x0000,0x0000, 0x121D,0x0000,0x0000,
+0x1225,0x0000,0x0000, 0x1225,0x0000,0x0000, 0x1229,0x0000,0x0000,
+0x1229,0x0000,0x0000, 0x1265,0x0000,0x0000, 0x1265,0x0000,0x0000,
+0xFBC0,0x84F6,0x0000, 0xFBC0,0x84F7,0x0000, 0x1291,0x0000,0x0000,
+0x1291,0x0000,0x0000, 0xFBC0,0x84FA,0x0000, 0xFBC0,0x84FB,0x0000,
+0xFBC0,0x84FC,0x0000, 0xFBC0,0x84FD,0x0000, 0xFBC0,0x84FE,0x0000,
+0xFBC0,0x84FF,0x0000 };
+
+static uint16 page005data[]= { /* 0500 (3 weights per char) */
+0x1144,0x0000,0x0000, 0x1144,0x0000,0x0000, 0x1149,0x0000,0x0000,
+0x1149,0x0000,0x0000, 0x116E,0x0000,0x0000, 0x116E,0x0000,0x0000,
+0x117B,0x0000,0x0000, 0x117B,0x0000,0x0000, 0x11BD,0x0000,0x0000,
+0x11BD,0x0000,0x0000, 0x11DE,0x0000,0x0000, 0x11DE,0x0000,0x0000,
+0x1207,0x0000,0x0000, 0x1207,0x0000,0x0000, 0x1210,0x0000,0x0000,
+0x1210,0x0000,0x0000, 0xFBC0,0x8510,0x0000, 0xFBC0,0x8511,0x0000,
+0xFBC0,0x8512,0x0000, 0xFBC0,0x8513,0x0000, 0xFBC0,0x8514,0x0000,
+0xFBC0,0x8515,0x0000, 0xFBC0,0x8516,0x0000, 0xFBC0,0x8517,0x0000,
+0xFBC0,0x8518,0x0000, 0xFBC0,0x8519,0x0000, 0xFBC0,0x851A,0x0000,
+0xFBC0,0x851B,0x0000, 0xFBC0,0x851C,0x0000, 0xFBC0,0x851D,0x0000,
+0xFBC0,0x851E,0x0000, 0xFBC0,0x851F,0x0000, 0xFBC0,0x8520,0x0000,
+0xFBC0,0x8521,0x0000, 0xFBC0,0x8522,0x0000, 0xFBC0,0x8523,0x0000,
+0xFBC0,0x8524,0x0000, 0xFBC0,0x8525,0x0000, 0xFBC0,0x8526,0x0000,
+0xFBC0,0x8527,0x0000, 0xFBC0,0x8528,0x0000, 0xFBC0,0x8529,0x0000,
+0xFBC0,0x852A,0x0000, 0xFBC0,0x852B,0x0000, 0xFBC0,0x852C,0x0000,
+0xFBC0,0x852D,0x0000, 0xFBC0,0x852E,0x0000, 0xFBC0,0x852F,0x0000,
+0xFBC0,0x8530,0x0000, 0x130A,0x0000,0x0000, 0x130B,0x0000,0x0000,
+0x130C,0x0000,0x0000, 0x130D,0x0000,0x0000, 0x130E,0x0000,0x0000,
+0x130F,0x0000,0x0000, 0x1310,0x0000,0x0000, 0x1311,0x0000,0x0000,
+0x1312,0x0000,0x0000, 0x1313,0x0000,0x0000, 0x1314,0x0000,0x0000,
+0x1315,0x0000,0x0000, 0x1316,0x0000,0x0000, 0x1317,0x0000,0x0000,
+0x1318,0x0000,0x0000, 0x1319,0x0000,0x0000, 0x131A,0x0000,0x0000,
+0x131B,0x0000,0x0000, 0x131C,0x0000,0x0000, 0x131D,0x0000,0x0000,
+0x131E,0x0000,0x0000, 0x131F,0x0000,0x0000, 0x1320,0x0000,0x0000,
+0x1321,0x0000,0x0000, 0x1322,0x0000,0x0000, 0x1323,0x0000,0x0000,
+0x1324,0x0000,0x0000, 0x1325,0x0000,0x0000, 0x1326,0x0000,0x0000,
+0x1327,0x0000,0x0000, 0x1328,0x0000,0x0000, 0x1329,0x0000,0x0000,
+0x132A,0x0000,0x0000, 0x132B,0x0000,0x0000, 0x132C,0x0000,0x0000,
+0x132D,0x0000,0x0000, 0x132E,0x0000,0x0000, 0x132F,0x0000,0x0000,
+0xFBC0,0x8557,0x0000, 0xFBC0,0x8558,0x0000, 0x1330,0x0000,0x0000,
+0x02EC,0x0000,0x0000, 0x02ED,0x0000,0x0000, 0x0253,0x0000,0x0000,
+0x0230,0x0000,0x0000, 0x0257,0x0000,0x0000, 0x02EE,0x0000,0x0000,
+0xFBC0,0x8560,0x0000, 0x130A,0x0000,0x0000, 0x130B,0x0000,0x0000,
+0x130C,0x0000,0x0000, 0x130D,0x0000,0x0000, 0x130E,0x0000,0x0000,
+0x130F,0x0000,0x0000, 0x1310,0x0000,0x0000, 0x1311,0x0000,0x0000,
+0x1312,0x0000,0x0000, 0x1313,0x0000,0x0000, 0x1314,0x0000,0x0000,
+0x1315,0x0000,0x0000, 0x1316,0x0000,0x0000, 0x1317,0x0000,0x0000,
+0x1318,0x0000,0x0000, 0x1319,0x0000,0x0000, 0x131A,0x0000,0x0000,
+0x131B,0x0000,0x0000, 0x131C,0x0000,0x0000, 0x131D,0x0000,0x0000,
+0x131E,0x0000,0x0000, 0x131F,0x0000,0x0000, 0x1320,0x0000,0x0000,
+0x1321,0x0000,0x0000, 0x1322,0x0000,0x0000, 0x1323,0x0000,0x0000,
+0x1324,0x0000,0x0000, 0x1325,0x0000,0x0000, 0x1326,0x0000,0x0000,
+0x1327,0x0000,0x0000, 0x1328,0x0000,0x0000, 0x1329,0x0000,0x0000,
+0x132A,0x0000,0x0000, 0x132B,0x0000,0x0000, 0x132C,0x0000,0x0000,
+0x132D,0x0000,0x0000, 0x132E,0x0000,0x0000, 0x132F,0x0000,0x0000,
+0x130E,0x132B,0x0000, 0xFBC0,0x8588,0x0000, 0x023E,0x0000,0x0000,
+0x0222,0x0000,0x0000, 0xFBC0,0x858B,0x0000, 0xFBC0,0x858C,0x0000,
+0xFBC0,0x858D,0x0000, 0xFBC0,0x858E,0x0000, 0xFBC0,0x858F,0x0000,
+0xFBC0,0x8590,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x85A2,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x85BA,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x02EF,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x02F0,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x02F1,0x0000,0x0000, 0x0000,0x0000,0x0000, 0xFBC0,0x85C5,0x0000,
+0xFBC0,0x85C6,0x0000, 0xFBC0,0x85C7,0x0000, 0xFBC0,0x85C8,0x0000,
+0xFBC0,0x85C9,0x0000, 0xFBC0,0x85CA,0x0000, 0xFBC0,0x85CB,0x0000,
+0xFBC0,0x85CC,0x0000, 0xFBC0,0x85CD,0x0000, 0xFBC0,0x85CE,0x0000,
+0xFBC0,0x85CF,0x0000, 0x1331,0x0000,0x0000, 0x1332,0x0000,0x0000,
+0x1333,0x0000,0x0000, 0x1334,0x0000,0x0000, 0x1335,0x0000,0x0000,
+0x1336,0x0000,0x0000, 0x1337,0x0000,0x0000, 0x1338,0x0000,0x0000,
+0x1339,0x0000,0x0000, 0x133A,0x0000,0x0000, 0x133B,0x0000,0x0000,
+0x133B,0x0000,0x0000, 0x133C,0x0000,0x0000, 0x133D,0x0000,0x0000,
+0x133D,0x0000,0x0000, 0x133E,0x0000,0x0000, 0x133E,0x0000,0x0000,
+0x133F,0x0000,0x0000, 0x1340,0x0000,0x0000, 0x1341,0x0000,0x0000,
+0x1341,0x0000,0x0000, 0x1342,0x0000,0x0000, 0x1342,0x0000,0x0000,
+0x1343,0x0000,0x0000, 0x1344,0x0000,0x0000, 0x1345,0x0000,0x0000,
+0x1346,0x0000,0x0000, 0xFBC0,0x85EB,0x0000, 0xFBC0,0x85EC,0x0000,
+0xFBC0,0x85ED,0x0000, 0xFBC0,0x85EE,0x0000, 0xFBC0,0x85EF,0x0000,
+0x1336,0x1336,0x0000, 0x1336,0x133A,0x0000, 0x133A,0x133A,0x0000,
+0x02F2,0x0000,0x0000, 0x02F3,0x0000,0x0000, 0xFBC0,0x85F5,0x0000,
+0xFBC0,0x85F6,0x0000, 0xFBC0,0x85F7,0x0000, 0xFBC0,0x85F8,0x0000,
+0xFBC0,0x85F9,0x0000, 0xFBC0,0x85FA,0x0000, 0xFBC0,0x85FB,0x0000,
+0xFBC0,0x85FC,0x0000, 0xFBC0,0x85FD,0x0000, 0xFBC0,0x85FE,0x0000,
+0xFBC0,0x85FF,0x0000 };
+
+static uint16 page006data[]= { /* 0600 (3 weights per char) */
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8604,0x0000, 0xFBC0,0x8605,0x0000,
+0xFBC0,0x8606,0x0000, 0xFBC0,0x8607,0x0000, 0xFBC0,0x8608,0x0000,
+0xFBC0,0x8609,0x0000, 0xFBC0,0x860A,0x0000, 0xFBC0,0x860B,0x0000,
+0x0231,0x0000,0x0000, 0x0232,0x0000,0x0000, 0x034C,0x0000,0x0000,
+0x034D,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8616,0x0000, 0xFBC0,0x8617,0x0000,
+0xFBC0,0x8618,0x0000, 0xFBC0,0x8619,0x0000, 0xFBC0,0x861A,0x0000,
+0x023B,0x0000,0x0000, 0xFBC0,0x861C,0x0000, 0xFBC0,0x861D,0x0000,
+0xFBC0,0x861E,0x0000, 0x0258,0x0000,0x0000, 0xFBC0,0x8620,0x0000,
+0x1347,0x0000,0x0000, 0x1348,0x0000,0x0000, 0x1349,0x0000,0x0000,
+0x134C,0x0000,0x0000, 0x134D,0x0000,0x0000, 0x134F,0x0000,0x0000,
+0x1350,0x0000,0x0000, 0x1352,0x0000,0x0000, 0x1356,0x0000,0x0000,
+0x1357,0x0000,0x0000, 0x1358,0x0000,0x0000, 0x135E,0x0000,0x0000,
+0x1364,0x0000,0x0000, 0x1365,0x0000,0x0000, 0x1369,0x0000,0x0000,
+0x136A,0x0000,0x0000, 0x1375,0x0000,0x0000, 0x1376,0x0000,0x0000,
+0x1381,0x0000,0x0000, 0x1382,0x0000,0x0000, 0x1387,0x0000,0x0000,
+0x1388,0x0000,0x0000, 0x138C,0x0000,0x0000, 0x138D,0x0000,0x0000,
+0x138F,0x0000,0x0000, 0x1390,0x0000,0x0000, 0xFBC0,0x863B,0x0000,
+0xFBC0,0x863C,0x0000, 0xFBC0,0x863D,0x0000, 0xFBC0,0x863E,0x0000,
+0xFBC0,0x863F,0x0000, 0x020B,0x0000,0x0000, 0x1393,0x0000,0x0000,
+0x139B,0x0000,0x0000, 0x139E,0x0000,0x0000, 0x13AB,0x0000,0x0000,
+0x13B0,0x0000,0x0000, 0x13B1,0x0000,0x0000, 0x13B7,0x0000,0x0000,
+0x13BD,0x0000,0x0000, 0x13C7,0x0000,0x0000, 0x13C8,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0xFBC0,0x8659,0x0000,
+0xFBC0,0x865A,0x0000, 0xFBC0,0x865B,0x0000, 0xFBC0,0x865C,0x0000,
+0xFBC0,0x865D,0x0000, 0xFBC0,0x865E,0x0000, 0xFBC0,0x865F,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0x02D4,0x0000,0x0000, 0x0233,0x0000,0x0000,
+0x0234,0x0000,0x0000, 0x02CB,0x0000,0x0000, 0x1351,0x0000,0x0000,
+0x139A,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x134B,0x0000,0x0000,
+0x134A,0x0000,0x0000, 0x134E,0x0000,0x0000, 0x1347,0x0000,0x0000,
+0x1350,0x1347,0x0000, 0x13BD,0x1347,0x0000, 0x13C1,0x1347,0x0000,
+0x13C8,0x1347,0x0000, 0x1359,0x0000,0x0000, 0x135A,0x0000,0x0000,
+0x1353,0x0000,0x0000, 0x135B,0x0000,0x0000, 0x135C,0x0000,0x0000,
+0x1354,0x0000,0x0000, 0x135D,0x0000,0x0000, 0x1355,0x0000,0x0000,
+0x1366,0x0000,0x0000, 0x1367,0x0000,0x0000, 0x135F,0x0000,0x0000,
+0x1360,0x0000,0x0000, 0x1368,0x0000,0x0000, 0x1361,0x0000,0x0000,
+0x1363,0x0000,0x0000, 0x136B,0x0000,0x0000, 0x136C,0x0000,0x0000,
+0x136D,0x0000,0x0000, 0x136E,0x0000,0x0000, 0x136F,0x0000,0x0000,
+0x1370,0x0000,0x0000, 0x1371,0x0000,0x0000, 0x1372,0x0000,0x0000,
+0x1373,0x0000,0x0000, 0x1377,0x0000,0x0000, 0x1378,0x0000,0x0000,
+0x1379,0x0000,0x0000, 0x137A,0x0000,0x0000, 0x137B,0x0000,0x0000,
+0x137C,0x0000,0x0000, 0x137D,0x0000,0x0000, 0x137E,0x0000,0x0000,
+0x137F,0x0000,0x0000, 0x1383,0x0000,0x0000, 0x1384,0x0000,0x0000,
+0x1385,0x0000,0x0000, 0x1389,0x0000,0x0000, 0x138A,0x0000,0x0000,
+0x138E,0x0000,0x0000, 0x1391,0x0000,0x0000, 0x1394,0x0000,0x0000,
+0x1395,0x0000,0x0000, 0x1396,0x0000,0x0000, 0x1397,0x0000,0x0000,
+0x1398,0x0000,0x0000, 0x1399,0x0000,0x0000, 0x139C,0x0000,0x0000,
+0x139D,0x0000,0x0000, 0x139F,0x0000,0x0000, 0x13A0,0x0000,0x0000,
+0x13A1,0x0000,0x0000, 0x13A2,0x0000,0x0000, 0x13A3,0x0000,0x0000,
+0x13A4,0x0000,0x0000, 0x13A5,0x0000,0x0000, 0x13A6,0x0000,0x0000,
+0x13A7,0x0000,0x0000, 0x13A8,0x0000,0x0000, 0x13A9,0x0000,0x0000,
+0x13AA,0x0000,0x0000, 0x13AC,0x0000,0x0000, 0x13AD,0x0000,0x0000,
+0x13AE,0x0000,0x0000, 0x13AF,0x0000,0x0000, 0x13B6,0x0000,0x0000,
+0x13B2,0x0000,0x0000, 0x13B3,0x0000,0x0000, 0x13B4,0x0000,0x0000,
+0x13B5,0x0000,0x0000, 0x13B8,0x0000,0x0000, 0x1362,0x0000,0x0000,
+0x13BC,0x0000,0x0000, 0x13B9,0x0000,0x0000, 0x13B9,0x0000,0x0000,
+0x13BA,0x0000,0x0000, 0x13BE,0x0000,0x0000, 0x13BF,0x0000,0x0000,
+0x13C0,0x0000,0x0000, 0x13C1,0x0000,0x0000, 0x13C2,0x0000,0x0000,
+0x13C3,0x0000,0x0000, 0x13C4,0x0000,0x0000, 0x13C5,0x0000,0x0000,
+0x13C9,0x0000,0x0000, 0x13CA,0x0000,0x0000, 0x13CB,0x0000,0x0000,
+0x13C6,0x0000,0x0000, 0x13CC,0x0000,0x0000, 0x13CD,0x0000,0x0000,
+0x13CE,0x0000,0x0000, 0x13CE,0x0000,0x0000, 0x025F,0x0000,0x0000,
+0x13BC,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x13BD,0x0000,0x0000, 0x13C8,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x034E,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x1374,0x0000,0x0000, 0x1380,0x0000,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0x1386,0x0000,0x0000, 0x138B,0x0000,0x0000,
+0x1392,0x0000,0x0000, 0x1347,0x0000,0x0000, 0x13B0,0x0000,0x0000,
+0x13BB,0x0000,0x0000 };
+
+static uint16 page007data[]= { /* 0700 (3 weights per char) */
+0x0270,0x0000,0x0000, 0x0260,0x0000,0x0000, 0x0261,0x0000,0x0000,
+0x023F,0x0000,0x0000, 0x0240,0x0000,0x0000, 0x0241,0x0000,0x0000,
+0x0242,0x0000,0x0000, 0x0243,0x0000,0x0000, 0x0244,0x0000,0x0000,
+0x0259,0x0000,0x0000, 0x02F4,0x0000,0x0000, 0x02F5,0x0000,0x0000,
+0x02F6,0x0000,0x0000, 0x02F7,0x0000,0x0000, 0xFBC0,0x870E,0x0000,
+0x0000,0x0000,0x0000, 0x13CF,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x13D0,0x0000,0x0000, 0x13D1,0x0000,0x0000, 0x13D1,0x0000,0x0000,
+0x13D3,0x0000,0x0000, 0x13D2,0x0000,0x0000, 0x13D4,0x0000,0x0000,
+0x13D5,0x0000,0x0000, 0x13D6,0x0000,0x0000, 0x13D8,0x0000,0x0000,
+0x13D9,0x0000,0x0000, 0x13D9,0x0000,0x0000, 0x13DA,0x0000,0x0000,
+0x13DB,0x0000,0x0000, 0x13DC,0x0000,0x0000, 0x13DE,0x0000,0x0000,
+0x13DF,0x0000,0x0000, 0x13E0,0x0000,0x0000, 0x13E1,0x0000,0x0000,
+0x13E1,0x0000,0x0000, 0x13E2,0x0000,0x0000, 0x13E3,0x0000,0x0000,
+0x13E3,0x0000,0x0000, 0x13E5,0x0000,0x0000, 0x13E6,0x0000,0x0000,
+0x13E7,0x0000,0x0000, 0x13E8,0x0000,0x0000, 0x13E9,0x0000,0x0000,
+0x13D0,0x0000,0x0000, 0x13D1,0x0000,0x0000, 0x13D3,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x874B,0x0000, 0xFBC0,0x874C,0x0000, 0x13D7,0x0000,0x0000,
+0x13DD,0x0000,0x0000, 0x13E4,0x0000,0x0000, 0xFBC0,0x8750,0x0000,
+0xFBC0,0x8751,0x0000, 0xFBC0,0x8752,0x0000, 0xFBC0,0x8753,0x0000,
+0xFBC0,0x8754,0x0000, 0xFBC0,0x8755,0x0000, 0xFBC0,0x8756,0x0000,
+0xFBC0,0x8757,0x0000, 0xFBC0,0x8758,0x0000, 0xFBC0,0x8759,0x0000,
+0xFBC0,0x875A,0x0000, 0xFBC0,0x875B,0x0000, 0xFBC0,0x875C,0x0000,
+0xFBC0,0x875D,0x0000, 0xFBC0,0x875E,0x0000, 0xFBC0,0x875F,0x0000,
+0xFBC0,0x8760,0x0000, 0xFBC0,0x8761,0x0000, 0xFBC0,0x8762,0x0000,
+0xFBC0,0x8763,0x0000, 0xFBC0,0x8764,0x0000, 0xFBC0,0x8765,0x0000,
+0xFBC0,0x8766,0x0000, 0xFBC0,0x8767,0x0000, 0xFBC0,0x8768,0x0000,
+0xFBC0,0x8769,0x0000, 0xFBC0,0x876A,0x0000, 0xFBC0,0x876B,0x0000,
+0xFBC0,0x876C,0x0000, 0xFBC0,0x876D,0x0000, 0xFBC0,0x876E,0x0000,
+0xFBC0,0x876F,0x0000, 0xFBC0,0x8770,0x0000, 0xFBC0,0x8771,0x0000,
+0xFBC0,0x8772,0x0000, 0xFBC0,0x8773,0x0000, 0xFBC0,0x8774,0x0000,
+0xFBC0,0x8775,0x0000, 0xFBC0,0x8776,0x0000, 0xFBC0,0x8777,0x0000,
+0xFBC0,0x8778,0x0000, 0xFBC0,0x8779,0x0000, 0xFBC0,0x877A,0x0000,
+0xFBC0,0x877B,0x0000, 0xFBC0,0x877C,0x0000, 0xFBC0,0x877D,0x0000,
+0xFBC0,0x877E,0x0000, 0xFBC0,0x877F,0x0000, 0x13EA,0x0000,0x0000,
+0x13ED,0x0000,0x0000, 0x13EE,0x0000,0x0000, 0x13EF,0x0000,0x0000,
+0x13F1,0x0000,0x0000, 0x13F2,0x0000,0x0000, 0x13F3,0x0000,0x0000,
+0x13F4,0x0000,0x0000, 0x13F7,0x0000,0x0000, 0x13F9,0x0000,0x0000,
+0x13FA,0x0000,0x0000, 0x13FB,0x0000,0x0000, 0x13FD,0x0000,0x0000,
+0x1401,0x0000,0x0000, 0x1402,0x0000,0x0000, 0x1404,0x0000,0x0000,
+0x1405,0x0000,0x0000, 0x1409,0x0000,0x0000, 0x140A,0x0000,0x0000,
+0x140B,0x0000,0x0000, 0x140C,0x0000,0x0000, 0x140D,0x0000,0x0000,
+0x140E,0x0000,0x0000, 0x140F,0x0000,0x0000, 0x13FE,0x0000,0x0000,
+0x13EB,0x0000,0x0000, 0x13EC,0x0000,0x0000, 0x13FC,0x0000,0x0000,
+0x13F0,0x0000,0x0000, 0x1406,0x0000,0x0000, 0x1407,0x0000,0x0000,
+0x1408,0x0000,0x0000, 0x13FF,0x0000,0x0000, 0x1400,0x0000,0x0000,
+0x13F5,0x0000,0x0000, 0x13F6,0x0000,0x0000, 0x1403,0x0000,0x0000,
+0x13F8,0x0000,0x0000, 0x1411,0x0000,0x0000, 0x1412,0x0000,0x0000,
+0x1413,0x0000,0x0000, 0x1414,0x0000,0x0000, 0x1415,0x0000,0x0000,
+0x1416,0x0000,0x0000, 0x1417,0x0000,0x0000, 0x1418,0x0000,0x0000,
+0x1419,0x0000,0x0000, 0x141A,0x0000,0x0000, 0x141B,0x0000,0x0000,
+0x1410,0x0000,0x0000, 0xFBC0,0x87B2,0x0000, 0xFBC0,0x87B3,0x0000,
+0xFBC0,0x87B4,0x0000, 0xFBC0,0x87B5,0x0000, 0xFBC0,0x87B6,0x0000,
+0xFBC0,0x87B7,0x0000, 0xFBC0,0x87B8,0x0000, 0xFBC0,0x87B9,0x0000,
+0xFBC0,0x87BA,0x0000, 0xFBC0,0x87BB,0x0000, 0xFBC0,0x87BC,0x0000,
+0xFBC0,0x87BD,0x0000, 0xFBC0,0x87BE,0x0000, 0xFBC0,0x87BF,0x0000,
+0xFBC0,0x87C0,0x0000, 0xFBC0,0x87C1,0x0000, 0xFBC0,0x87C2,0x0000,
+0xFBC0,0x87C3,0x0000, 0xFBC0,0x87C4,0x0000, 0xFBC0,0x87C5,0x0000,
+0xFBC0,0x87C6,0x0000, 0xFBC0,0x87C7,0x0000, 0xFBC0,0x87C8,0x0000,
+0xFBC0,0x87C9,0x0000, 0xFBC0,0x87CA,0x0000, 0xFBC0,0x87CB,0x0000,
+0xFBC0,0x87CC,0x0000, 0xFBC0,0x87CD,0x0000, 0xFBC0,0x87CE,0x0000,
+0xFBC0,0x87CF,0x0000, 0xFBC0,0x87D0,0x0000, 0xFBC0,0x87D1,0x0000,
+0xFBC0,0x87D2,0x0000, 0xFBC0,0x87D3,0x0000, 0xFBC0,0x87D4,0x0000,
+0xFBC0,0x87D5,0x0000, 0xFBC0,0x87D6,0x0000, 0xFBC0,0x87D7,0x0000,
+0xFBC0,0x87D8,0x0000, 0xFBC0,0x87D9,0x0000, 0xFBC0,0x87DA,0x0000,
+0xFBC0,0x87DB,0x0000, 0xFBC0,0x87DC,0x0000, 0xFBC0,0x87DD,0x0000,
+0xFBC0,0x87DE,0x0000, 0xFBC0,0x87DF,0x0000, 0xFBC0,0x87E0,0x0000,
+0xFBC0,0x87E1,0x0000, 0xFBC0,0x87E2,0x0000, 0xFBC0,0x87E3,0x0000,
+0xFBC0,0x87E4,0x0000, 0xFBC0,0x87E5,0x0000, 0xFBC0,0x87E6,0x0000,
+0xFBC0,0x87E7,0x0000, 0xFBC0,0x87E8,0x0000, 0xFBC0,0x87E9,0x0000,
+0xFBC0,0x87EA,0x0000, 0xFBC0,0x87EB,0x0000, 0xFBC0,0x87EC,0x0000,
+0xFBC0,0x87ED,0x0000, 0xFBC0,0x87EE,0x0000, 0xFBC0,0x87EF,0x0000,
+0xFBC0,0x87F0,0x0000, 0xFBC0,0x87F1,0x0000, 0xFBC0,0x87F2,0x0000,
+0xFBC0,0x87F3,0x0000, 0xFBC0,0x87F4,0x0000, 0xFBC0,0x87F5,0x0000,
+0xFBC0,0x87F6,0x0000, 0xFBC0,0x87F7,0x0000, 0xFBC0,0x87F8,0x0000,
+0xFBC0,0x87F9,0x0000, 0xFBC0,0x87FA,0x0000, 0xFBC0,0x87FB,0x0000,
+0xFBC0,0x87FC,0x0000, 0xFBC0,0x87FD,0x0000, 0xFBC0,0x87FE,0x0000,
+0xFBC0,0x87FF,0x0000 };
+
+static uint16 page009data[]= { /* 0900 (3 weights per char) */
+0xFBC0,0x8900,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x155A,0x0000,0x0000, 0x155B,0x0000,0x0000,
+0x155C,0x0000,0x0000, 0x155D,0x0000,0x0000, 0x155E,0x0000,0x0000,
+0x155F,0x0000,0x0000, 0x1560,0x0000,0x0000, 0x1561,0x0000,0x0000,
+0x1563,0x0000,0x0000, 0x1565,0x0000,0x0000, 0x1566,0x0000,0x0000,
+0x1567,0x0000,0x0000, 0x1568,0x0000,0x0000, 0x1569,0x0000,0x0000,
+0x156A,0x0000,0x0000, 0x156B,0x0000,0x0000, 0x156C,0x0000,0x0000,
+0x156D,0x0000,0x0000, 0x156E,0x0000,0x0000, 0x156F,0x0000,0x0000,
+0x1570,0x0000,0x0000, 0x1571,0x0000,0x0000, 0x1572,0x0000,0x0000,
+0x1573,0x0000,0x0000, 0x1574,0x0000,0x0000, 0x1575,0x0000,0x0000,
+0x1576,0x0000,0x0000, 0x1577,0x0000,0x0000, 0x1578,0x0000,0x0000,
+0x1579,0x0000,0x0000, 0x157A,0x0000,0x0000, 0x157B,0x0000,0x0000,
+0x157C,0x0000,0x0000, 0x157D,0x0000,0x0000, 0x157E,0x0000,0x0000,
+0x157F,0x0000,0x0000, 0x1580,0x0000,0x0000, 0x1580,0x0000,0x0000,
+0x1581,0x0000,0x0000, 0x1582,0x0000,0x0000, 0x1583,0x0000,0x0000,
+0x1584,0x0000,0x0000, 0x1585,0x0000,0x0000, 0x1586,0x0000,0x0000,
+0x1587,0x0000,0x0000, 0x1587,0x0000,0x0000, 0x1588,0x0000,0x0000,
+0x1589,0x0000,0x0000, 0x1589,0x0000,0x0000, 0x158A,0x0000,0x0000,
+0x158B,0x0000,0x0000, 0x158C,0x0000,0x0000, 0x158D,0x0000,0x0000,
+0x158E,0x0000,0x0000, 0xFBC0,0x893A,0x0000, 0xFBC0,0x893B,0x0000,
+0x0000,0x0000,0x0000, 0x158F,0x0000,0x0000, 0x1590,0x0000,0x0000,
+0x1591,0x0000,0x0000, 0x1592,0x0000,0x0000, 0x1593,0x0000,0x0000,
+0x1594,0x0000,0x0000, 0x1595,0x0000,0x0000, 0x1596,0x0000,0x0000,
+0x1599,0x0000,0x0000, 0x159A,0x0000,0x0000, 0x159B,0x0000,0x0000,
+0x159C,0x0000,0x0000, 0x159D,0x0000,0x0000, 0x159E,0x0000,0x0000,
+0x159F,0x0000,0x0000, 0x15A0,0x0000,0x0000, 0x15A1,0x0000,0x0000,
+0xFBC0,0x894E,0x0000, 0xFBC0,0x894F,0x0000, 0x1559,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8955,0x0000, 0xFBC0,0x8956,0x0000,
+0xFBC0,0x8957,0x0000, 0x156D,0x0000,0x0000, 0x156E,0x0000,0x0000,
+0x156F,0x0000,0x0000, 0x1574,0x0000,0x0000, 0x1579,0x0000,0x0000,
+0x157A,0x0000,0x0000, 0x1582,0x0000,0x0000, 0x1586,0x0000,0x0000,
+0x1562,0x0000,0x0000, 0x1564,0x0000,0x0000, 0x1597,0x0000,0x0000,
+0x1598,0x0000,0x0000, 0x0268,0x0000,0x0000, 0x0269,0x0000,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0x02FA,0x0000,0x0000, 0xFBC0,0x8971,0x0000,
+0xFBC0,0x8972,0x0000, 0xFBC0,0x8973,0x0000, 0xFBC0,0x8974,0x0000,
+0xFBC0,0x8975,0x0000, 0xFBC0,0x8976,0x0000, 0xFBC0,0x8977,0x0000,
+0xFBC0,0x8978,0x0000, 0xFBC0,0x8979,0x0000, 0xFBC0,0x897A,0x0000,
+0xFBC0,0x897B,0x0000, 0xFBC0,0x897C,0x0000, 0xFBC0,0x897D,0x0000,
+0xFBC0,0x897E,0x0000, 0xFBC0,0x897F,0x0000, 0xFBC0,0x8980,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x8984,0x0000, 0x15A2,0x0000,0x0000, 0x15A3,0x0000,0x0000,
+0x15A4,0x0000,0x0000, 0x15A5,0x0000,0x0000, 0x15A6,0x0000,0x0000,
+0x15A7,0x0000,0x0000, 0x15A8,0x0000,0x0000, 0x15AA,0x0000,0x0000,
+0xFBC0,0x898D,0x0000, 0xFBC0,0x898E,0x0000, 0x15AC,0x0000,0x0000,
+0x15AD,0x0000,0x0000, 0xFBC0,0x8991,0x0000, 0xFBC0,0x8992,0x0000,
+0x15AE,0x0000,0x0000, 0x15AF,0x0000,0x0000, 0x15B0,0x0000,0x0000,
+0x15B1,0x0000,0x0000, 0x15B2,0x0000,0x0000, 0x15B3,0x0000,0x0000,
+0x15B4,0x0000,0x0000, 0x15B5,0x0000,0x0000, 0x15B6,0x0000,0x0000,
+0x15B7,0x0000,0x0000, 0x15B8,0x0000,0x0000, 0x15B9,0x0000,0x0000,
+0x15BA,0x0000,0x0000, 0x15BB,0x0000,0x0000, 0x15BC,0x0000,0x0000,
+0x15BD,0x0000,0x0000, 0x15BE,0x0000,0x0000, 0x15BF,0x0000,0x0000,
+0x15C0,0x0000,0x0000, 0x15C1,0x0000,0x0000, 0x15C2,0x0000,0x0000,
+0x15C3,0x0000,0x0000, 0xFBC0,0x89A9,0x0000, 0x15C4,0x0000,0x0000,
+0x15C5,0x0000,0x0000, 0x15C6,0x0000,0x0000, 0x15C7,0x0000,0x0000,
+0x15C8,0x0000,0x0000, 0x15C9,0x0000,0x0000, 0x15CA,0x0000,0x0000,
+0xFBC0,0x89B1,0x0000, 0x15CC,0x0000,0x0000, 0xFBC0,0x89B3,0x0000,
+0xFBC0,0x89B4,0x0000, 0xFBC0,0x89B5,0x0000, 0x15CE,0x0000,0x0000,
+0x15CF,0x0000,0x0000, 0x15D0,0x0000,0x0000, 0x15D1,0x0000,0x0000,
+0xFBC0,0x89BA,0x0000, 0xFBC0,0x89BB,0x0000, 0x0000,0x0000,0x0000,
+0x15D2,0x0000,0x0000, 0x15D3,0x0000,0x0000, 0x15D4,0x0000,0x0000,
+0x15D5,0x0000,0x0000, 0x15D6,0x0000,0x0000, 0x15D7,0x0000,0x0000,
+0x15D8,0x0000,0x0000, 0x15D9,0x0000,0x0000, 0xFBC0,0x89C5,0x0000,
+0xFBC0,0x89C6,0x0000, 0x15DC,0x0000,0x0000, 0x15DD,0x0000,0x0000,
+0xFBC0,0x89C9,0x0000, 0xFBC0,0x89CA,0x0000, 0x15DE,0x0000,0x0000,
+0x15DF,0x0000,0x0000, 0x15E0,0x0000,0x0000, 0xFBC0,0x89CE,0x0000,
+0xFBC0,0x89CF,0x0000, 0xFBC0,0x89D0,0x0000, 0xFBC0,0x89D1,0x0000,
+0xFBC0,0x89D2,0x0000, 0xFBC0,0x89D3,0x0000, 0xFBC0,0x89D4,0x0000,
+0xFBC0,0x89D5,0x0000, 0xFBC0,0x89D6,0x0000, 0x15E1,0x0000,0x0000,
+0xFBC0,0x89D8,0x0000, 0xFBC0,0x89D9,0x0000, 0xFBC0,0x89DA,0x0000,
+0xFBC0,0x89DB,0x0000, 0x15BC,0x0000,0x0000, 0x15BD,0x0000,0x0000,
+0xFBC0,0x89DE,0x0000, 0x15C9,0x0000,0x0000, 0x15A9,0x0000,0x0000,
+0x15AB,0x0000,0x0000, 0x15DA,0x0000,0x0000, 0x15DB,0x0000,0x0000,
+0xFBC0,0x89E4,0x0000, 0xFBC0,0x89E5,0x0000, 0x0E29,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x15CB,0x0000,0x0000, 0x15CD,0x0000,0x0000, 0x0E12,0x0000,0x0000,
+0x0E13,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0DC7,0x0000,0x0000,
+0x0DC8,0x0000,0x0000, 0x0350,0x0000,0x0000, 0xFBC0,0x89FB,0x0000,
+0xFBC0,0x89FC,0x0000, 0xFBC0,0x89FD,0x0000, 0xFBC0,0x89FE,0x0000,
+0xFBC0,0x89FF,0x0000 };
+
+static uint16 page00Adata[]= { /* 0A00 (3 weights per char) */
+0xFBC0,0x8A00,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8A04,0x0000, 0x15E7,0x0000,0x0000,
+0x15E8,0x0000,0x0000, 0x15EC,0x0000,0x0000, 0x15ED,0x0000,0x0000,
+0x15E4,0x0000,0x0000, 0x15E5,0x0000,0x0000, 0xFBC0,0x8A0B,0x0000,
+0xFBC0,0x8A0C,0x0000, 0xFBC0,0x8A0D,0x0000, 0xFBC0,0x8A0E,0x0000,
+0x15EE,0x0000,0x0000, 0x15E9,0x0000,0x0000, 0xFBC0,0x8A11,0x0000,
+0xFBC0,0x8A12,0x0000, 0x15E6,0x0000,0x0000, 0x15EA,0x0000,0x0000,
+0x15F1,0x0000,0x0000, 0x15F2,0x0000,0x0000, 0x15F3,0x0000,0x0000,
+0x15F4,0x0000,0x0000, 0x15F5,0x0000,0x0000, 0x15F6,0x0000,0x0000,
+0x15F7,0x0000,0x0000, 0x15F8,0x0000,0x0000, 0x15F9,0x0000,0x0000,
+0x15FA,0x0000,0x0000, 0x15FB,0x0000,0x0000, 0x15FC,0x0000,0x0000,
+0x15FD,0x0000,0x0000, 0x15FE,0x0000,0x0000, 0x15FF,0x0000,0x0000,
+0x1600,0x0000,0x0000, 0x1601,0x0000,0x0000, 0x1602,0x0000,0x0000,
+0x1603,0x0000,0x0000, 0x1604,0x0000,0x0000, 0xFBC0,0x8A29,0x0000,
+0x1605,0x0000,0x0000, 0x1606,0x0000,0x0000, 0x1607,0x0000,0x0000,
+0x1608,0x0000,0x0000, 0x1609,0x0000,0x0000, 0x160A,0x0000,0x0000,
+0x160B,0x0000,0x0000, 0xFBC0,0x8A31,0x0000, 0x160C,0x0000,0x0000,
+0x160C,0x0000,0x0000, 0xFBC0,0x8A34,0x0000, 0x160D,0x0000,0x0000,
+0x15EF,0x0000,0x0000, 0xFBC0,0x8A37,0x0000, 0x15EF,0x0000,0x0000,
+0x15F0,0x0000,0x0000, 0xFBC0,0x8A3A,0x0000, 0xFBC0,0x8A3B,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8A3D,0x0000, 0x160F,0x0000,0x0000,
+0x1610,0x0000,0x0000, 0x1611,0x0000,0x0000, 0x1612,0x0000,0x0000,
+0x1613,0x0000,0x0000, 0xFBC0,0x8A43,0x0000, 0xFBC0,0x8A44,0x0000,
+0xFBC0,0x8A45,0x0000, 0xFBC0,0x8A46,0x0000, 0x1614,0x0000,0x0000,
+0x1615,0x0000,0x0000, 0xFBC0,0x8A49,0x0000, 0xFBC0,0x8A4A,0x0000,
+0x1616,0x0000,0x0000, 0x1617,0x0000,0x0000, 0x1618,0x0000,0x0000,
+0xFBC0,0x8A4E,0x0000, 0xFBC0,0x8A4F,0x0000, 0xFBC0,0x8A50,0x0000,
+0xFBC0,0x8A51,0x0000, 0xFBC0,0x8A52,0x0000, 0xFBC0,0x8A53,0x0000,
+0xFBC0,0x8A54,0x0000, 0xFBC0,0x8A55,0x0000, 0xFBC0,0x8A56,0x0000,
+0xFBC0,0x8A57,0x0000, 0xFBC0,0x8A58,0x0000, 0x15F2,0x0000,0x0000,
+0x15F3,0x0000,0x0000, 0x15F8,0x0000,0x0000, 0x160E,0x0000,0x0000,
+0xFBC0,0x8A5D,0x0000, 0x1606,0x0000,0x0000, 0xFBC0,0x8A5F,0x0000,
+0xFBC0,0x8A60,0x0000, 0xFBC0,0x8A61,0x0000, 0xFBC0,0x8A62,0x0000,
+0xFBC0,0x8A63,0x0000, 0xFBC0,0x8A64,0x0000, 0xFBC0,0x8A65,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x15EB,0x0000,0x0000, 0x15E3,0x0000,0x0000, 0x15E2,0x0000,0x0000,
+0xFBC0,0x8A75,0x0000, 0xFBC0,0x8A76,0x0000, 0xFBC0,0x8A77,0x0000,
+0xFBC0,0x8A78,0x0000, 0xFBC0,0x8A79,0x0000, 0xFBC0,0x8A7A,0x0000,
+0xFBC0,0x8A7B,0x0000, 0xFBC0,0x8A7C,0x0000, 0xFBC0,0x8A7D,0x0000,
+0xFBC0,0x8A7E,0x0000, 0xFBC0,0x8A7F,0x0000, 0xFBC0,0x8A80,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x8A84,0x0000, 0x161A,0x0000,0x0000, 0x161B,0x0000,0x0000,
+0x161C,0x0000,0x0000, 0x161D,0x0000,0x0000, 0x161E,0x0000,0x0000,
+0x161F,0x0000,0x0000, 0x1620,0x0000,0x0000, 0x1622,0x0000,0x0000,
+0x1624,0x0000,0x0000, 0xFBC0,0x8A8E,0x0000, 0x1625,0x0000,0x0000,
+0x1626,0x0000,0x0000, 0x1627,0x0000,0x0000, 0xFBC0,0x8A92,0x0000,
+0x1628,0x0000,0x0000, 0x1629,0x0000,0x0000, 0x162A,0x0000,0x0000,
+0x162B,0x0000,0x0000, 0x162C,0x0000,0x0000, 0x162D,0x0000,0x0000,
+0x162E,0x0000,0x0000, 0x162F,0x0000,0x0000, 0x1630,0x0000,0x0000,
+0x1631,0x0000,0x0000, 0x1632,0x0000,0x0000, 0x1633,0x0000,0x0000,
+0x1634,0x0000,0x0000, 0x1635,0x0000,0x0000, 0x1636,0x0000,0x0000,
+0x1637,0x0000,0x0000, 0x1638,0x0000,0x0000, 0x1639,0x0000,0x0000,
+0x163A,0x0000,0x0000, 0x163B,0x0000,0x0000, 0x163C,0x0000,0x0000,
+0x163D,0x0000,0x0000, 0xFBC0,0x8AA9,0x0000, 0x163E,0x0000,0x0000,
+0x163F,0x0000,0x0000, 0x1640,0x0000,0x0000, 0x1641,0x0000,0x0000,
+0x1642,0x0000,0x0000, 0x1643,0x0000,0x0000, 0x1644,0x0000,0x0000,
+0xFBC0,0x8AB1,0x0000, 0x1645,0x0000,0x0000, 0x1646,0x0000,0x0000,
+0xFBC0,0x8AB4,0x0000, 0x1647,0x0000,0x0000, 0x1648,0x0000,0x0000,
+0x1649,0x0000,0x0000, 0x164A,0x0000,0x0000, 0x164B,0x0000,0x0000,
+0xFBC0,0x8ABA,0x0000, 0xFBC0,0x8ABB,0x0000, 0x0000,0x0000,0x0000,
+0x164C,0x0000,0x0000, 0x164D,0x0000,0x0000, 0x164E,0x0000,0x0000,
+0x164F,0x0000,0x0000, 0x1650,0x0000,0x0000, 0x1651,0x0000,0x0000,
+0x1652,0x0000,0x0000, 0x1653,0x0000,0x0000, 0x1656,0x0000,0x0000,
+0xFBC0,0x8AC6,0x0000, 0x1657,0x0000,0x0000, 0x1658,0x0000,0x0000,
+0x1659,0x0000,0x0000, 0xFBC0,0x8ACA,0x0000, 0x165A,0x0000,0x0000,
+0x165B,0x0000,0x0000, 0x165C,0x0000,0x0000, 0xFBC0,0x8ACE,0x0000,
+0xFBC0,0x8ACF,0x0000, 0x1619,0x0000,0x0000, 0xFBC0,0x8AD1,0x0000,
+0xFBC0,0x8AD2,0x0000, 0xFBC0,0x8AD3,0x0000, 0xFBC0,0x8AD4,0x0000,
+0xFBC0,0x8AD5,0x0000, 0xFBC0,0x8AD6,0x0000, 0xFBC0,0x8AD7,0x0000,
+0xFBC0,0x8AD8,0x0000, 0xFBC0,0x8AD9,0x0000, 0xFBC0,0x8ADA,0x0000,
+0xFBC0,0x8ADB,0x0000, 0xFBC0,0x8ADC,0x0000, 0xFBC0,0x8ADD,0x0000,
+0xFBC0,0x8ADE,0x0000, 0xFBC0,0x8ADF,0x0000, 0x1621,0x0000,0x0000,
+0x1623,0x0000,0x0000, 0x1654,0x0000,0x0000, 0x1655,0x0000,0x0000,
+0xFBC0,0x8AE4,0x0000, 0xFBC0,0x8AE5,0x0000, 0x0E29,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0xFBC0,0x8AF0,0x0000, 0x0E14,0x0000,0x0000, 0xFBC0,0x8AF2,0x0000,
+0xFBC0,0x8AF3,0x0000, 0xFBC0,0x8AF4,0x0000, 0xFBC0,0x8AF5,0x0000,
+0xFBC0,0x8AF6,0x0000, 0xFBC0,0x8AF7,0x0000, 0xFBC0,0x8AF8,0x0000,
+0xFBC0,0x8AF9,0x0000, 0xFBC0,0x8AFA,0x0000, 0xFBC0,0x8AFB,0x0000,
+0xFBC0,0x8AFC,0x0000, 0xFBC0,0x8AFD,0x0000, 0xFBC0,0x8AFE,0x0000,
+0xFBC0,0x8AFF,0x0000 };
+
+static uint16 page00Bdata[]= { /* 0B00 (3 weights per char) */
+0xFBC0,0x8B00,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8B04,0x0000, 0x165D,0x0000,0x0000,
+0x165E,0x0000,0x0000, 0x165F,0x0000,0x0000, 0x1660,0x0000,0x0000,
+0x1661,0x0000,0x0000, 0x1662,0x0000,0x0000, 0x1663,0x0000,0x0000,
+0x1665,0x0000,0x0000, 0xFBC0,0x8B0D,0x0000, 0xFBC0,0x8B0E,0x0000,
+0x1667,0x0000,0x0000, 0x1668,0x0000,0x0000, 0xFBC0,0x8B11,0x0000,
+0xFBC0,0x8B12,0x0000, 0x1669,0x0000,0x0000, 0x166A,0x0000,0x0000,
+0x166B,0x0000,0x0000, 0x166C,0x0000,0x0000, 0x166D,0x0000,0x0000,
+0x166E,0x0000,0x0000, 0x166F,0x0000,0x0000, 0x1670,0x0000,0x0000,
+0x1671,0x0000,0x0000, 0x1672,0x0000,0x0000, 0x1673,0x0000,0x0000,
+0x1674,0x0000,0x0000, 0x1675,0x0000,0x0000, 0x1676,0x0000,0x0000,
+0x1677,0x0000,0x0000, 0x1678,0x0000,0x0000, 0x1679,0x0000,0x0000,
+0x167A,0x0000,0x0000, 0x167B,0x0000,0x0000, 0x167C,0x0000,0x0000,
+0x167D,0x0000,0x0000, 0x167E,0x0000,0x0000, 0xFBC0,0x8B29,0x0000,
+0x167F,0x0000,0x0000, 0x1680,0x0000,0x0000, 0x1681,0x0000,0x0000,
+0x1682,0x0000,0x0000, 0x1683,0x0000,0x0000, 0x1684,0x0000,0x0000,
+0x1686,0x0000,0x0000, 0xFBC0,0x8B31,0x0000, 0x1687,0x0000,0x0000,
+0x1688,0x0000,0x0000, 0xFBC0,0x8B34,0x0000, 0x1689,0x0000,0x0000,
+0x168B,0x0000,0x0000, 0x168C,0x0000,0x0000, 0x168D,0x0000,0x0000,
+0x168E,0x0000,0x0000, 0xFBC0,0x8B3A,0x0000, 0xFBC0,0x8B3B,0x0000,
+0x0000,0x0000,0x0000, 0x168F,0x0000,0x0000, 0x1690,0x0000,0x0000,
+0x1691,0x0000,0x0000, 0x1692,0x0000,0x0000, 0x1693,0x0000,0x0000,
+0x1694,0x0000,0x0000, 0x1695,0x0000,0x0000, 0xFBC0,0x8B44,0x0000,
+0xFBC0,0x8B45,0x0000, 0xFBC0,0x8B46,0x0000, 0x1696,0x0000,0x0000,
+0x1697,0x0000,0x0000, 0xFBC0,0x8B49,0x0000, 0xFBC0,0x8B4A,0x0000,
+0x1698,0x0000,0x0000, 0x1699,0x0000,0x0000, 0x169A,0x0000,0x0000,
+0xFBC0,0x8B4E,0x0000, 0xFBC0,0x8B4F,0x0000, 0xFBC0,0x8B50,0x0000,
+0xFBC0,0x8B51,0x0000, 0xFBC0,0x8B52,0x0000, 0xFBC0,0x8B53,0x0000,
+0xFBC0,0x8B54,0x0000, 0xFBC0,0x8B55,0x0000, 0x169B,0x0000,0x0000,
+0x169C,0x0000,0x0000, 0xFBC0,0x8B58,0x0000, 0xFBC0,0x8B59,0x0000,
+0xFBC0,0x8B5A,0x0000, 0xFBC0,0x8B5B,0x0000, 0x1677,0x0000,0x0000,
+0x1678,0x0000,0x0000, 0xFBC0,0x8B5E,0x0000, 0x1685,0x0000,0x0000,
+0x1664,0x0000,0x0000, 0x1666,0x0000,0x0000, 0xFBC0,0x8B62,0x0000,
+0xFBC0,0x8B63,0x0000, 0xFBC0,0x8B64,0x0000, 0xFBC0,0x8B65,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0x0351,0x0000,0x0000, 0x168A,0x0000,0x0000,
+0xFBC0,0x8B72,0x0000, 0xFBC0,0x8B73,0x0000, 0xFBC0,0x8B74,0x0000,
+0xFBC0,0x8B75,0x0000, 0xFBC0,0x8B76,0x0000, 0xFBC0,0x8B77,0x0000,
+0xFBC0,0x8B78,0x0000, 0xFBC0,0x8B79,0x0000, 0xFBC0,0x8B7A,0x0000,
+0xFBC0,0x8B7B,0x0000, 0xFBC0,0x8B7C,0x0000, 0xFBC0,0x8B7D,0x0000,
+0xFBC0,0x8B7E,0x0000, 0xFBC0,0x8B7F,0x0000, 0xFBC0,0x8B80,0x0000,
+0xFBC0,0x8B81,0x0000, 0x0000,0x0000,0x0000, 0x169D,0x0000,0x0000,
+0xFBC0,0x8B84,0x0000, 0x169E,0x0000,0x0000, 0x169F,0x0000,0x0000,
+0x16A0,0x0000,0x0000, 0x16A1,0x0000,0x0000, 0x16A2,0x0000,0x0000,
+0x16A3,0x0000,0x0000, 0xFBC0,0x8B8B,0x0000, 0xFBC0,0x8B8C,0x0000,
+0xFBC0,0x8B8D,0x0000, 0x16A4,0x0000,0x0000, 0x16A5,0x0000,0x0000,
+0x16A6,0x0000,0x0000, 0xFBC0,0x8B91,0x0000, 0x16A7,0x0000,0x0000,
+0x16A8,0x0000,0x0000, 0x16A9,0x0000,0x0000, 0x16AA,0x0000,0x0000,
+0xFBC0,0x8B96,0x0000, 0xFBC0,0x8B97,0x0000, 0xFBC0,0x8B98,0x0000,
+0x16AB,0x0000,0x0000, 0x16AC,0x0000,0x0000, 0xFBC0,0x8B9B,0x0000,
+0x16AD,0x0000,0x0000, 0xFBC0,0x8B9D,0x0000, 0x16AE,0x0000,0x0000,
+0x16AF,0x0000,0x0000, 0xFBC0,0x8BA0,0x0000, 0xFBC0,0x8BA1,0x0000,
+0xFBC0,0x8BA2,0x0000, 0x16B0,0x0000,0x0000, 0x16B1,0x0000,0x0000,
+0xFBC0,0x8BA5,0x0000, 0xFBC0,0x8BA6,0x0000, 0xFBC0,0x8BA7,0x0000,
+0x16B2,0x0000,0x0000, 0x16B3,0x0000,0x0000, 0x16B4,0x0000,0x0000,
+0xFBC0,0x8BAB,0x0000, 0xFBC0,0x8BAC,0x0000, 0xFBC0,0x8BAD,0x0000,
+0x16B5,0x0000,0x0000, 0x16B6,0x0000,0x0000, 0x16B7,0x0000,0x0000,
+0x16B8,0x0000,0x0000, 0x16B9,0x0000,0x0000, 0x16BA,0x0000,0x0000,
+0x16BB,0x0000,0x0000, 0x16BC,0x0000,0x0000, 0xFBC0,0x8BB6,0x0000,
+0x16BD,0x0000,0x0000, 0x16BE,0x0000,0x0000, 0x16BF,0x0000,0x0000,
+0xFBC0,0x8BBA,0x0000, 0xFBC0,0x8BBB,0x0000, 0xFBC0,0x8BBC,0x0000,
+0xFBC0,0x8BBD,0x0000, 0x16C0,0x0000,0x0000, 0x16C1,0x0000,0x0000,
+0x16C2,0x0000,0x0000, 0x16C3,0x0000,0x0000, 0x16C4,0x0000,0x0000,
+0xFBC0,0x8BC3,0x0000, 0xFBC0,0x8BC4,0x0000, 0xFBC0,0x8BC5,0x0000,
+0x16C5,0x0000,0x0000, 0x16C6,0x0000,0x0000, 0x16C7,0x0000,0x0000,
+0xFBC0,0x8BC9,0x0000, 0x16C8,0x0000,0x0000, 0x16C9,0x0000,0x0000,
+0x16CA,0x0000,0x0000, 0x16CB,0x0000,0x0000, 0xFBC0,0x8BCE,0x0000,
+0xFBC0,0x8BCF,0x0000, 0xFBC0,0x8BD0,0x0000, 0xFBC0,0x8BD1,0x0000,
+0xFBC0,0x8BD2,0x0000, 0xFBC0,0x8BD3,0x0000, 0xFBC0,0x8BD4,0x0000,
+0xFBC0,0x8BD5,0x0000, 0xFBC0,0x8BD6,0x0000, 0x16CC,0x0000,0x0000,
+0xFBC0,0x8BD8,0x0000, 0xFBC0,0x8BD9,0x0000, 0xFBC0,0x8BDA,0x0000,
+0xFBC0,0x8BDB,0x0000, 0xFBC0,0x8BDC,0x0000, 0xFBC0,0x8BDD,0x0000,
+0xFBC0,0x8BDE,0x0000, 0xFBC0,0x8BDF,0x0000, 0xFBC0,0x8BE0,0x0000,
+0xFBC0,0x8BE1,0x0000, 0xFBC0,0x8BE2,0x0000, 0xFBC0,0x8BE3,0x0000,
+0xFBC0,0x8BE4,0x0000, 0xFBC0,0x8BE5,0x0000, 0xFBC0,0x8BE6,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x0DC9,0x0000,0x0000, 0x0DCA,0x0000,0x0000, 0x0DCB,0x0000,0x0000,
+0x0352,0x0000,0x0000, 0x0353,0x0000,0x0000, 0x0354,0x0000,0x0000,
+0x0355,0x0000,0x0000, 0x0356,0x0000,0x0000, 0x0357,0x0000,0x0000,
+0x0E15,0x0000,0x0000, 0x0358,0x0000,0x0000, 0xFBC0,0x8BFB,0x0000,
+0xFBC0,0x8BFC,0x0000, 0xFBC0,0x8BFD,0x0000, 0xFBC0,0x8BFE,0x0000,
+0xFBC0,0x8BFF,0x0000 };
+
+static uint16 page00Cdata[]= { /* 0C00 (3 weights per char) */
+0xFBC0,0x8C00,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8C04,0x0000, 0x16CD,0x0000,0x0000,
+0x16CE,0x0000,0x0000, 0x16CF,0x0000,0x0000, 0x16D0,0x0000,0x0000,
+0x16D1,0x0000,0x0000, 0x16D2,0x0000,0x0000, 0x16D3,0x0000,0x0000,
+0x16D5,0x0000,0x0000, 0xFBC0,0x8C0D,0x0000, 0x16D7,0x0000,0x0000,
+0x16D8,0x0000,0x0000, 0x16D9,0x0000,0x0000, 0xFBC0,0x8C11,0x0000,
+0x16DA,0x0000,0x0000, 0x16DB,0x0000,0x0000, 0x16DC,0x0000,0x0000,
+0x16DD,0x0000,0x0000, 0x16DE,0x0000,0x0000, 0x16DF,0x0000,0x0000,
+0x16E0,0x0000,0x0000, 0x16E1,0x0000,0x0000, 0x16E2,0x0000,0x0000,
+0x16E3,0x0000,0x0000, 0x16E4,0x0000,0x0000, 0x16E5,0x0000,0x0000,
+0x16E6,0x0000,0x0000, 0x16E7,0x0000,0x0000, 0x16E8,0x0000,0x0000,
+0x16E9,0x0000,0x0000, 0x16EA,0x0000,0x0000, 0x16EB,0x0000,0x0000,
+0x16EC,0x0000,0x0000, 0x16ED,0x0000,0x0000, 0x16EE,0x0000,0x0000,
+0x16EF,0x0000,0x0000, 0x16F0,0x0000,0x0000, 0xFBC0,0x8C29,0x0000,
+0x16F1,0x0000,0x0000, 0x16F2,0x0000,0x0000, 0x16F3,0x0000,0x0000,
+0x16F4,0x0000,0x0000, 0x16F5,0x0000,0x0000, 0x16F6,0x0000,0x0000,
+0x16F7,0x0000,0x0000, 0x16F8,0x0000,0x0000, 0x16F9,0x0000,0x0000,
+0x16FA,0x0000,0x0000, 0xFBC0,0x8C34,0x0000, 0x16FB,0x0000,0x0000,
+0x16FC,0x0000,0x0000, 0x16FD,0x0000,0x0000, 0x16FE,0x0000,0x0000,
+0x16FF,0x0000,0x0000, 0xFBC0,0x8C3A,0x0000, 0xFBC0,0x8C3B,0x0000,
+0xFBC0,0x8C3C,0x0000, 0xFBC0,0x8C3D,0x0000, 0x1700,0x0000,0x0000,
+0x1701,0x0000,0x0000, 0x1702,0x0000,0x0000, 0x1703,0x0000,0x0000,
+0x1704,0x0000,0x0000, 0x1705,0x0000,0x0000, 0x1706,0x0000,0x0000,
+0xFBC0,0x8C45,0x0000, 0x1707,0x0000,0x0000, 0x1708,0x0000,0x0000,
+0x1709,0x0000,0x0000, 0xFBC0,0x8C49,0x0000, 0x170A,0x0000,0x0000,
+0x170B,0x0000,0x0000, 0x170C,0x0000,0x0000, 0x170D,0x0000,0x0000,
+0xFBC0,0x8C4E,0x0000, 0xFBC0,0x8C4F,0x0000, 0xFBC0,0x8C50,0x0000,
+0xFBC0,0x8C51,0x0000, 0xFBC0,0x8C52,0x0000, 0xFBC0,0x8C53,0x0000,
+0xFBC0,0x8C54,0x0000, 0x170E,0x0000,0x0000, 0x170F,0x0000,0x0000,
+0xFBC0,0x8C57,0x0000, 0xFBC0,0x8C58,0x0000, 0xFBC0,0x8C59,0x0000,
+0xFBC0,0x8C5A,0x0000, 0xFBC0,0x8C5B,0x0000, 0xFBC0,0x8C5C,0x0000,
+0xFBC0,0x8C5D,0x0000, 0xFBC0,0x8C5E,0x0000, 0xFBC0,0x8C5F,0x0000,
+0x16D4,0x0000,0x0000, 0x16D6,0x0000,0x0000, 0xFBC0,0x8C62,0x0000,
+0xFBC0,0x8C63,0x0000, 0xFBC0,0x8C64,0x0000, 0xFBC0,0x8C65,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0xFBC0,0x8C70,0x0000, 0xFBC0,0x8C71,0x0000,
+0xFBC0,0x8C72,0x0000, 0xFBC0,0x8C73,0x0000, 0xFBC0,0x8C74,0x0000,
+0xFBC0,0x8C75,0x0000, 0xFBC0,0x8C76,0x0000, 0xFBC0,0x8C77,0x0000,
+0xFBC0,0x8C78,0x0000, 0xFBC0,0x8C79,0x0000, 0xFBC0,0x8C7A,0x0000,
+0xFBC0,0x8C7B,0x0000, 0xFBC0,0x8C7C,0x0000, 0xFBC0,0x8C7D,0x0000,
+0xFBC0,0x8C7E,0x0000, 0xFBC0,0x8C7F,0x0000, 0xFBC0,0x8C80,0x0000,
+0xFBC0,0x8C81,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x8C84,0x0000, 0x1710,0x0000,0x0000, 0x1711,0x0000,0x0000,
+0x1712,0x0000,0x0000, 0x1713,0x0000,0x0000, 0x1714,0x0000,0x0000,
+0x1715,0x0000,0x0000, 0x1716,0x0000,0x0000, 0x1718,0x0000,0x0000,
+0xFBC0,0x8C8D,0x0000, 0x171A,0x0000,0x0000, 0x171B,0x0000,0x0000,
+0x171C,0x0000,0x0000, 0xFBC0,0x8C91,0x0000, 0x171D,0x0000,0x0000,
+0x171E,0x0000,0x0000, 0x171F,0x0000,0x0000, 0x1720,0x0000,0x0000,
+0x1721,0x0000,0x0000, 0x1722,0x0000,0x0000, 0x1723,0x0000,0x0000,
+0x1724,0x0000,0x0000, 0x1725,0x0000,0x0000, 0x1726,0x0000,0x0000,
+0x1727,0x0000,0x0000, 0x1728,0x0000,0x0000, 0x1729,0x0000,0x0000,
+0x172A,0x0000,0x0000, 0x172B,0x0000,0x0000, 0x172C,0x0000,0x0000,
+0x172D,0x0000,0x0000, 0x172E,0x0000,0x0000, 0x172F,0x0000,0x0000,
+0x1730,0x0000,0x0000, 0x1731,0x0000,0x0000, 0x1732,0x0000,0x0000,
+0x1733,0x0000,0x0000, 0xFBC0,0x8CA9,0x0000, 0x1734,0x0000,0x0000,
+0x1735,0x0000,0x0000, 0x1736,0x0000,0x0000, 0x1737,0x0000,0x0000,
+0x1738,0x0000,0x0000, 0x1739,0x0000,0x0000, 0x173A,0x0000,0x0000,
+0x173B,0x0000,0x0000, 0x173C,0x0000,0x0000, 0x1743,0x0000,0x0000,
+0xFBC0,0x8CB4,0x0000, 0x173D,0x0000,0x0000, 0x173E,0x0000,0x0000,
+0x173F,0x0000,0x0000, 0x1740,0x0000,0x0000, 0x1741,0x0000,0x0000,
+0xFBC0,0x8CBA,0x0000, 0xFBC0,0x8CBB,0x0000, 0x0000,0x0000,0x0000,
+0x1742,0x0000,0x0000, 0x1745,0x0000,0x0000, 0x1746,0x0000,0x0000,
+0x1747,0x0000,0x0000, 0x1748,0x0000,0x0000, 0x1749,0x0000,0x0000,
+0x174A,0x0000,0x0000, 0x174B,0x0000,0x0000, 0xFBC0,0x8CC5,0x0000,
+0x174C,0x0000,0x0000, 0x174D,0x0000,0x0000, 0x174E,0x0000,0x0000,
+0xFBC0,0x8CC9,0x0000, 0x174F,0x0000,0x0000, 0x1750,0x0000,0x0000,
+0x1751,0x0000,0x0000, 0x1752,0x0000,0x0000, 0xFBC0,0x8CCE,0x0000,
+0xFBC0,0x8CCF,0x0000, 0xFBC0,0x8CD0,0x0000, 0xFBC0,0x8CD1,0x0000,
+0xFBC0,0x8CD2,0x0000, 0xFBC0,0x8CD3,0x0000, 0xFBC0,0x8CD4,0x0000,
+0x1753,0x0000,0x0000, 0x1754,0x0000,0x0000, 0xFBC0,0x8CD7,0x0000,
+0xFBC0,0x8CD8,0x0000, 0xFBC0,0x8CD9,0x0000, 0xFBC0,0x8CDA,0x0000,
+0xFBC0,0x8CDB,0x0000, 0xFBC0,0x8CDC,0x0000, 0xFBC0,0x8CDD,0x0000,
+0x1744,0x0000,0x0000, 0xFBC0,0x8CDF,0x0000, 0x1717,0x0000,0x0000,
+0x1719,0x0000,0x0000, 0xFBC0,0x8CE2,0x0000, 0xFBC0,0x8CE3,0x0000,
+0xFBC0,0x8CE4,0x0000, 0xFBC0,0x8CE5,0x0000, 0x0E29,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0xFBC0,0x8CF0,0x0000, 0xFBC0,0x8CF1,0x0000, 0xFBC0,0x8CF2,0x0000,
+0xFBC0,0x8CF3,0x0000, 0xFBC0,0x8CF4,0x0000, 0xFBC0,0x8CF5,0x0000,
+0xFBC0,0x8CF6,0x0000, 0xFBC0,0x8CF7,0x0000, 0xFBC0,0x8CF8,0x0000,
+0xFBC0,0x8CF9,0x0000, 0xFBC0,0x8CFA,0x0000, 0xFBC0,0x8CFB,0x0000,
+0xFBC0,0x8CFC,0x0000, 0xFBC0,0x8CFD,0x0000, 0xFBC0,0x8CFE,0x0000,
+0xFBC0,0x8CFF,0x0000 };
+
+static uint16 page00Ddata[]= { /* 0D00 (3 weights per char) */
+0xFBC0,0x8D00,0x0000, 0xFBC0,0x8D01,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8D04,0x0000, 0x1755,0x0000,0x0000,
+0x1756,0x0000,0x0000, 0x1757,0x0000,0x0000, 0x1758,0x0000,0x0000,
+0x1759,0x0000,0x0000, 0x175A,0x0000,0x0000, 0x175B,0x0000,0x0000,
+0x175D,0x0000,0x0000, 0xFBC0,0x8D0D,0x0000, 0x175F,0x0000,0x0000,
+0x1760,0x0000,0x0000, 0x1761,0x0000,0x0000, 0xFBC0,0x8D11,0x0000,
+0x1762,0x0000,0x0000, 0x1763,0x0000,0x0000, 0x1764,0x0000,0x0000,
+0x1765,0x0000,0x0000, 0x1766,0x0000,0x0000, 0x1767,0x0000,0x0000,
+0x1768,0x0000,0x0000, 0x1769,0x0000,0x0000, 0x176A,0x0000,0x0000,
+0x176B,0x0000,0x0000, 0x176C,0x0000,0x0000, 0x176D,0x0000,0x0000,
+0x176E,0x0000,0x0000, 0x176F,0x0000,0x0000, 0x1770,0x0000,0x0000,
+0x1771,0x0000,0x0000, 0x1772,0x0000,0x0000, 0x1773,0x0000,0x0000,
+0x1774,0x0000,0x0000, 0x1775,0x0000,0x0000, 0x1776,0x0000,0x0000,
+0x1777,0x0000,0x0000, 0x1778,0x0000,0x0000, 0xFBC0,0x8D29,0x0000,
+0x1779,0x0000,0x0000, 0x177A,0x0000,0x0000, 0x177B,0x0000,0x0000,
+0x177C,0x0000,0x0000, 0x177D,0x0000,0x0000, 0x177E,0x0000,0x0000,
+0x177F,0x0000,0x0000, 0x1780,0x0000,0x0000, 0x1781,0x0000,0x0000,
+0x1782,0x0000,0x0000, 0x1783,0x0000,0x0000, 0x1784,0x0000,0x0000,
+0x1785,0x0000,0x0000, 0x1786,0x0000,0x0000, 0x1787,0x0000,0x0000,
+0x1788,0x0000,0x0000, 0xFBC0,0x8D3A,0x0000, 0xFBC0,0x8D3B,0x0000,
+0xFBC0,0x8D3C,0x0000, 0xFBC0,0x8D3D,0x0000, 0x1789,0x0000,0x0000,
+0x178A,0x0000,0x0000, 0x178B,0x0000,0x0000, 0x178C,0x0000,0x0000,
+0x178D,0x0000,0x0000, 0x178E,0x0000,0x0000, 0xFBC0,0x8D44,0x0000,
+0xFBC0,0x8D45,0x0000, 0x178F,0x0000,0x0000, 0x1790,0x0000,0x0000,
+0x1791,0x0000,0x0000, 0xFBC0,0x8D49,0x0000, 0x1792,0x0000,0x0000,
+0x1793,0x0000,0x0000, 0x1794,0x0000,0x0000, 0x1795,0x0000,0x0000,
+0xFBC0,0x8D4E,0x0000, 0xFBC0,0x8D4F,0x0000, 0xFBC0,0x8D50,0x0000,
+0xFBC0,0x8D51,0x0000, 0xFBC0,0x8D52,0x0000, 0xFBC0,0x8D53,0x0000,
+0xFBC0,0x8D54,0x0000, 0xFBC0,0x8D55,0x0000, 0xFBC0,0x8D56,0x0000,
+0x1796,0x0000,0x0000, 0xFBC0,0x8D58,0x0000, 0xFBC0,0x8D59,0x0000,
+0xFBC0,0x8D5A,0x0000, 0xFBC0,0x8D5B,0x0000, 0xFBC0,0x8D5C,0x0000,
+0xFBC0,0x8D5D,0x0000, 0xFBC0,0x8D5E,0x0000, 0xFBC0,0x8D5F,0x0000,
+0x175C,0x0000,0x0000, 0x175E,0x0000,0x0000, 0xFBC0,0x8D62,0x0000,
+0xFBC0,0x8D63,0x0000, 0xFBC0,0x8D64,0x0000, 0xFBC0,0x8D65,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0xFBC0,0x8D70,0x0000, 0xFBC0,0x8D71,0x0000,
+0xFBC0,0x8D72,0x0000, 0xFBC0,0x8D73,0x0000, 0xFBC0,0x8D74,0x0000,
+0xFBC0,0x8D75,0x0000, 0xFBC0,0x8D76,0x0000, 0xFBC0,0x8D77,0x0000,
+0xFBC0,0x8D78,0x0000, 0xFBC0,0x8D79,0x0000, 0xFBC0,0x8D7A,0x0000,
+0xFBC0,0x8D7B,0x0000, 0xFBC0,0x8D7C,0x0000, 0xFBC0,0x8D7D,0x0000,
+0xFBC0,0x8D7E,0x0000, 0xFBC0,0x8D7F,0x0000, 0xFBC0,0x8D80,0x0000,
+0xFBC0,0x8D81,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x8D84,0x0000, 0x1797,0x0000,0x0000, 0x1798,0x0000,0x0000,
+0x1799,0x0000,0x0000, 0x179A,0x0000,0x0000, 0x179B,0x0000,0x0000,
+0x179C,0x0000,0x0000, 0x179D,0x0000,0x0000, 0x179E,0x0000,0x0000,
+0x179F,0x0000,0x0000, 0x17A0,0x0000,0x0000, 0x17A1,0x0000,0x0000,
+0x17A2,0x0000,0x0000, 0x17A3,0x0000,0x0000, 0x17A4,0x0000,0x0000,
+0x17A5,0x0000,0x0000, 0x17A6,0x0000,0x0000, 0x17A7,0x0000,0x0000,
+0x17A8,0x0000,0x0000, 0xFBC0,0x8D97,0x0000, 0xFBC0,0x8D98,0x0000,
+0xFBC0,0x8D99,0x0000, 0x17A9,0x0000,0x0000, 0x17AA,0x0000,0x0000,
+0x17AB,0x0000,0x0000, 0x17AC,0x0000,0x0000, 0x17AD,0x0000,0x0000,
+0x17AE,0x0000,0x0000, 0x17AF,0x0000,0x0000, 0x17B0,0x0000,0x0000,
+0x17B1,0x0000,0x0000, 0x17B2,0x0000,0x0000, 0x17B3,0x0000,0x0000,
+0x17B4,0x0000,0x0000, 0x17B5,0x0000,0x0000, 0x17B6,0x0000,0x0000,
+0x17B7,0x0000,0x0000, 0x17B8,0x0000,0x0000, 0x17B9,0x0000,0x0000,
+0x17BA,0x0000,0x0000, 0x17BB,0x0000,0x0000, 0x17BC,0x0000,0x0000,
+0x17BD,0x0000,0x0000, 0x17BE,0x0000,0x0000, 0x17BF,0x0000,0x0000,
+0x17C0,0x0000,0x0000, 0xFBC0,0x8DB2,0x0000, 0x17C1,0x0000,0x0000,
+0x17C2,0x0000,0x0000, 0x17C3,0x0000,0x0000, 0x17C4,0x0000,0x0000,
+0x17C5,0x0000,0x0000, 0x17C6,0x0000,0x0000, 0x17C7,0x0000,0x0000,
+0x17C8,0x0000,0x0000, 0x17C9,0x0000,0x0000, 0xFBC0,0x8DBC,0x0000,
+0x17CA,0x0000,0x0000, 0xFBC0,0x8DBE,0x0000, 0xFBC0,0x8DBF,0x0000,
+0x17CB,0x0000,0x0000, 0x17CC,0x0000,0x0000, 0x17CD,0x0000,0x0000,
+0x17CE,0x0000,0x0000, 0x17CF,0x0000,0x0000, 0x17D0,0x0000,0x0000,
+0x17D1,0x0000,0x0000, 0xFBC0,0x8DC7,0x0000, 0xFBC0,0x8DC8,0x0000,
+0xFBC0,0x8DC9,0x0000, 0x17D2,0x0000,0x0000, 0xFBC0,0x8DCB,0x0000,
+0xFBC0,0x8DCC,0x0000, 0xFBC0,0x8DCD,0x0000, 0xFBC0,0x8DCE,0x0000,
+0x17D3,0x0000,0x0000, 0x17D4,0x0000,0x0000, 0x17D5,0x0000,0x0000,
+0x17D6,0x0000,0x0000, 0x17D7,0x0000,0x0000, 0x17D8,0x0000,0x0000,
+0xFBC0,0x8DD5,0x0000, 0x17D9,0x0000,0x0000, 0xFBC0,0x8DD7,0x0000,
+0x17DA,0x0000,0x0000, 0x17DB,0x0000,0x0000, 0x17DC,0x0000,0x0000,
+0x17DD,0x0000,0x0000, 0x17DE,0x0000,0x0000, 0x17DF,0x0000,0x0000,
+0x17E0,0x0000,0x0000, 0x17E1,0x0000,0x0000, 0xFBC0,0x8DE0,0x0000,
+0xFBC0,0x8DE1,0x0000, 0xFBC0,0x8DE2,0x0000, 0xFBC0,0x8DE3,0x0000,
+0xFBC0,0x8DE4,0x0000, 0xFBC0,0x8DE5,0x0000, 0xFBC0,0x8DE6,0x0000,
+0xFBC0,0x8DE7,0x0000, 0xFBC0,0x8DE8,0x0000, 0xFBC0,0x8DE9,0x0000,
+0xFBC0,0x8DEA,0x0000, 0xFBC0,0x8DEB,0x0000, 0xFBC0,0x8DEC,0x0000,
+0xFBC0,0x8DED,0x0000, 0xFBC0,0x8DEE,0x0000, 0xFBC0,0x8DEF,0x0000,
+0xFBC0,0x8DF0,0x0000, 0xFBC0,0x8DF1,0x0000, 0x17E2,0x0000,0x0000,
+0x17E3,0x0000,0x0000, 0x02FB,0x0000,0x0000, 0xFBC0,0x8DF5,0x0000,
+0xFBC0,0x8DF6,0x0000, 0xFBC0,0x8DF7,0x0000, 0xFBC0,0x8DF8,0x0000,
+0xFBC0,0x8DF9,0x0000, 0xFBC0,0x8DFA,0x0000, 0xFBC0,0x8DFB,0x0000,
+0xFBC0,0x8DFC,0x0000, 0xFBC0,0x8DFD,0x0000, 0xFBC0,0x8DFE,0x0000,
+0xFBC0,0x8DFF,0x0000 };
+
+static uint16 page00Edata[]= { /* 0E00 (3 weights per char) */
+0xFBC0,0x8E00,0x0000, 0x17E4,0x0000,0x0000, 0x17E5,0x0000,0x0000,
+0x17E6,0x0000,0x0000, 0x17E7,0x0000,0x0000, 0x17E8,0x0000,0x0000,
+0x17E9,0x0000,0x0000, 0x17EA,0x0000,0x0000, 0x17EB,0x0000,0x0000,
+0x17EC,0x0000,0x0000, 0x17ED,0x0000,0x0000, 0x17EE,0x0000,0x0000,
+0x17EF,0x0000,0x0000, 0x17F0,0x0000,0x0000, 0x17F1,0x0000,0x0000,
+0x17F2,0x0000,0x0000, 0x17F3,0x0000,0x0000, 0x17F4,0x0000,0x0000,
+0x17F5,0x0000,0x0000, 0x17F6,0x0000,0x0000, 0x17F7,0x0000,0x0000,
+0x17F8,0x0000,0x0000, 0x17F9,0x0000,0x0000, 0x17FA,0x0000,0x0000,
+0x17FB,0x0000,0x0000, 0x17FC,0x0000,0x0000, 0x17FD,0x0000,0x0000,
+0x17FE,0x0000,0x0000, 0x17FF,0x0000,0x0000, 0x1800,0x0000,0x0000,
+0x1801,0x0000,0x0000, 0x1802,0x0000,0x0000, 0x1803,0x0000,0x0000,
+0x1804,0x0000,0x0000, 0x1805,0x0000,0x0000, 0x1806,0x0000,0x0000,
+0x1807,0x0000,0x0000, 0x1808,0x0000,0x0000, 0x1809,0x0000,0x0000,
+0x180A,0x0000,0x0000, 0x180B,0x0000,0x0000, 0x180C,0x0000,0x0000,
+0x180D,0x0000,0x0000, 0x180E,0x0000,0x0000, 0x180F,0x0000,0x0000,
+0x1810,0x0000,0x0000, 0x1811,0x0000,0x0000, 0x1812,0x0000,0x0000,
+0x1813,0x0000,0x0000, 0x1814,0x0000,0x0000, 0x1815,0x0000,0x0000,
+0x1816,0x0000,0x0000, 0x1817,0x0000,0x0000, 0x1818,0x0000,0x0000,
+0x1819,0x0000,0x0000, 0x181A,0x0000,0x0000, 0x181B,0x0000,0x0000,
+0x181C,0x0000,0x0000, 0x181D,0x0000,0x0000, 0xFBC0,0x8E3B,0x0000,
+0xFBC0,0x8E3C,0x0000, 0xFBC0,0x8E3D,0x0000, 0xFBC0,0x8E3E,0x0000,
+0x0E16,0x0000,0x0000, 0x181E,0x0000,0x0000, 0x181F,0x0000,0x0000,
+0x1820,0x0000,0x0000, 0x1821,0x0000,0x0000, 0x1822,0x0000,0x0000,
+0x1823,0x0000,0x0000, 0x0E03,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x1824,0x0000,0x0000, 0x1825,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0359,0x0000,0x0000, 0x0E29,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x02FC,0x0000,0x0000, 0x02FD,0x0000,0x0000, 0xFBC0,0x8E5C,0x0000,
+0xFBC0,0x8E5D,0x0000, 0xFBC0,0x8E5E,0x0000, 0xFBC0,0x8E5F,0x0000,
+0xFBC0,0x8E60,0x0000, 0xFBC0,0x8E61,0x0000, 0xFBC0,0x8E62,0x0000,
+0xFBC0,0x8E63,0x0000, 0xFBC0,0x8E64,0x0000, 0xFBC0,0x8E65,0x0000,
+0xFBC0,0x8E66,0x0000, 0xFBC0,0x8E67,0x0000, 0xFBC0,0x8E68,0x0000,
+0xFBC0,0x8E69,0x0000, 0xFBC0,0x8E6A,0x0000, 0xFBC0,0x8E6B,0x0000,
+0xFBC0,0x8E6C,0x0000, 0xFBC0,0x8E6D,0x0000, 0xFBC0,0x8E6E,0x0000,
+0xFBC0,0x8E6F,0x0000, 0xFBC0,0x8E70,0x0000, 0xFBC0,0x8E71,0x0000,
+0xFBC0,0x8E72,0x0000, 0xFBC0,0x8E73,0x0000, 0xFBC0,0x8E74,0x0000,
+0xFBC0,0x8E75,0x0000, 0xFBC0,0x8E76,0x0000, 0xFBC0,0x8E77,0x0000,
+0xFBC0,0x8E78,0x0000, 0xFBC0,0x8E79,0x0000, 0xFBC0,0x8E7A,0x0000,
+0xFBC0,0x8E7B,0x0000, 0xFBC0,0x8E7C,0x0000, 0xFBC0,0x8E7D,0x0000,
+0xFBC0,0x8E7E,0x0000, 0xFBC0,0x8E7F,0x0000, 0xFBC0,0x8E80,0x0000,
+0x1826,0x0000,0x0000, 0x1827,0x0000,0x0000, 0xFBC0,0x8E83,0x0000,
+0x1828,0x0000,0x0000, 0xFBC0,0x8E85,0x0000, 0xFBC0,0x8E86,0x0000,
+0x1829,0x0000,0x0000, 0x182A,0x0000,0x0000, 0xFBC0,0x8E89,0x0000,
+0x182B,0x0000,0x0000, 0xFBC0,0x8E8B,0x0000, 0xFBC0,0x8E8C,0x0000,
+0x182C,0x0000,0x0000, 0xFBC0,0x8E8E,0x0000, 0xFBC0,0x8E8F,0x0000,
+0xFBC0,0x8E90,0x0000, 0xFBC0,0x8E91,0x0000, 0xFBC0,0x8E92,0x0000,
+0xFBC0,0x8E93,0x0000, 0x182D,0x0000,0x0000, 0x182E,0x0000,0x0000,
+0x182F,0x0000,0x0000, 0x1830,0x0000,0x0000, 0xFBC0,0x8E98,0x0000,
+0x1831,0x0000,0x0000, 0x1832,0x0000,0x0000, 0x1833,0x0000,0x0000,
+0x1834,0x0000,0x0000, 0x1835,0x0000,0x0000, 0x1836,0x0000,0x0000,
+0x1837,0x0000,0x0000, 0xFBC0,0x8EA0,0x0000, 0x1838,0x0000,0x0000,
+0x1839,0x0000,0x0000, 0x183A,0x0000,0x0000, 0xFBC0,0x8EA4,0x0000,
+0x183B,0x0000,0x0000, 0xFBC0,0x8EA6,0x0000, 0x183C,0x0000,0x0000,
+0xFBC0,0x8EA8,0x0000, 0xFBC0,0x8EA9,0x0000, 0x183D,0x0000,0x0000,
+0x183E,0x0000,0x0000, 0xFBC0,0x8EAC,0x0000, 0x183F,0x0000,0x0000,
+0x1840,0x0000,0x0000, 0x1841,0x0000,0x0000, 0x1842,0x0000,0x0000,
+0x1843,0x0000,0x0000, 0x1844,0x0000,0x0000, 0x1845,0x0000,0x0000,
+0x1846,0x0000,0x0000, 0x1847,0x0000,0x0000, 0x1848,0x0000,0x0000,
+0x1849,0x0000,0x0000, 0x184A,0x0000,0x0000, 0x184B,0x0000,0x0000,
+0xFBC0,0x8EBA,0x0000, 0x184C,0x0000,0x0000, 0x184D,0x0000,0x0000,
+0x184E,0x0000,0x0000, 0xFBC0,0x8EBE,0x0000, 0xFBC0,0x8EBF,0x0000,
+0x184F,0x0000,0x0000, 0x1850,0x0000,0x0000, 0x1851,0x0000,0x0000,
+0x1852,0x0000,0x0000, 0x1853,0x0000,0x0000, 0xFBC0,0x8EC5,0x0000,
+0x0E04,0x0000,0x0000, 0xFBC0,0x8EC7,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x1854,0x0000,0x0000, 0x1855,0x0000,0x0000, 0xFBC0,0x8ECE,0x0000,
+0xFBC0,0x8ECF,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000,
+0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000,
+0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000,
+0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0xFBC0,0x8EDA,0x0000,
+0xFBC0,0x8EDB,0x0000, 0x183E,0x1831,0x0000, 0x183E,0x1838,0x0000,
+0xFBC0,0x8EDE,0x0000, 0xFBC0,0x8EDF,0x0000, 0xFBC0,0x8EE0,0x0000,
+0xFBC0,0x8EE1,0x0000, 0xFBC0,0x8EE2,0x0000, 0xFBC0,0x8EE3,0x0000,
+0xFBC0,0x8EE4,0x0000, 0xFBC0,0x8EE5,0x0000, 0xFBC0,0x8EE6,0x0000,
+0xFBC0,0x8EE7,0x0000, 0xFBC0,0x8EE8,0x0000, 0xFBC0,0x8EE9,0x0000,
+0xFBC0,0x8EEA,0x0000, 0xFBC0,0x8EEB,0x0000, 0xFBC0,0x8EEC,0x0000,
+0xFBC0,0x8EED,0x0000, 0xFBC0,0x8EEE,0x0000, 0xFBC0,0x8EEF,0x0000,
+0xFBC0,0x8EF0,0x0000, 0xFBC0,0x8EF1,0x0000, 0xFBC0,0x8EF2,0x0000,
+0xFBC0,0x8EF3,0x0000, 0xFBC0,0x8EF4,0x0000, 0xFBC0,0x8EF5,0x0000,
+0xFBC0,0x8EF6,0x0000, 0xFBC0,0x8EF7,0x0000, 0xFBC0,0x8EF8,0x0000,
+0xFBC0,0x8EF9,0x0000, 0xFBC0,0x8EFA,0x0000, 0xFBC0,0x8EFB,0x0000,
+0xFBC0,0x8EFC,0x0000, 0xFBC0,0x8EFD,0x0000, 0xFBC0,0x8EFE,0x0000,
+0xFBC0,0x8EFF,0x0000 };
+
+static uint16 page00Fdata[]= { /* 0F00 (3 weights per char) */
+0x189A,0x18AD,0x0000, 0x035A,0x0000,0x0000, 0x035B,0x0000,0x0000,
+0x035C,0x0000,0x0000, 0x02FE,0x0000,0x0000, 0x02FF,0x0000,0x0000,
+0x0300,0x0000,0x0000, 0x0301,0x0000,0x0000, 0x0302,0x0000,0x0000,
+0x0303,0x0000,0x0000, 0x0304,0x0000,0x0000, 0x0305,0x0000,0x0000,
+0x0305,0x0000,0x0000, 0x0306,0x0000,0x0000, 0x0307,0x0000,0x0000,
+0x0308,0x0000,0x0000, 0x0309,0x0000,0x0000, 0x030A,0x0000,0x0000,
+0x030B,0x0000,0x0000, 0x035D,0x0000,0x0000, 0x024C,0x0000,0x0000,
+0x035E,0x0000,0x0000, 0x035F,0x0000,0x0000, 0x0360,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0361,0x0000,0x0000,
+0x0362,0x0000,0x0000, 0x0363,0x0000,0x0000, 0x0364,0x0000,0x0000,
+0x0365,0x0000,0x0000, 0x0366,0x0000,0x0000, 0x0E29,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x0E29,0x0000,0x0000, 0x0367,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0368,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0369,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x028E,0x0000,0x0000, 0x028F,0x0000,0x0000,
+0x0290,0x0000,0x0000, 0x0291,0x0000,0x0000, 0x036A,0x0000,0x0000,
+0x036B,0x0000,0x0000, 0x1856,0x0000,0x0000, 0x1858,0x0000,0x0000,
+0x185A,0x0000,0x0000, 0x185A,0x1899,0x0000, 0x185C,0x0000,0x0000,
+0x185E,0x0000,0x0000, 0x1860,0x0000,0x0000, 0x1862,0x0000,0x0000,
+0xFBC0,0x8F48,0x0000, 0x1864,0x0000,0x0000, 0x1866,0x0000,0x0000,
+0x1868,0x0000,0x0000, 0x186A,0x0000,0x0000, 0x186A,0x1899,0x0000,
+0x186C,0x0000,0x0000, 0x186E,0x0000,0x0000, 0x1870,0x0000,0x0000,
+0x1872,0x0000,0x0000, 0x1872,0x1899,0x0000, 0x1874,0x0000,0x0000,
+0x1876,0x0000,0x0000, 0x1878,0x0000,0x0000, 0x187A,0x0000,0x0000,
+0x187A,0x1899,0x0000, 0x187C,0x0000,0x0000, 0x187E,0x0000,0x0000,
+0x1880,0x0000,0x0000, 0x1882,0x0000,0x0000, 0x1882,0x1899,0x0000,
+0x1884,0x0000,0x0000, 0x1886,0x0000,0x0000, 0x1888,0x0000,0x0000,
+0x188A,0x0000,0x0000, 0x188C,0x0000,0x0000, 0x188E,0x0000,0x0000,
+0x1890,0x0000,0x0000, 0x1892,0x0000,0x0000, 0x1894,0x0000,0x0000,
+0x1896,0x0000,0x0000, 0x1898,0x0000,0x0000, 0x189A,0x0000,0x0000,
+0x1856,0x1895,0x0000, 0x188E,0x0000,0x0000, 0xFBC0,0x8F6B,0x0000,
+0xFBC0,0x8F6C,0x0000, 0xFBC0,0x8F6D,0x0000, 0xFBC0,0x8F6E,0x0000,
+0xFBC0,0x8F6F,0x0000, 0xFBC0,0x8F70,0x0000, 0x18A0,0x0000,0x0000,
+0x18A1,0x0000,0x0000, 0x18A2,0x0000,0x0000, 0x18A5,0x0000,0x0000,
+0x18A6,0x0000,0x0000, 0x18A7,0x0000,0x0000, 0x18A8,0x0000,0x0000,
+0x18A9,0x0000,0x0000, 0x18AA,0x0000,0x0000, 0x18AB,0x0000,0x0000,
+0x18AC,0x0000,0x0000, 0x18AD,0x0000,0x0000, 0x18AE,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x18A3,0x0000,0x0000,
+0x18A4,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x18AF,0x0000,0x0000, 0x030C,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x189C,0x0000,0x0000, 0x189D,0x0000,0x0000,
+0x189E,0x0000,0x0000, 0x189F,0x0000,0x0000, 0xFBC0,0x8F8C,0x0000,
+0xFBC0,0x8F8D,0x0000, 0xFBC0,0x8F8E,0x0000, 0xFBC0,0x8F8F,0x0000,
+0x1857,0x0000,0x0000, 0x1859,0x0000,0x0000, 0x185B,0x0000,0x0000,
+0x185B,0x1899,0x0000, 0x185D,0x0000,0x0000, 0x185F,0x0000,0x0000,
+0x1861,0x0000,0x0000, 0x1863,0x0000,0x0000, 0xFBC0,0x8F98,0x0000,
+0x1865,0x0000,0x0000, 0x1867,0x0000,0x0000, 0x1869,0x0000,0x0000,
+0x186B,0x0000,0x0000, 0x186B,0x1899,0x0000, 0x186D,0x0000,0x0000,
+0x186F,0x0000,0x0000, 0x1871,0x0000,0x0000, 0x1873,0x0000,0x0000,
+0x1873,0x1899,0x0000, 0x1875,0x0000,0x0000, 0x1877,0x0000,0x0000,
+0x1879,0x0000,0x0000, 0x187B,0x0000,0x0000, 0x187B,0x1899,0x0000,
+0x187D,0x0000,0x0000, 0x187F,0x0000,0x0000, 0x1881,0x0000,0x0000,
+0x1883,0x0000,0x0000, 0x1883,0x1899,0x0000, 0x1885,0x0000,0x0000,
+0x1887,0x0000,0x0000, 0x1889,0x0000,0x0000, 0x188B,0x0000,0x0000,
+0x188D,0x0000,0x0000, 0x188F,0x0000,0x0000, 0x1891,0x0000,0x0000,
+0x1893,0x0000,0x0000, 0x1895,0x0000,0x0000, 0x1897,0x0000,0x0000,
+0x1899,0x0000,0x0000, 0x189B,0x0000,0x0000, 0x1857,0x1895,0x0000,
+0x1885,0x0000,0x0000, 0x188D,0x0000,0x0000, 0x188F,0x0000,0x0000,
+0xFBC0,0x8FBD,0x0000, 0x036C,0x0000,0x0000, 0x036D,0x0000,0x0000,
+0x036E,0x0000,0x0000, 0x036F,0x0000,0x0000, 0x0370,0x0000,0x0000,
+0x0371,0x0000,0x0000, 0x0372,0x0000,0x0000, 0x0373,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0374,0x0000,0x0000, 0x0375,0x0000,0x0000,
+0x0376,0x0000,0x0000, 0x0377,0x0000,0x0000, 0x0378,0x0000,0x0000,
+0x0379,0x0000,0x0000, 0xFBC0,0x8FCD,0x0000, 0xFBC0,0x8FCE,0x0000,
+0x037A,0x0000,0x0000, 0xFBC0,0x8FD0,0x0000, 0xFBC0,0x8FD1,0x0000,
+0xFBC0,0x8FD2,0x0000, 0xFBC0,0x8FD3,0x0000, 0xFBC0,0x8FD4,0x0000,
+0xFBC0,0x8FD5,0x0000, 0xFBC0,0x8FD6,0x0000, 0xFBC0,0x8FD7,0x0000,
+0xFBC0,0x8FD8,0x0000, 0xFBC0,0x8FD9,0x0000, 0xFBC0,0x8FDA,0x0000,
+0xFBC0,0x8FDB,0x0000, 0xFBC0,0x8FDC,0x0000, 0xFBC0,0x8FDD,0x0000,
+0xFBC0,0x8FDE,0x0000, 0xFBC0,0x8FDF,0x0000, 0xFBC0,0x8FE0,0x0000,
+0xFBC0,0x8FE1,0x0000, 0xFBC0,0x8FE2,0x0000, 0xFBC0,0x8FE3,0x0000,
+0xFBC0,0x8FE4,0x0000, 0xFBC0,0x8FE5,0x0000, 0xFBC0,0x8FE6,0x0000,
+0xFBC0,0x8FE7,0x0000, 0xFBC0,0x8FE8,0x0000, 0xFBC0,0x8FE9,0x0000,
+0xFBC0,0x8FEA,0x0000, 0xFBC0,0x8FEB,0x0000, 0xFBC0,0x8FEC,0x0000,
+0xFBC0,0x8FED,0x0000, 0xFBC0,0x8FEE,0x0000, 0xFBC0,0x8FEF,0x0000,
+0xFBC0,0x8FF0,0x0000, 0xFBC0,0x8FF1,0x0000, 0xFBC0,0x8FF2,0x0000,
+0xFBC0,0x8FF3,0x0000, 0xFBC0,0x8FF4,0x0000, 0xFBC0,0x8FF5,0x0000,
+0xFBC0,0x8FF6,0x0000, 0xFBC0,0x8FF7,0x0000, 0xFBC0,0x8FF8,0x0000,
+0xFBC0,0x8FF9,0x0000, 0xFBC0,0x8FFA,0x0000, 0xFBC0,0x8FFB,0x0000,
+0xFBC0,0x8FFC,0x0000, 0xFBC0,0x8FFD,0x0000, 0xFBC0,0x8FFE,0x0000,
+0xFBC0,0x8FFF,0x0000 };
+
+static uint16 page010data[]= { /* 1000 (3 weights per char) */
+0x1931,0x0000,0x0000, 0x1932,0x0000,0x0000, 0x1933,0x0000,0x0000,
+0x1934,0x0000,0x0000, 0x1935,0x0000,0x0000, 0x1936,0x0000,0x0000,
+0x1937,0x0000,0x0000, 0x1938,0x0000,0x0000, 0x1939,0x0000,0x0000,
+0x193A,0x0000,0x0000, 0x193B,0x0000,0x0000, 0x193C,0x0000,0x0000,
+0x193D,0x0000,0x0000, 0x193E,0x0000,0x0000, 0x193F,0x0000,0x0000,
+0x1940,0x0000,0x0000, 0x1941,0x0000,0x0000, 0x1942,0x0000,0x0000,
+0x1943,0x0000,0x0000, 0x1944,0x0000,0x0000, 0x1945,0x0000,0x0000,
+0x1946,0x0000,0x0000, 0x1947,0x0000,0x0000, 0x1948,0x0000,0x0000,
+0x1949,0x0000,0x0000, 0x194A,0x0000,0x0000, 0x194B,0x0000,0x0000,
+0x194C,0x0000,0x0000, 0x194D,0x0000,0x0000, 0x194E,0x0000,0x0000,
+0x1951,0x0000,0x0000, 0x1952,0x0000,0x0000, 0x1953,0x0000,0x0000,
+0x1954,0x0000,0x0000, 0xFBC0,0x9022,0x0000, 0x1955,0x0000,0x0000,
+0x1956,0x0000,0x0000, 0x1957,0x0000,0x0000, 0x1958,0x0000,0x0000,
+0x1959,0x0000,0x0000, 0xFBC0,0x9028,0x0000, 0x195A,0x0000,0x0000,
+0x195B,0x0000,0x0000, 0xFBC0,0x902B,0x0000, 0x1960,0x0000,0x0000,
+0x1961,0x0000,0x0000, 0x1962,0x0000,0x0000, 0x1963,0x0000,0x0000,
+0x1964,0x0000,0x0000, 0x1965,0x0000,0x0000, 0x1966,0x0000,0x0000,
+0xFBC0,0x9033,0x0000, 0xFBC0,0x9034,0x0000, 0xFBC0,0x9035,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x196B,0x0000,0x0000, 0xFBC0,0x903A,0x0000, 0xFBC0,0x903B,0x0000,
+0xFBC0,0x903C,0x0000, 0xFBC0,0x903D,0x0000, 0xFBC0,0x903E,0x0000,
+0xFBC0,0x903F,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000,
+0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000,
+0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000,
+0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0x026C,0x0000,0x0000,
+0x026D,0x0000,0x0000, 0x030E,0x0000,0x0000, 0x030F,0x0000,0x0000,
+0x0310,0x0000,0x0000, 0x0311,0x0000,0x0000, 0x194F,0x0000,0x0000,
+0x1950,0x0000,0x0000, 0x195C,0x0000,0x0000, 0x195D,0x0000,0x0000,
+0x195E,0x0000,0x0000, 0x195F,0x0000,0x0000, 0x1967,0x0000,0x0000,
+0x1968,0x0000,0x0000, 0x1969,0x0000,0x0000, 0x196A,0x0000,0x0000,
+0xFBC0,0x905A,0x0000, 0xFBC0,0x905B,0x0000, 0xFBC0,0x905C,0x0000,
+0xFBC0,0x905D,0x0000, 0xFBC0,0x905E,0x0000, 0xFBC0,0x905F,0x0000,
+0xFBC0,0x9060,0x0000, 0xFBC0,0x9061,0x0000, 0xFBC0,0x9062,0x0000,
+0xFBC0,0x9063,0x0000, 0xFBC0,0x9064,0x0000, 0xFBC0,0x9065,0x0000,
+0xFBC0,0x9066,0x0000, 0xFBC0,0x9067,0x0000, 0xFBC0,0x9068,0x0000,
+0xFBC0,0x9069,0x0000, 0xFBC0,0x906A,0x0000, 0xFBC0,0x906B,0x0000,
+0xFBC0,0x906C,0x0000, 0xFBC0,0x906D,0x0000, 0xFBC0,0x906E,0x0000,
+0xFBC0,0x906F,0x0000, 0xFBC0,0x9070,0x0000, 0xFBC0,0x9071,0x0000,
+0xFBC0,0x9072,0x0000, 0xFBC0,0x9073,0x0000, 0xFBC0,0x9074,0x0000,
+0xFBC0,0x9075,0x0000, 0xFBC0,0x9076,0x0000, 0xFBC0,0x9077,0x0000,
+0xFBC0,0x9078,0x0000, 0xFBC0,0x9079,0x0000, 0xFBC0,0x907A,0x0000,
+0xFBC0,0x907B,0x0000, 0xFBC0,0x907C,0x0000, 0xFBC0,0x907D,0x0000,
+0xFBC0,0x907E,0x0000, 0xFBC0,0x907F,0x0000, 0xFBC0,0x9080,0x0000,
+0xFBC0,0x9081,0x0000, 0xFBC0,0x9082,0x0000, 0xFBC0,0x9083,0x0000,
+0xFBC0,0x9084,0x0000, 0xFBC0,0x9085,0x0000, 0xFBC0,0x9086,0x0000,
+0xFBC0,0x9087,0x0000, 0xFBC0,0x9088,0x0000, 0xFBC0,0x9089,0x0000,
+0xFBC0,0x908A,0x0000, 0xFBC0,0x908B,0x0000, 0xFBC0,0x908C,0x0000,
+0xFBC0,0x908D,0x0000, 0xFBC0,0x908E,0x0000, 0xFBC0,0x908F,0x0000,
+0xFBC0,0x9090,0x0000, 0xFBC0,0x9091,0x0000, 0xFBC0,0x9092,0x0000,
+0xFBC0,0x9093,0x0000, 0xFBC0,0x9094,0x0000, 0xFBC0,0x9095,0x0000,
+0xFBC0,0x9096,0x0000, 0xFBC0,0x9097,0x0000, 0xFBC0,0x9098,0x0000,
+0xFBC0,0x9099,0x0000, 0xFBC0,0x909A,0x0000, 0xFBC0,0x909B,0x0000,
+0xFBC0,0x909C,0x0000, 0xFBC0,0x909D,0x0000, 0xFBC0,0x909E,0x0000,
+0xFBC0,0x909F,0x0000, 0x12E1,0x0000,0x0000, 0x12E2,0x0000,0x0000,
+0x12E3,0x0000,0x0000, 0x12E4,0x0000,0x0000, 0x12E5,0x0000,0x0000,
+0x12E6,0x0000,0x0000, 0x12E7,0x0000,0x0000, 0x12E9,0x0000,0x0000,
+0x12EA,0x0000,0x0000, 0x12EB,0x0000,0x0000, 0x12EC,0x0000,0x0000,
+0x12ED,0x0000,0x0000, 0x12EE,0x0000,0x0000, 0x12F0,0x0000,0x0000,
+0x12F1,0x0000,0x0000, 0x12F2,0x0000,0x0000, 0x12F3,0x0000,0x0000,
+0x12F4,0x0000,0x0000, 0x12F5,0x0000,0x0000, 0x12F7,0x0000,0x0000,
+0x12F8,0x0000,0x0000, 0x12F9,0x0000,0x0000, 0x12FA,0x0000,0x0000,
+0x12FB,0x0000,0x0000, 0x12FC,0x0000,0x0000, 0x12FD,0x0000,0x0000,
+0x12FE,0x0000,0x0000, 0x12FF,0x0000,0x0000, 0x1300,0x0000,0x0000,
+0x1301,0x0000,0x0000, 0x1302,0x0000,0x0000, 0x1304,0x0000,0x0000,
+0x1305,0x0000,0x0000, 0x12E8,0x0000,0x0000, 0x12EF,0x0000,0x0000,
+0x12F6,0x0000,0x0000, 0x1303,0x0000,0x0000, 0x1306,0x0000,0x0000,
+0xFBC0,0x90C6,0x0000, 0xFBC0,0x90C7,0x0000, 0xFBC0,0x90C8,0x0000,
+0xFBC0,0x90C9,0x0000, 0xFBC0,0x90CA,0x0000, 0xFBC0,0x90CB,0x0000,
+0xFBC0,0x90CC,0x0000, 0xFBC0,0x90CD,0x0000, 0xFBC0,0x90CE,0x0000,
+0xFBC0,0x90CF,0x0000, 0x12E1,0x0000,0x0000, 0x12E2,0x0000,0x0000,
+0x12E3,0x0000,0x0000, 0x12E4,0x0000,0x0000, 0x12E5,0x0000,0x0000,
+0x12E6,0x0000,0x0000, 0x12E7,0x0000,0x0000, 0x12E9,0x0000,0x0000,
+0x12EA,0x0000,0x0000, 0x12EB,0x0000,0x0000, 0x12EC,0x0000,0x0000,
+0x12ED,0x0000,0x0000, 0x12EE,0x0000,0x0000, 0x12F0,0x0000,0x0000,
+0x12F1,0x0000,0x0000, 0x12F2,0x0000,0x0000, 0x12F3,0x0000,0x0000,
+0x12F4,0x0000,0x0000, 0x12F5,0x0000,0x0000, 0x12F7,0x0000,0x0000,
+0x12F8,0x0000,0x0000, 0x12F9,0x0000,0x0000, 0x12FA,0x0000,0x0000,
+0x12FB,0x0000,0x0000, 0x12FC,0x0000,0x0000, 0x12FD,0x0000,0x0000,
+0x12FE,0x0000,0x0000, 0x12FF,0x0000,0x0000, 0x1300,0x0000,0x0000,
+0x1301,0x0000,0x0000, 0x1302,0x0000,0x0000, 0x1304,0x0000,0x0000,
+0x1305,0x0000,0x0000, 0x12E8,0x0000,0x0000, 0x12EF,0x0000,0x0000,
+0x12F6,0x0000,0x0000, 0x1303,0x0000,0x0000, 0x1306,0x0000,0x0000,
+0x1307,0x0000,0x0000, 0x1308,0x0000,0x0000, 0x1309,0x0000,0x0000,
+0xFBC0,0x90F9,0x0000, 0xFBC0,0x90FA,0x0000, 0x0271,0x0000,0x0000,
+0xFBC0,0x90FC,0x0000, 0xFBC0,0x90FD,0x0000, 0xFBC0,0x90FE,0x0000,
+0xFBC0,0x90FF,0x0000 };
+
+static uint16 page011data[]= { /* 1100 (3 weights per char) */
+0x1D62,0x0000,0x0000, 0x1D63,0x0000,0x0000, 0x1D64,0x0000,0x0000,
+0x1D65,0x0000,0x0000, 0x1D66,0x0000,0x0000, 0x1D67,0x0000,0x0000,
+0x1D68,0x0000,0x0000, 0x1D69,0x0000,0x0000, 0x1D6A,0x0000,0x0000,
+0x1D6B,0x0000,0x0000, 0x1D6C,0x0000,0x0000, 0x1D6D,0x0000,0x0000,
+0x1D6E,0x0000,0x0000, 0x1D6F,0x0000,0x0000, 0x1D70,0x0000,0x0000,
+0x1D71,0x0000,0x0000, 0x1D72,0x0000,0x0000, 0x1D73,0x0000,0x0000,
+0x1D74,0x0000,0x0000, 0x1D75,0x0000,0x0000, 0x1D76,0x0000,0x0000,
+0x1D77,0x0000,0x0000, 0x1D78,0x0000,0x0000, 0x1D79,0x0000,0x0000,
+0x1D7A,0x0000,0x0000, 0x1D7B,0x0000,0x0000, 0x1D7C,0x0000,0x0000,
+0x1D7D,0x0000,0x0000, 0x1D7E,0x0000,0x0000, 0x1D7F,0x0000,0x0000,
+0x1D80,0x0000,0x0000, 0x1D81,0x0000,0x0000, 0x1D82,0x0000,0x0000,
+0x1D83,0x0000,0x0000, 0x1D84,0x0000,0x0000, 0x1D85,0x0000,0x0000,
+0x1D86,0x0000,0x0000, 0x1D87,0x0000,0x0000, 0x1D88,0x0000,0x0000,
+0x1D89,0x0000,0x0000, 0x1D8A,0x0000,0x0000, 0x1D8B,0x0000,0x0000,
+0x1D8C,0x0000,0x0000, 0x1D8D,0x0000,0x0000, 0x1D8E,0x0000,0x0000,
+0x1D8F,0x0000,0x0000, 0x1D90,0x0000,0x0000, 0x1D91,0x0000,0x0000,
+0x1D92,0x0000,0x0000, 0x1D93,0x0000,0x0000, 0x1D94,0x0000,0x0000,
+0x1D95,0x0000,0x0000, 0x1D96,0x0000,0x0000, 0x1D97,0x0000,0x0000,
+0x1D98,0x0000,0x0000, 0x1D99,0x0000,0x0000, 0x1D9A,0x0000,0x0000,
+0x1D9B,0x0000,0x0000, 0x1D9C,0x0000,0x0000, 0x1D9D,0x0000,0x0000,
+0x1D9E,0x0000,0x0000, 0x1D9F,0x0000,0x0000, 0x1DA0,0x0000,0x0000,
+0x1DA1,0x0000,0x0000, 0x1DA2,0x0000,0x0000, 0x1DA3,0x0000,0x0000,
+0x1DA4,0x0000,0x0000, 0x1DA5,0x0000,0x0000, 0x1DA6,0x0000,0x0000,
+0x1DA7,0x0000,0x0000, 0x1DA8,0x0000,0x0000, 0x1DA9,0x0000,0x0000,
+0x1DAA,0x0000,0x0000, 0x1DAB,0x0000,0x0000, 0x1DAC,0x0000,0x0000,
+0x1DAD,0x0000,0x0000, 0x1DAE,0x0000,0x0000, 0x1DAF,0x0000,0x0000,
+0x1DB0,0x0000,0x0000, 0x1DB1,0x0000,0x0000, 0x1DB2,0x0000,0x0000,
+0x1DB3,0x0000,0x0000, 0x1DB4,0x0000,0x0000, 0x1DB5,0x0000,0x0000,
+0x1DB6,0x0000,0x0000, 0x1DB7,0x0000,0x0000, 0x1DB8,0x0000,0x0000,
+0x1DB9,0x0000,0x0000, 0x1DBA,0x0000,0x0000, 0x1DBB,0x0000,0x0000,
+0xFBC0,0x915A,0x0000, 0xFBC0,0x915B,0x0000, 0xFBC0,0x915C,0x0000,
+0xFBC0,0x915D,0x0000, 0xFBC0,0x915E,0x0000, 0x1DBC,0x0000,0x0000,
+0x1DBD,0x0000,0x0000, 0x1DBE,0x0000,0x0000, 0x1DBF,0x0000,0x0000,
+0x1DC0,0x0000,0x0000, 0x1DC1,0x0000,0x0000, 0x1DC2,0x0000,0x0000,
+0x1DC3,0x0000,0x0000, 0x1DC4,0x0000,0x0000, 0x1DC5,0x0000,0x0000,
+0x1DC6,0x0000,0x0000, 0x1DC7,0x0000,0x0000, 0x1DC8,0x0000,0x0000,
+0x1DC9,0x0000,0x0000, 0x1DCA,0x0000,0x0000, 0x1DCB,0x0000,0x0000,
+0x1DCC,0x0000,0x0000, 0x1DCD,0x0000,0x0000, 0x1DCE,0x0000,0x0000,
+0x1DCF,0x0000,0x0000, 0x1DD0,0x0000,0x0000, 0x1DD1,0x0000,0x0000,
+0x1DD2,0x0000,0x0000, 0x1DD3,0x0000,0x0000, 0x1DD4,0x0000,0x0000,
+0x1DD5,0x0000,0x0000, 0x1DD6,0x0000,0x0000, 0x1DD7,0x0000,0x0000,
+0x1DD8,0x0000,0x0000, 0x1DD9,0x0000,0x0000, 0x1DDA,0x0000,0x0000,
+0x1DDB,0x0000,0x0000, 0x1DDC,0x0000,0x0000, 0x1DDD,0x0000,0x0000,
+0x1DDE,0x0000,0x0000, 0x1DDF,0x0000,0x0000, 0x1DE0,0x0000,0x0000,
+0x1DE1,0x0000,0x0000, 0x1DE2,0x0000,0x0000, 0x1DE3,0x0000,0x0000,
+0x1DE4,0x0000,0x0000, 0x1DE5,0x0000,0x0000, 0x1DE6,0x0000,0x0000,
+0x1DE7,0x0000,0x0000, 0x1DE8,0x0000,0x0000, 0x1DE9,0x0000,0x0000,
+0x1DEA,0x0000,0x0000, 0x1DEB,0x0000,0x0000, 0x1DEC,0x0000,0x0000,
+0x1DED,0x0000,0x0000, 0x1DEE,0x0000,0x0000, 0x1DEF,0x0000,0x0000,
+0x1DF0,0x0000,0x0000, 0x1DF1,0x0000,0x0000, 0x1DF2,0x0000,0x0000,
+0x1DF3,0x0000,0x0000, 0x1DF4,0x0000,0x0000, 0x1DF5,0x0000,0x0000,
+0x1DF6,0x0000,0x0000, 0x1DF7,0x0000,0x0000, 0x1DF8,0x0000,0x0000,
+0x1DF9,0x0000,0x0000, 0x1DFA,0x0000,0x0000, 0x1DFB,0x0000,0x0000,
+0x1DFC,0x0000,0x0000, 0x1DFD,0x0000,0x0000, 0x1DFE,0x0000,0x0000,
+0x1DFF,0x0000,0x0000, 0xFBC0,0x91A3,0x0000, 0xFBC0,0x91A4,0x0000,
+0xFBC0,0x91A5,0x0000, 0xFBC0,0x91A6,0x0000, 0xFBC0,0x91A7,0x0000,
+0x1E00,0x0000,0x0000, 0x1E01,0x0000,0x0000, 0x1E02,0x0000,0x0000,
+0x1E03,0x0000,0x0000, 0x1E04,0x0000,0x0000, 0x1E05,0x0000,0x0000,
+0x1E06,0x0000,0x0000, 0x1E07,0x0000,0x0000, 0x1E08,0x0000,0x0000,
+0x1E09,0x0000,0x0000, 0x1E0A,0x0000,0x0000, 0x1E0B,0x0000,0x0000,
+0x1E0C,0x0000,0x0000, 0x1E0D,0x0000,0x0000, 0x1E0E,0x0000,0x0000,
+0x1E0F,0x0000,0x0000, 0x1E10,0x0000,0x0000, 0x1E11,0x0000,0x0000,
+0x1E12,0x0000,0x0000, 0x1E13,0x0000,0x0000, 0x1E14,0x0000,0x0000,
+0x1E15,0x0000,0x0000, 0x1E16,0x0000,0x0000, 0x1E17,0x0000,0x0000,
+0x1E18,0x0000,0x0000, 0x1E19,0x0000,0x0000, 0x1E1A,0x0000,0x0000,
+0x1E1B,0x0000,0x0000, 0x1E1C,0x0000,0x0000, 0x1E1D,0x0000,0x0000,
+0x1E1E,0x0000,0x0000, 0x1E1F,0x0000,0x0000, 0x1E20,0x0000,0x0000,
+0x1E21,0x0000,0x0000, 0x1E22,0x0000,0x0000, 0x1E23,0x0000,0x0000,
+0x1E24,0x0000,0x0000, 0x1E25,0x0000,0x0000, 0x1E26,0x0000,0x0000,
+0x1E27,0x0000,0x0000, 0x1E28,0x0000,0x0000, 0x1E29,0x0000,0x0000,
+0x1E2A,0x0000,0x0000, 0x1E2B,0x0000,0x0000, 0x1E2C,0x0000,0x0000,
+0x1E2D,0x0000,0x0000, 0x1E2E,0x0000,0x0000, 0x1E2F,0x0000,0x0000,
+0x1E30,0x0000,0x0000, 0x1E31,0x0000,0x0000, 0x1E32,0x0000,0x0000,
+0x1E33,0x0000,0x0000, 0x1E34,0x0000,0x0000, 0x1E35,0x0000,0x0000,
+0x1E36,0x0000,0x0000, 0x1E37,0x0000,0x0000, 0x1E38,0x0000,0x0000,
+0x1E39,0x0000,0x0000, 0x1E3A,0x0000,0x0000, 0x1E3B,0x0000,0x0000,
+0x1E3C,0x0000,0x0000, 0x1E3D,0x0000,0x0000, 0x1E3E,0x0000,0x0000,
+0x1E3F,0x0000,0x0000, 0x1E40,0x0000,0x0000, 0x1E41,0x0000,0x0000,
+0x1E42,0x0000,0x0000, 0x1E43,0x0000,0x0000, 0x1E44,0x0000,0x0000,
+0x1E45,0x0000,0x0000, 0x1E46,0x0000,0x0000, 0x1E47,0x0000,0x0000,
+0x1E48,0x0000,0x0000, 0x1E49,0x0000,0x0000, 0x1E4A,0x0000,0x0000,
+0x1E4B,0x0000,0x0000, 0x1E4C,0x0000,0x0000, 0x1E4D,0x0000,0x0000,
+0x1E4E,0x0000,0x0000, 0x1E4F,0x0000,0x0000, 0x1E50,0x0000,0x0000,
+0x1E51,0x0000,0x0000, 0xFBC0,0x91FA,0x0000, 0xFBC0,0x91FB,0x0000,
+0xFBC0,0x91FC,0x0000, 0xFBC0,0x91FD,0x0000, 0xFBC0,0x91FE,0x0000,
+0xFBC0,0x91FF,0x0000 };
+
+static uint16 page012data[]= { /* 1200 (3 weights per char) */
+0x141C,0x0000,0x0000, 0x141D,0x0000,0x0000, 0x141E,0x0000,0x0000,
+0x141F,0x0000,0x0000, 0x1420,0x0000,0x0000, 0x1421,0x0000,0x0000,
+0x1422,0x0000,0x0000, 0xFBC0,0x9207,0x0000, 0x1423,0x0000,0x0000,
+0x1424,0x0000,0x0000, 0x1425,0x0000,0x0000, 0x1426,0x0000,0x0000,
+0x1427,0x0000,0x0000, 0x1428,0x0000,0x0000, 0x1429,0x0000,0x0000,
+0x142A,0x0000,0x0000, 0x142B,0x0000,0x0000, 0x142C,0x0000,0x0000,
+0x142D,0x0000,0x0000, 0x142E,0x0000,0x0000, 0x142F,0x0000,0x0000,
+0x1430,0x0000,0x0000, 0x1431,0x0000,0x0000, 0x1432,0x0000,0x0000,
+0x1433,0x0000,0x0000, 0x1434,0x0000,0x0000, 0x1435,0x0000,0x0000,
+0x1436,0x0000,0x0000, 0x1437,0x0000,0x0000, 0x1438,0x0000,0x0000,
+0x1439,0x0000,0x0000, 0x143A,0x0000,0x0000, 0x143B,0x0000,0x0000,
+0x143C,0x0000,0x0000, 0x143D,0x0000,0x0000, 0x143E,0x0000,0x0000,
+0x143F,0x0000,0x0000, 0x1440,0x0000,0x0000, 0x1441,0x0000,0x0000,
+0x1442,0x0000,0x0000, 0x1443,0x0000,0x0000, 0x1444,0x0000,0x0000,
+0x1445,0x0000,0x0000, 0x1446,0x0000,0x0000, 0x1447,0x0000,0x0000,
+0x1448,0x0000,0x0000, 0x1449,0x0000,0x0000, 0x144A,0x0000,0x0000,
+0x144B,0x0000,0x0000, 0x144C,0x0000,0x0000, 0x144D,0x0000,0x0000,
+0x144E,0x0000,0x0000, 0x144F,0x0000,0x0000, 0x1450,0x0000,0x0000,
+0x1451,0x0000,0x0000, 0x1452,0x0000,0x0000, 0x1453,0x0000,0x0000,
+0x1454,0x0000,0x0000, 0x1455,0x0000,0x0000, 0x1456,0x0000,0x0000,
+0x1457,0x0000,0x0000, 0x1458,0x0000,0x0000, 0x1459,0x0000,0x0000,
+0x145A,0x0000,0x0000, 0x145B,0x0000,0x0000, 0x145C,0x0000,0x0000,
+0x145D,0x0000,0x0000, 0x145E,0x0000,0x0000, 0x145F,0x0000,0x0000,
+0x1460,0x0000,0x0000, 0x1461,0x0000,0x0000, 0xFBC0,0x9247,0x0000,
+0x1462,0x0000,0x0000, 0xFBC0,0x9249,0x0000, 0x1463,0x0000,0x0000,
+0x1464,0x0000,0x0000, 0x1465,0x0000,0x0000, 0x1466,0x0000,0x0000,
+0xFBC0,0x924E,0x0000, 0xFBC0,0x924F,0x0000, 0x1467,0x0000,0x0000,
+0x1468,0x0000,0x0000, 0x1469,0x0000,0x0000, 0x146A,0x0000,0x0000,
+0x146B,0x0000,0x0000, 0x146C,0x0000,0x0000, 0x146D,0x0000,0x0000,
+0xFBC0,0x9257,0x0000, 0x146E,0x0000,0x0000, 0xFBC0,0x9259,0x0000,
+0x146F,0x0000,0x0000, 0x1470,0x0000,0x0000, 0x1471,0x0000,0x0000,
+0x1472,0x0000,0x0000, 0xFBC0,0x925E,0x0000, 0xFBC0,0x925F,0x0000,
+0x1473,0x0000,0x0000, 0x1474,0x0000,0x0000, 0x1475,0x0000,0x0000,
+0x1476,0x0000,0x0000, 0x1477,0x0000,0x0000, 0x1478,0x0000,0x0000,
+0x1479,0x0000,0x0000, 0x147A,0x0000,0x0000, 0x147B,0x0000,0x0000,
+0x147C,0x0000,0x0000, 0x147D,0x0000,0x0000, 0x147E,0x0000,0x0000,
+0x147F,0x0000,0x0000, 0x1480,0x0000,0x0000, 0x1481,0x0000,0x0000,
+0x1482,0x0000,0x0000, 0x1483,0x0000,0x0000, 0x1484,0x0000,0x0000,
+0x1485,0x0000,0x0000, 0x1486,0x0000,0x0000, 0x1487,0x0000,0x0000,
+0x1488,0x0000,0x0000, 0x1489,0x0000,0x0000, 0x148A,0x0000,0x0000,
+0x148B,0x0000,0x0000, 0x148C,0x0000,0x0000, 0x148D,0x0000,0x0000,
+0x148E,0x0000,0x0000, 0x148F,0x0000,0x0000, 0x1490,0x0000,0x0000,
+0x1491,0x0000,0x0000, 0x1492,0x0000,0x0000, 0x1493,0x0000,0x0000,
+0x1494,0x0000,0x0000, 0x1495,0x0000,0x0000, 0x1496,0x0000,0x0000,
+0x1497,0x0000,0x0000, 0x1498,0x0000,0x0000, 0x1499,0x0000,0x0000,
+0xFBC0,0x9287,0x0000, 0x149A,0x0000,0x0000, 0xFBC0,0x9289,0x0000,
+0x149B,0x0000,0x0000, 0x149C,0x0000,0x0000, 0x149D,0x0000,0x0000,
+0x149E,0x0000,0x0000, 0xFBC0,0x928E,0x0000, 0xFBC0,0x928F,0x0000,
+0x149F,0x0000,0x0000, 0x14A0,0x0000,0x0000, 0x14A1,0x0000,0x0000,
+0x14A2,0x0000,0x0000, 0x14A3,0x0000,0x0000, 0x14A4,0x0000,0x0000,
+0x14A5,0x0000,0x0000, 0x14A6,0x0000,0x0000, 0x14A7,0x0000,0x0000,
+0x14A8,0x0000,0x0000, 0x14A9,0x0000,0x0000, 0x14AA,0x0000,0x0000,
+0x14AB,0x0000,0x0000, 0x14AC,0x0000,0x0000, 0x14AD,0x0000,0x0000,
+0x14AE,0x0000,0x0000, 0x14AF,0x0000,0x0000, 0x14B0,0x0000,0x0000,
+0x14B1,0x0000,0x0000, 0x14B2,0x0000,0x0000, 0x14B3,0x0000,0x0000,
+0x14B4,0x0000,0x0000, 0x14B5,0x0000,0x0000, 0x14B6,0x0000,0x0000,
+0x14B7,0x0000,0x0000, 0x14B8,0x0000,0x0000, 0x14B9,0x0000,0x0000,
+0x14BA,0x0000,0x0000, 0x14BB,0x0000,0x0000, 0x14BC,0x0000,0x0000,
+0x14BD,0x0000,0x0000, 0xFBC0,0x92AF,0x0000, 0x14BE,0x0000,0x0000,
+0xFBC0,0x92B1,0x0000, 0x14BF,0x0000,0x0000, 0x14C0,0x0000,0x0000,
+0x14C1,0x0000,0x0000, 0x14C2,0x0000,0x0000, 0xFBC0,0x92B6,0x0000,
+0xFBC0,0x92B7,0x0000, 0x14C3,0x0000,0x0000, 0x14C4,0x0000,0x0000,
+0x14C5,0x0000,0x0000, 0x14C6,0x0000,0x0000, 0x14C7,0x0000,0x0000,
+0x14C8,0x0000,0x0000, 0x14C9,0x0000,0x0000, 0xFBC0,0x92BF,0x0000,
+0x14CA,0x0000,0x0000, 0xFBC0,0x92C1,0x0000, 0x14CB,0x0000,0x0000,
+0x14CC,0x0000,0x0000, 0x14CD,0x0000,0x0000, 0x14CE,0x0000,0x0000,
+0xFBC0,0x92C6,0x0000, 0xFBC0,0x92C7,0x0000, 0x14CF,0x0000,0x0000,
+0x14D0,0x0000,0x0000, 0x14D1,0x0000,0x0000, 0x14D2,0x0000,0x0000,
+0x14D3,0x0000,0x0000, 0x14D4,0x0000,0x0000, 0x14D5,0x0000,0x0000,
+0xFBC0,0x92CF,0x0000, 0x14D6,0x0000,0x0000, 0x14D7,0x0000,0x0000,
+0x14D8,0x0000,0x0000, 0x14D9,0x0000,0x0000, 0x14DA,0x0000,0x0000,
+0x14DB,0x0000,0x0000, 0x14DC,0x0000,0x0000, 0xFBC0,0x92D7,0x0000,
+0x14DD,0x0000,0x0000, 0x14DE,0x0000,0x0000, 0x14DF,0x0000,0x0000,
+0x14E0,0x0000,0x0000, 0x14E1,0x0000,0x0000, 0x14E2,0x0000,0x0000,
+0x14E3,0x0000,0x0000, 0x14E4,0x0000,0x0000, 0x14E5,0x0000,0x0000,
+0x14E6,0x0000,0x0000, 0x14E7,0x0000,0x0000, 0x14E8,0x0000,0x0000,
+0x14E9,0x0000,0x0000, 0x14EA,0x0000,0x0000, 0x14EB,0x0000,0x0000,
+0x14EC,0x0000,0x0000, 0x14ED,0x0000,0x0000, 0x14EE,0x0000,0x0000,
+0x14EF,0x0000,0x0000, 0x14F0,0x0000,0x0000, 0x14F1,0x0000,0x0000,
+0x14F2,0x0000,0x0000, 0x14F3,0x0000,0x0000, 0xFBC0,0x92EF,0x0000,
+0x14F4,0x0000,0x0000, 0x14F5,0x0000,0x0000, 0x14F6,0x0000,0x0000,
+0x14F7,0x0000,0x0000, 0x14F8,0x0000,0x0000, 0x14F9,0x0000,0x0000,
+0x14FA,0x0000,0x0000, 0x14FB,0x0000,0x0000, 0x14FC,0x0000,0x0000,
+0x14FD,0x0000,0x0000, 0x14FE,0x0000,0x0000, 0x14FF,0x0000,0x0000,
+0x1500,0x0000,0x0000, 0x1501,0x0000,0x0000, 0x1502,0x0000,0x0000,
+0x1503,0x0000,0x0000 };
+
+static uint16 page013data[]= { /* 1300 (3 weights per char) */
+0x1504,0x0000,0x0000, 0x1505,0x0000,0x0000, 0x1506,0x0000,0x0000,
+0x1507,0x0000,0x0000, 0x1508,0x0000,0x0000, 0x1509,0x0000,0x0000,
+0x150A,0x0000,0x0000, 0x150B,0x0000,0x0000, 0x150C,0x0000,0x0000,
+0x150D,0x0000,0x0000, 0x150E,0x0000,0x0000, 0x150F,0x0000,0x0000,
+0x1510,0x0000,0x0000, 0x1511,0x0000,0x0000, 0x1512,0x0000,0x0000,
+0xFBC0,0x930F,0x0000, 0x1513,0x0000,0x0000, 0xFBC0,0x9311,0x0000,
+0x1514,0x0000,0x0000, 0x1515,0x0000,0x0000, 0x1516,0x0000,0x0000,
+0x1517,0x0000,0x0000, 0xFBC0,0x9316,0x0000, 0xFBC0,0x9317,0x0000,
+0x1518,0x0000,0x0000, 0x1519,0x0000,0x0000, 0x151A,0x0000,0x0000,
+0x151B,0x0000,0x0000, 0x151C,0x0000,0x0000, 0x151D,0x0000,0x0000,
+0x151E,0x0000,0x0000, 0xFBC0,0x931F,0x0000, 0x151F,0x0000,0x0000,
+0x1520,0x0000,0x0000, 0x1521,0x0000,0x0000, 0x1522,0x0000,0x0000,
+0x1523,0x0000,0x0000, 0x1524,0x0000,0x0000, 0x1525,0x0000,0x0000,
+0x1526,0x0000,0x0000, 0x1527,0x0000,0x0000, 0x1528,0x0000,0x0000,
+0x1529,0x0000,0x0000, 0x152A,0x0000,0x0000, 0x152B,0x0000,0x0000,
+0x152C,0x0000,0x0000, 0x152D,0x0000,0x0000, 0x152E,0x0000,0x0000,
+0x152F,0x0000,0x0000, 0x1530,0x0000,0x0000, 0x1531,0x0000,0x0000,
+0x1532,0x0000,0x0000, 0x1533,0x0000,0x0000, 0x1534,0x0000,0x0000,
+0x1535,0x0000,0x0000, 0x1536,0x0000,0x0000, 0x1537,0x0000,0x0000,
+0x1538,0x0000,0x0000, 0x1539,0x0000,0x0000, 0x153A,0x0000,0x0000,
+0x153B,0x0000,0x0000, 0x153C,0x0000,0x0000, 0x153D,0x0000,0x0000,
+0x153E,0x0000,0x0000, 0x153F,0x0000,0x0000, 0x1540,0x0000,0x0000,
+0x1541,0x0000,0x0000, 0x1542,0x0000,0x0000, 0x1543,0x0000,0x0000,
+0x1544,0x0000,0x0000, 0x1545,0x0000,0x0000, 0xFBC0,0x9347,0x0000,
+0x1546,0x0000,0x0000, 0x1547,0x0000,0x0000, 0x1548,0x0000,0x0000,
+0x1549,0x0000,0x0000, 0x154A,0x0000,0x0000, 0x154B,0x0000,0x0000,
+0x154C,0x0000,0x0000, 0x154D,0x0000,0x0000, 0x154E,0x0000,0x0000,
+0x154F,0x0000,0x0000, 0x1550,0x0000,0x0000, 0x1551,0x0000,0x0000,
+0x1552,0x0000,0x0000, 0x1553,0x0000,0x0000, 0x1554,0x0000,0x0000,
+0x1555,0x0000,0x0000, 0x1556,0x0000,0x0000, 0x1557,0x0000,0x0000,
+0x1558,0x0000,0x0000, 0xFBC0,0x935B,0x0000, 0xFBC0,0x935C,0x0000,
+0xFBC0,0x935D,0x0000, 0xFBC0,0x935E,0x0000, 0xFBC0,0x935F,0x0000,
+0xFBC0,0x9360,0x0000, 0x0245,0x0000,0x0000, 0x0262,0x0000,0x0000,
+0x0246,0x0000,0x0000, 0x0247,0x0000,0x0000, 0x0248,0x0000,0x0000,
+0x0249,0x0000,0x0000, 0x025A,0x0000,0x0000, 0x0272,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x0DCC,0x0000,0x0000, 0x0DCD,0x0000,0x0000, 0x0DCE,0x0000,0x0000,
+0x0DCF,0x0000,0x0000, 0x0DD0,0x0000,0x0000, 0x0DD1,0x0000,0x0000,
+0x0DD2,0x0000,0x0000, 0x0DD3,0x0000,0x0000, 0x0DD4,0x0000,0x0000,
+0x0DD5,0x0000,0x0000, 0x0DD6,0x0000,0x0000, 0xFBC0,0x937D,0x0000,
+0xFBC0,0x937E,0x0000, 0xFBC0,0x937F,0x0000, 0xFBC0,0x9380,0x0000,
+0xFBC0,0x9381,0x0000, 0xFBC0,0x9382,0x0000, 0xFBC0,0x9383,0x0000,
+0xFBC0,0x9384,0x0000, 0xFBC0,0x9385,0x0000, 0xFBC0,0x9386,0x0000,
+0xFBC0,0x9387,0x0000, 0xFBC0,0x9388,0x0000, 0xFBC0,0x9389,0x0000,
+0xFBC0,0x938A,0x0000, 0xFBC0,0x938B,0x0000, 0xFBC0,0x938C,0x0000,
+0xFBC0,0x938D,0x0000, 0xFBC0,0x938E,0x0000, 0xFBC0,0x938F,0x0000,
+0xFBC0,0x9390,0x0000, 0xFBC0,0x9391,0x0000, 0xFBC0,0x9392,0x0000,
+0xFBC0,0x9393,0x0000, 0xFBC0,0x9394,0x0000, 0xFBC0,0x9395,0x0000,
+0xFBC0,0x9396,0x0000, 0xFBC0,0x9397,0x0000, 0xFBC0,0x9398,0x0000,
+0xFBC0,0x9399,0x0000, 0xFBC0,0x939A,0x0000, 0xFBC0,0x939B,0x0000,
+0xFBC0,0x939C,0x0000, 0xFBC0,0x939D,0x0000, 0xFBC0,0x939E,0x0000,
+0xFBC0,0x939F,0x0000, 0x1A59,0x0000,0x0000, 0x1A5A,0x0000,0x0000,
+0x1A5B,0x0000,0x0000, 0x1A5C,0x0000,0x0000, 0x1A5D,0x0000,0x0000,
+0x1A5E,0x0000,0x0000, 0x1A5F,0x0000,0x0000, 0x1A60,0x0000,0x0000,
+0x1A61,0x0000,0x0000, 0x1A62,0x0000,0x0000, 0x1A63,0x0000,0x0000,
+0x1A64,0x0000,0x0000, 0x1A65,0x0000,0x0000, 0x1A66,0x0000,0x0000,
+0x1A67,0x0000,0x0000, 0x1A68,0x0000,0x0000, 0x1A69,0x0000,0x0000,
+0x1A6A,0x0000,0x0000, 0x1A6B,0x0000,0x0000, 0x1A6C,0x0000,0x0000,
+0x1A6D,0x0000,0x0000, 0x1A6E,0x0000,0x0000, 0x1A6F,0x0000,0x0000,
+0x1A70,0x0000,0x0000, 0x1A71,0x0000,0x0000, 0x1A72,0x0000,0x0000,
+0x1A73,0x0000,0x0000, 0x1A74,0x0000,0x0000, 0x1A75,0x0000,0x0000,
+0x1A76,0x0000,0x0000, 0x1A77,0x0000,0x0000, 0x1A78,0x0000,0x0000,
+0x1A79,0x0000,0x0000, 0x1A7A,0x0000,0x0000, 0x1A7B,0x0000,0x0000,
+0x1A7C,0x0000,0x0000, 0x1A7D,0x0000,0x0000, 0x1A7E,0x0000,0x0000,
+0x1A7F,0x0000,0x0000, 0x1A80,0x0000,0x0000, 0x1A81,0x0000,0x0000,
+0x1A82,0x0000,0x0000, 0x1A83,0x0000,0x0000, 0x1A84,0x0000,0x0000,
+0x1A85,0x0000,0x0000, 0x1A86,0x0000,0x0000, 0x1A87,0x0000,0x0000,
+0x1A88,0x0000,0x0000, 0x1A89,0x0000,0x0000, 0x1A8A,0x0000,0x0000,
+0x1A8B,0x0000,0x0000, 0x1A8C,0x0000,0x0000, 0x1A8D,0x0000,0x0000,
+0x1A8E,0x0000,0x0000, 0x1A8F,0x0000,0x0000, 0x1A90,0x0000,0x0000,
+0x1A91,0x0000,0x0000, 0x1A92,0x0000,0x0000, 0x1A93,0x0000,0x0000,
+0x1A94,0x0000,0x0000, 0x1A95,0x0000,0x0000, 0x1A96,0x0000,0x0000,
+0x1A97,0x0000,0x0000, 0x1A98,0x0000,0x0000, 0x1A99,0x0000,0x0000,
+0x1A9A,0x0000,0x0000, 0x1A9B,0x0000,0x0000, 0x1A9C,0x0000,0x0000,
+0x1A9D,0x0000,0x0000, 0x1A9E,0x0000,0x0000, 0x1A9F,0x0000,0x0000,
+0x1AA0,0x0000,0x0000, 0x1AA1,0x0000,0x0000, 0x1AA2,0x0000,0x0000,
+0x1AA3,0x0000,0x0000, 0x1AA4,0x0000,0x0000, 0x1AA5,0x0000,0x0000,
+0x1AA6,0x0000,0x0000, 0x1AA7,0x0000,0x0000, 0x1AA8,0x0000,0x0000,
+0x1AA9,0x0000,0x0000, 0x1AAA,0x0000,0x0000, 0x1AAB,0x0000,0x0000,
+0x1AAC,0x0000,0x0000, 0x1AAD,0x0000,0x0000, 0xFBC0,0x93F5,0x0000,
+0xFBC0,0x93F6,0x0000, 0xFBC0,0x93F7,0x0000, 0xFBC0,0x93F8,0x0000,
+0xFBC0,0x93F9,0x0000, 0xFBC0,0x93FA,0x0000, 0xFBC0,0x93FB,0x0000,
+0xFBC0,0x93FC,0x0000, 0xFBC0,0x93FD,0x0000, 0xFBC0,0x93FE,0x0000,
+0xFBC0,0x93FF,0x0000 };
+
+static uint16 page014data[]= { /* 1400 (3 weights per char) */
+0xFBC0,0x9400,0x0000, 0x1AAE,0x0000,0x0000, 0x1AAF,0x0000,0x0000,
+0x1AB0,0x0000,0x0000, 0x1AB1,0x0000,0x0000, 0x1AB2,0x0000,0x0000,
+0x1AB3,0x0000,0x0000, 0x1AB4,0x0000,0x0000, 0x1AB5,0x0000,0x0000,
+0x1AB6,0x0000,0x0000, 0x1AB7,0x0000,0x0000, 0x1AB8,0x0000,0x0000,
+0x1AB9,0x0000,0x0000, 0x1ABA,0x0000,0x0000, 0x1ABB,0x0000,0x0000,
+0x1ABC,0x0000,0x0000, 0x1ABD,0x0000,0x0000, 0x1ABE,0x0000,0x0000,
+0x1ABF,0x0000,0x0000, 0x1AC0,0x0000,0x0000, 0x1AC1,0x0000,0x0000,
+0x1AC2,0x0000,0x0000, 0x1AC3,0x0000,0x0000, 0x1AC4,0x0000,0x0000,
+0x1AC5,0x0000,0x0000, 0x1AC6,0x0000,0x0000, 0x1AC7,0x0000,0x0000,
+0x1AC8,0x0000,0x0000, 0x1AC9,0x0000,0x0000, 0x1ACA,0x0000,0x0000,
+0x1ACB,0x0000,0x0000, 0x1ACC,0x0000,0x0000, 0x1ACD,0x0000,0x0000,
+0x1ACE,0x0000,0x0000, 0x1ACF,0x0000,0x0000, 0x1AD0,0x0000,0x0000,
+0x1AD1,0x0000,0x0000, 0x1AD2,0x0000,0x0000, 0x1AD3,0x0000,0x0000,
+0x1AD4,0x0000,0x0000, 0x1AD5,0x0000,0x0000, 0x1AD6,0x0000,0x0000,
+0x1AD7,0x0000,0x0000, 0x1AD8,0x0000,0x0000, 0x1AD9,0x0000,0x0000,
+0x1ADA,0x0000,0x0000, 0x1ADB,0x0000,0x0000, 0x1ADC,0x0000,0x0000,
+0x1ADD,0x0000,0x0000, 0x1ADE,0x0000,0x0000, 0x1ADF,0x0000,0x0000,
+0x1AE0,0x0000,0x0000, 0x1AE1,0x0000,0x0000, 0x1AE2,0x0000,0x0000,
+0x1AE3,0x0000,0x0000, 0x1AE4,0x0000,0x0000, 0x1AE5,0x0000,0x0000,
+0x1AE6,0x0000,0x0000, 0x1AE7,0x0000,0x0000, 0x1AE8,0x0000,0x0000,
+0x1AE9,0x0000,0x0000, 0x1AEA,0x0000,0x0000, 0x1AEB,0x0000,0x0000,
+0x1AEC,0x0000,0x0000, 0x1AED,0x0000,0x0000, 0x1AEE,0x0000,0x0000,
+0x1AEF,0x0000,0x0000, 0x1AF0,0x0000,0x0000, 0x1AF1,0x0000,0x0000,
+0x1AF2,0x0000,0x0000, 0x1AF3,0x0000,0x0000, 0x1AF4,0x0000,0x0000,
+0x1AF5,0x0000,0x0000, 0x1AF6,0x0000,0x0000, 0x1AF7,0x0000,0x0000,
+0x1AF8,0x0000,0x0000, 0x1AF9,0x0000,0x0000, 0x1AFA,0x0000,0x0000,
+0x1AFB,0x0000,0x0000, 0x1AFC,0x0000,0x0000, 0x1AFD,0x0000,0x0000,
+0x1AFE,0x0000,0x0000, 0x1AFF,0x0000,0x0000, 0x1B00,0x0000,0x0000,
+0x1B01,0x0000,0x0000, 0x1B02,0x0000,0x0000, 0x1B03,0x0000,0x0000,
+0x1B04,0x0000,0x0000, 0x1B05,0x0000,0x0000, 0x1B06,0x0000,0x0000,
+0x1B07,0x0000,0x0000, 0x1B08,0x0000,0x0000, 0x1B09,0x0000,0x0000,
+0x1B0A,0x0000,0x0000, 0x1B0B,0x0000,0x0000, 0x1B0C,0x0000,0x0000,
+0x1B0D,0x0000,0x0000, 0x1B0E,0x0000,0x0000, 0x1B0F,0x0000,0x0000,
+0x1B10,0x0000,0x0000, 0x1B11,0x0000,0x0000, 0x1B12,0x0000,0x0000,
+0x1B13,0x0000,0x0000, 0x1B14,0x0000,0x0000, 0x1B15,0x0000,0x0000,
+0x1B16,0x0000,0x0000, 0x1B17,0x0000,0x0000, 0x1B18,0x0000,0x0000,
+0x1B19,0x0000,0x0000, 0x1B1A,0x0000,0x0000, 0x1B1B,0x0000,0x0000,
+0x1B1C,0x0000,0x0000, 0x1B1D,0x0000,0x0000, 0x1B1E,0x0000,0x0000,
+0x1B1F,0x0000,0x0000, 0x1B20,0x0000,0x0000, 0x1B21,0x0000,0x0000,
+0x1B22,0x0000,0x0000, 0x1B23,0x0000,0x0000, 0x1B24,0x0000,0x0000,
+0x1B25,0x0000,0x0000, 0x1B26,0x0000,0x0000, 0x1B27,0x0000,0x0000,
+0x1B28,0x0000,0x0000, 0x1B29,0x0000,0x0000, 0x1B2A,0x0000,0x0000,
+0x1B2B,0x0000,0x0000, 0x1B2C,0x0000,0x0000, 0x1B2D,0x0000,0x0000,
+0x1B2E,0x0000,0x0000, 0x1B2F,0x0000,0x0000, 0x1B30,0x0000,0x0000,
+0x1B31,0x0000,0x0000, 0x1B32,0x0000,0x0000, 0x1B33,0x0000,0x0000,
+0x1B34,0x0000,0x0000, 0x1B35,0x0000,0x0000, 0x1B36,0x0000,0x0000,
+0x1B37,0x0000,0x0000, 0x1B38,0x0000,0x0000, 0x1B39,0x0000,0x0000,
+0x1B3A,0x0000,0x0000, 0x1B3B,0x0000,0x0000, 0x1B3C,0x0000,0x0000,
+0x1B3D,0x0000,0x0000, 0x1B3E,0x0000,0x0000, 0x1B3F,0x0000,0x0000,
+0x1B40,0x0000,0x0000, 0x1B41,0x0000,0x0000, 0x1B42,0x0000,0x0000,
+0x1B43,0x0000,0x0000, 0x1B44,0x0000,0x0000, 0x1B45,0x0000,0x0000,
+0x1B46,0x0000,0x0000, 0x1B47,0x0000,0x0000, 0x1B48,0x0000,0x0000,
+0x1B49,0x0000,0x0000, 0x1B4A,0x0000,0x0000, 0x1B4B,0x0000,0x0000,
+0x1B4C,0x0000,0x0000, 0x1B4D,0x0000,0x0000, 0x1B4E,0x0000,0x0000,
+0x1B4F,0x0000,0x0000, 0x1B50,0x0000,0x0000, 0x1B51,0x0000,0x0000,
+0x1B52,0x0000,0x0000, 0x1B53,0x0000,0x0000, 0x1B54,0x0000,0x0000,
+0x1B55,0x0000,0x0000, 0x1B56,0x0000,0x0000, 0x1B57,0x0000,0x0000,
+0x1B58,0x0000,0x0000, 0x1B59,0x0000,0x0000, 0x1B5A,0x0000,0x0000,
+0x1B5B,0x0000,0x0000, 0x1B5C,0x0000,0x0000, 0x1B5D,0x0000,0x0000,
+0x1B5E,0x0000,0x0000, 0x1B5F,0x0000,0x0000, 0x1B60,0x0000,0x0000,
+0x1B61,0x0000,0x0000, 0x1B62,0x0000,0x0000, 0x1B63,0x0000,0x0000,
+0x1B64,0x0000,0x0000, 0x1B65,0x0000,0x0000, 0x1B66,0x0000,0x0000,
+0x1B67,0x0000,0x0000, 0x1B68,0x0000,0x0000, 0x1B69,0x0000,0x0000,
+0x1B6A,0x0000,0x0000, 0x1B6B,0x0000,0x0000, 0x1B6C,0x0000,0x0000,
+0x1B6D,0x0000,0x0000, 0x1B6E,0x0000,0x0000, 0x1B6F,0x0000,0x0000,
+0x1B70,0x0000,0x0000, 0x1B71,0x0000,0x0000, 0x1B72,0x0000,0x0000,
+0x1B73,0x0000,0x0000, 0x1B74,0x0000,0x0000, 0x1B75,0x0000,0x0000,
+0x1B76,0x0000,0x0000, 0x1B77,0x0000,0x0000, 0x1B78,0x0000,0x0000,
+0x1B79,0x0000,0x0000, 0x1B7A,0x0000,0x0000, 0x1B7B,0x0000,0x0000,
+0x1B7C,0x0000,0x0000, 0x1B7D,0x0000,0x0000, 0x1B7E,0x0000,0x0000,
+0x1B7F,0x0000,0x0000, 0x1B80,0x0000,0x0000, 0x1B81,0x0000,0x0000,
+0x1B82,0x0000,0x0000, 0x1B83,0x0000,0x0000, 0x1B84,0x0000,0x0000,
+0x1B85,0x0000,0x0000, 0x1B86,0x0000,0x0000, 0x1B87,0x0000,0x0000,
+0x1B88,0x0000,0x0000, 0x1B89,0x0000,0x0000, 0x1B8A,0x0000,0x0000,
+0x1B8B,0x0000,0x0000, 0x1B8C,0x0000,0x0000, 0x1B8D,0x0000,0x0000,
+0x1B8E,0x0000,0x0000, 0x1B8F,0x0000,0x0000, 0x1B90,0x0000,0x0000,
+0x1B91,0x0000,0x0000, 0x1B92,0x0000,0x0000, 0x1B93,0x0000,0x0000,
+0x1B94,0x0000,0x0000, 0x1B95,0x0000,0x0000, 0x1B96,0x0000,0x0000,
+0x1B97,0x0000,0x0000, 0x1B98,0x0000,0x0000, 0x1B99,0x0000,0x0000,
+0x1B9A,0x0000,0x0000, 0x1B9B,0x0000,0x0000, 0x1B9C,0x0000,0x0000,
+0x1B9D,0x0000,0x0000, 0x1B9E,0x0000,0x0000, 0x1B9F,0x0000,0x0000,
+0x1BA0,0x0000,0x0000, 0x1BA1,0x0000,0x0000, 0x1BA2,0x0000,0x0000,
+0x1BA3,0x0000,0x0000, 0x1BA4,0x0000,0x0000, 0x1BA5,0x0000,0x0000,
+0x1BA6,0x0000,0x0000, 0x1BA7,0x0000,0x0000, 0x1BA8,0x0000,0x0000,
+0x1BA9,0x0000,0x0000, 0x1BAA,0x0000,0x0000, 0x1BAB,0x0000,0x0000,
+0x1BAC,0x0000,0x0000 };
+
+static uint16 page015data[]= { /* 1500 (2 weights per char) */
+0x1BAD,0x0000, 0x1BAE,0x0000, 0x1BAF,0x0000, 0x1BB0,0x0000,
+0x1BB1,0x0000, 0x1BB2,0x0000, 0x1BB3,0x0000, 0x1BB4,0x0000,
+0x1BB5,0x0000, 0x1BB6,0x0000, 0x1BB7,0x0000, 0x1BB8,0x0000,
+0x1BB9,0x0000, 0x1BBA,0x0000, 0x1BBB,0x0000, 0x1BBC,0x0000,
+0x1BBD,0x0000, 0x1BBE,0x0000, 0x1BBF,0x0000, 0x1BC0,0x0000,
+0x1BC1,0x0000, 0x1BC2,0x0000, 0x1BC3,0x0000, 0x1BC4,0x0000,
+0x1BC5,0x0000, 0x1BC6,0x0000, 0x1BC7,0x0000, 0x1BC8,0x0000,
+0x1BC9,0x0000, 0x1BCA,0x0000, 0x1BCB,0x0000, 0x1BCC,0x0000,
+0x1BCD,0x0000, 0x1BCE,0x0000, 0x1BCF,0x0000, 0x1BD0,0x0000,
+0x1BD1,0x0000, 0x1BD2,0x0000, 0x1BD3,0x0000, 0x1BD4,0x0000,
+0x1BD5,0x0000, 0x1BD6,0x0000, 0x1BD7,0x0000, 0x1BD8,0x0000,
+0x1BD9,0x0000, 0x1BDA,0x0000, 0x1BDB,0x0000, 0x1BDC,0x0000,
+0x1BDD,0x0000, 0x1BDE,0x0000, 0x1BDF,0x0000, 0x1BE0,0x0000,
+0x1BE1,0x0000, 0x1BE2,0x0000, 0x1BE3,0x0000, 0x1BE4,0x0000,
+0x1BE5,0x0000, 0x1BE6,0x0000, 0x1BE7,0x0000, 0x1BE8,0x0000,
+0x1BE9,0x0000, 0x1BEA,0x0000, 0x1BEB,0x0000, 0x1BEC,0x0000,
+0x1BED,0x0000, 0x1BEE,0x0000, 0x1BEF,0x0000, 0x1BF0,0x0000,
+0x1BF1,0x0000, 0x1BF2,0x0000, 0x1BF3,0x0000, 0x1BF4,0x0000,
+0x1BF5,0x0000, 0x1BF6,0x0000, 0x1BF7,0x0000, 0x1BF8,0x0000,
+0x1BF9,0x0000, 0x1BFA,0x0000, 0x1BFB,0x0000, 0x1BFC,0x0000,
+0x1BFD,0x0000, 0x1BFE,0x0000, 0x1BFF,0x0000, 0x1C00,0x0000,
+0x1C01,0x0000, 0x1C02,0x0000, 0x1C03,0x0000, 0x1C04,0x0000,
+0x1C05,0x0000, 0x1C06,0x0000, 0x1C07,0x0000, 0x1C08,0x0000,
+0x1C09,0x0000, 0x1C0A,0x0000, 0x1C0B,0x0000, 0x1C0C,0x0000,
+0x1C0D,0x0000, 0x1C0E,0x0000, 0x1C0F,0x0000, 0x1C10,0x0000,
+0x1C11,0x0000, 0x1C12,0x0000, 0x1C13,0x0000, 0x1C14,0x0000,
+0x1C15,0x0000, 0x1C16,0x0000, 0x1C17,0x0000, 0x1C18,0x0000,
+0x1C19,0x0000, 0x1C1A,0x0000, 0x1C1B,0x0000, 0x1C1C,0x0000,
+0x1C1D,0x0000, 0x1C1E,0x0000, 0x1C1F,0x0000, 0x1C20,0x0000,
+0x1C21,0x0000, 0x1C22,0x0000, 0x1C23,0x0000, 0x1C24,0x0000,
+0x1C25,0x0000, 0x1C26,0x0000, 0x1C27,0x0000, 0x1C28,0x0000,
+0x1C5B,0x0000, 0x1C29,0x0000, 0x1C2B,0x0000, 0x1C2C,0x0000,
+0x1C2D,0x0000, 0x1C2E,0x0000, 0x1C2F,0x0000, 0x1C30,0x0000,
+0x1C31,0x0000, 0x1C32,0x0000, 0x1C33,0x0000, 0x1C34,0x0000,
+0x1C35,0x0000, 0x1C36,0x0000, 0x1C37,0x0000, 0x1C38,0x0000,
+0x1C39,0x0000, 0x1C3A,0x0000, 0x1C3C,0x0000, 0x1C3D,0x0000,
+0x1C3E,0x0000, 0x1C3F,0x0000, 0x1C40,0x0000, 0x1C41,0x0000,
+0x1C42,0x0000, 0x1C43,0x0000, 0x1C4A,0x0000, 0x1C4B,0x0000,
+0x1C4C,0x0000, 0x1C4D,0x0000, 0x1C4E,0x0000, 0x1C4F,0x0000,
+0x1C50,0x0000, 0x1C51,0x0000, 0x1C52,0x0000, 0x1C53,0x0000,
+0x1C54,0x0000, 0x1C55,0x0000, 0x1C56,0x0000, 0x1C57,0x0000,
+0x1C58,0x0000, 0x1C59,0x0000, 0x1C5A,0x0000, 0x1C5C,0x0000,
+0x1C5D,0x0000, 0x1C5E,0x0000, 0x1C5F,0x0000, 0x1C60,0x0000,
+0x1C61,0x0000, 0x1C62,0x0000, 0x1C63,0x0000, 0x1C64,0x0000,
+0x1C65,0x0000, 0x1C66,0x0000, 0x1C67,0x0000, 0x1C68,0x0000,
+0x1C69,0x0000, 0x1C6A,0x0000, 0x1C6B,0x0000, 0x1C6C,0x0000,
+0x1C6D,0x0000, 0x1C6E,0x0000, 0x1C6F,0x0000, 0x1C70,0x0000,
+0x1C71,0x0000, 0x1C72,0x0000, 0x1C73,0x0000, 0x1C74,0x0000,
+0x1C75,0x0000, 0x1C76,0x0000, 0x1C77,0x0000, 0x1C78,0x0000,
+0x1C79,0x0000, 0x1C7A,0x0000, 0x1C7B,0x0000, 0x1C7C,0x0000,
+0x1C7D,0x0000, 0x1C7E,0x0000, 0x1C7F,0x0000, 0x1C80,0x0000,
+0x1C81,0x0000, 0x1C82,0x0000, 0x1C83,0x0000, 0x1C84,0x0000,
+0x1C85,0x0000, 0x1C86,0x0000, 0x1C87,0x0000, 0x1C88,0x0000,
+0x1C89,0x0000, 0x1C8A,0x0000, 0x1C8B,0x0000, 0x1C8C,0x0000,
+0x1C8D,0x0000, 0x1C8E,0x0000, 0x1C8F,0x0000, 0x1C90,0x0000,
+0x1C91,0x0000, 0x1C92,0x0000, 0x1C93,0x0000, 0x1C94,0x0000,
+0x1C95,0x0000, 0x1C96,0x0000, 0x1C97,0x0000, 0x1C98,0x0000,
+0x1C99,0x0000, 0x1C9A,0x0000, 0x1C9B,0x0000, 0x1C9C,0x0000,
+0x1C9D,0x0000, 0x1C9E,0x0000, 0x1C9F,0x0000, 0x1CA0,0x0000,
+0x1CA1,0x0000, 0x1CA2,0x0000, 0x1CA3,0x0000, 0x1CA4,0x0000,
+0x1CA5,0x0000, 0x1CA6,0x0000, 0x1CA7,0x0000, 0x1CA8,0x0000,
+0x1CA9,0x0000, 0x1CAA,0x0000, 0x1CAB,0x0000, 0x1CAC,0x0000,
+0x1CAD,0x0000, 0x1CAE,0x0000, 0x1CAF,0x0000, 0x1CB0,0x0000,
+0x1CB1,0x0000, 0x1CB2,0x0000, 0x1CB3,0x0000, 0x1CB4,0x0000
+};
+
+static uint16 page016data[]= { /* 1600 (3 weights per char) */
+0x1CB5,0x0000,0x0000, 0x1CB6,0x0000,0x0000, 0x1CB7,0x0000,0x0000,
+0x1CB8,0x0000,0x0000, 0x1CB9,0x0000,0x0000, 0x1CBA,0x0000,0x0000,
+0x1CBB,0x0000,0x0000, 0x1CBC,0x0000,0x0000, 0x1CBD,0x0000,0x0000,
+0x1CBE,0x0000,0x0000, 0x1CBF,0x0000,0x0000, 0x1CC0,0x0000,0x0000,
+0x1CC1,0x0000,0x0000, 0x1CC2,0x0000,0x0000, 0x1CC3,0x0000,0x0000,
+0x1CC4,0x0000,0x0000, 0x1CC5,0x0000,0x0000, 0x1CC6,0x0000,0x0000,
+0x1CC7,0x0000,0x0000, 0x1CC8,0x0000,0x0000, 0x1CC9,0x0000,0x0000,
+0x1CCA,0x0000,0x0000, 0x1CCB,0x0000,0x0000, 0x1CCC,0x0000,0x0000,
+0x1CCD,0x0000,0x0000, 0x1CCE,0x0000,0x0000, 0x1CCF,0x0000,0x0000,
+0x1CD0,0x0000,0x0000, 0x1CD1,0x0000,0x0000, 0x1CD2,0x0000,0x0000,
+0x1CD3,0x0000,0x0000, 0x1CD4,0x0000,0x0000, 0x1CD5,0x0000,0x0000,
+0x1CD6,0x0000,0x0000, 0x1CD7,0x0000,0x0000, 0x1CD8,0x0000,0x0000,
+0x1CD9,0x0000,0x0000, 0x1CDA,0x0000,0x0000, 0x1CDB,0x0000,0x0000,
+0x1CDC,0x0000,0x0000, 0x1CDD,0x0000,0x0000, 0x1CDE,0x0000,0x0000,
+0x1CDF,0x0000,0x0000, 0x1CE0,0x0000,0x0000, 0x1CE1,0x0000,0x0000,
+0x1CE2,0x0000,0x0000, 0x1CE3,0x0000,0x0000, 0x1CE4,0x0000,0x0000,
+0x1CE5,0x0000,0x0000, 0x1CE6,0x0000,0x0000, 0x1CE7,0x0000,0x0000,
+0x1CE8,0x0000,0x0000, 0x1CE9,0x0000,0x0000, 0x1CEA,0x0000,0x0000,
+0x1CEB,0x0000,0x0000, 0x1CEC,0x0000,0x0000, 0x1CED,0x0000,0x0000,
+0x1CEE,0x0000,0x0000, 0x1CEF,0x0000,0x0000, 0x1CF0,0x0000,0x0000,
+0x1CF1,0x0000,0x0000, 0x1CF2,0x0000,0x0000, 0x1CF3,0x0000,0x0000,
+0x1CF4,0x0000,0x0000, 0x1CF5,0x0000,0x0000, 0x1CF6,0x0000,0x0000,
+0x1CF7,0x0000,0x0000, 0x1CF8,0x0000,0x0000, 0x1CF9,0x0000,0x0000,
+0x1CFA,0x0000,0x0000, 0x1CFB,0x0000,0x0000, 0x1CFC,0x0000,0x0000,
+0x1CFD,0x0000,0x0000, 0x1CFE,0x0000,0x0000, 0x1CFF,0x0000,0x0000,
+0x1D00,0x0000,0x0000, 0x1D01,0x0000,0x0000, 0x1D02,0x0000,0x0000,
+0x1D03,0x0000,0x0000, 0x1D04,0x0000,0x0000, 0x1D05,0x0000,0x0000,
+0x1D06,0x0000,0x0000, 0x1D07,0x0000,0x0000, 0x1D08,0x0000,0x0000,
+0x1D09,0x0000,0x0000, 0x1D0A,0x0000,0x0000, 0x1D0B,0x0000,0x0000,
+0x1D0C,0x0000,0x0000, 0x1D0D,0x0000,0x0000, 0x1D0E,0x0000,0x0000,
+0x1D0F,0x0000,0x0000, 0x1D10,0x0000,0x0000, 0x1D11,0x0000,0x0000,
+0x1D12,0x0000,0x0000, 0x1D13,0x0000,0x0000, 0x1D14,0x0000,0x0000,
+0x1D15,0x0000,0x0000, 0x1D16,0x0000,0x0000, 0x1D17,0x0000,0x0000,
+0x1D18,0x0000,0x0000, 0x1D19,0x0000,0x0000, 0x1D1A,0x0000,0x0000,
+0x1D1B,0x0000,0x0000, 0x1D1C,0x0000,0x0000, 0x1D1D,0x0000,0x0000,
+0x1D1E,0x0000,0x0000, 0x1D1F,0x0000,0x0000, 0x1D20,0x0000,0x0000,
+0x1D21,0x0000,0x0000, 0x0316,0x0000,0x0000, 0x0265,0x0000,0x0000,
+0x1C2A,0x0000,0x0000, 0x1C3B,0x0000,0x0000, 0x1C44,0x0000,0x0000,
+0x1C45,0x0000,0x0000, 0x1C46,0x0000,0x0000, 0x1C47,0x0000,0x0000,
+0x1C48,0x0000,0x0000, 0x1C49,0x0000,0x0000, 0xFBC0,0x9677,0x0000,
+0xFBC0,0x9678,0x0000, 0xFBC0,0x9679,0x0000, 0xFBC0,0x967A,0x0000,
+0xFBC0,0x967B,0x0000, 0xFBC0,0x967C,0x0000, 0xFBC0,0x967D,0x0000,
+0xFBC0,0x967E,0x0000, 0xFBC0,0x967F,0x0000, 0x020A,0x0000,0x0000,
+0x1D22,0x0000,0x0000, 0x1D23,0x0000,0x0000, 0x1D24,0x0000,0x0000,
+0x1D25,0x0000,0x0000, 0x1D26,0x0000,0x0000, 0x1D27,0x0000,0x0000,
+0x1D28,0x0000,0x0000, 0x1D29,0x0000,0x0000, 0x1D2A,0x0000,0x0000,
+0x1D2B,0x0000,0x0000, 0x1D2C,0x0000,0x0000, 0x1D2D,0x0000,0x0000,
+0x1D2E,0x0000,0x0000, 0x1D2F,0x0000,0x0000, 0x1D30,0x0000,0x0000,
+0x1D31,0x0000,0x0000, 0x1D32,0x0000,0x0000, 0x1D33,0x0000,0x0000,
+0x1D34,0x0000,0x0000, 0x1D35,0x0000,0x0000, 0x1D36,0x0000,0x0000,
+0x1D37,0x0000,0x0000, 0x1D38,0x0000,0x0000, 0x1D39,0x0000,0x0000,
+0x1D3A,0x0000,0x0000, 0x1D3B,0x0000,0x0000, 0x0292,0x0000,0x0000,
+0x0293,0x0000,0x0000, 0xFBC0,0x969D,0x0000, 0xFBC0,0x969E,0x0000,
+0xFBC0,0x969F,0x0000, 0x1D3C,0x0000,0x0000, 0x1D3C,0x0000,0x0000,
+0x1D3D,0x0000,0x0000, 0x1D59,0x0000,0x0000, 0x1D3D,0x0000,0x0000,
+0x1D3D,0x0000,0x0000, 0x1D3E,0x0000,0x0000, 0x1D3E,0x0000,0x0000,
+0x1D3F,0x0000,0x0000, 0x1D3F,0x0000,0x0000, 0x1D57,0x0000,0x0000,
+0x1D58,0x0000,0x0000, 0x1D3F,0x0000,0x0000, 0x1D3F,0x0000,0x0000,
+0x1D3F,0x0000,0x0000, 0x1D40,0x0000,0x0000, 0x1D41,0x0000,0x0000,
+0x1D42,0x0000,0x0000, 0x1D43,0x0000,0x0000, 0x1D43,0x0000,0x0000,
+0x1D43,0x0000,0x0000, 0x1D43,0x0000,0x0000, 0x1D43,0x0000,0x0000,
+0x1D44,0x0000,0x0000, 0x1D5C,0x0000,0x0000, 0x1D45,0x0000,0x0000,
+0x1D46,0x0000,0x0000, 0x1D46,0x0000,0x0000, 0x1D46,0x0000,0x0000,
+0x1D46,0x0000,0x0000, 0x1D47,0x0000,0x0000, 0x1D47,0x0000,0x0000,
+0x1D47,0x0000,0x0000, 0x1D48,0x0000,0x0000, 0x1D48,0x0000,0x0000,
+0x1D49,0x0000,0x0000, 0x1D49,0x0000,0x0000, 0x1D4A,0x0000,0x0000,
+0x1D4A,0x0000,0x0000, 0x1D4B,0x0000,0x0000, 0x1D4C,0x0000,0x0000,
+0x1D4D,0x0000,0x0000, 0x1D4E,0x0000,0x0000, 0x1D4E,0x0000,0x0000,
+0x1D4E,0x0000,0x0000, 0x1D4E,0x0000,0x0000, 0x1D4E,0x0000,0x0000,
+0x1D4F,0x0000,0x0000, 0x1D4F,0x0000,0x0000, 0x1D4F,0x0000,0x0000,
+0x1D50,0x0000,0x0000, 0x1D50,0x0000,0x0000, 0x1D50,0x0000,0x0000,
+0x1D4C,0x0000,0x0000, 0x1D51,0x0000,0x0000, 0x1D52,0x0000,0x0000,
+0x1D52,0x0000,0x0000, 0x1D52,0x0000,0x0000, 0x1D53,0x0000,0x0000,
+0x1D53,0x0000,0x0000, 0x1D54,0x0000,0x0000, 0x1D54,0x0000,0x0000,
+0x1D55,0x0000,0x0000, 0x1D56,0x0000,0x0000, 0x1D5A,0x0000,0x0000,
+0x1D5E,0x0000,0x0000, 0x1D5F,0x0000,0x0000, 0x1D5B,0x0000,0x0000,
+0x1D5D,0x0000,0x0000, 0x1D60,0x0000,0x0000, 0x1D61,0x0000,0x0000,
+0x1D61,0x0000,0x0000, 0x1D61,0x0000,0x0000, 0x1D45,0x0000,0x0000,
+0x1D4E,0x0000,0x0000, 0x024E,0x0000,0x0000, 0x024F,0x0000,0x0000,
+0x0250,0x0000,0x0000, 0x1D4A,0x1D53,0x0000, 0x1D52,0x1D52,0x0000,
+0x1D3E,0x1D3E,0x0000, 0xFBC0,0x96F1,0x0000, 0xFBC0,0x96F2,0x0000,
+0xFBC0,0x96F3,0x0000, 0xFBC0,0x96F4,0x0000, 0xFBC0,0x96F5,0x0000,
+0xFBC0,0x96F6,0x0000, 0xFBC0,0x96F7,0x0000, 0xFBC0,0x96F8,0x0000,
+0xFBC0,0x96F9,0x0000, 0xFBC0,0x96FA,0x0000, 0xFBC0,0x96FB,0x0000,
+0xFBC0,0x96FC,0x0000, 0xFBC0,0x96FD,0x0000, 0xFBC0,0x96FE,0x0000,
+0xFBC0,0x96FF,0x0000 };
+
+static uint16 page017data[]= { /* 1700 (3 weights per char) */
+0x18E2,0x0000,0x0000, 0x18E3,0x0000,0x0000, 0x18E4,0x0000,0x0000,
+0x18E5,0x0000,0x0000, 0x18E6,0x0000,0x0000, 0x18E7,0x0000,0x0000,
+0x18E8,0x0000,0x0000, 0x18E9,0x0000,0x0000, 0x18EA,0x0000,0x0000,
+0x18EB,0x0000,0x0000, 0x18EC,0x0000,0x0000, 0x18ED,0x0000,0x0000,
+0x18EE,0x0000,0x0000, 0xFBC0,0x970D,0x0000, 0x18EF,0x0000,0x0000,
+0x18F0,0x0000,0x0000, 0x18F1,0x0000,0x0000, 0x18F2,0x0000,0x0000,
+0x18F3,0x0000,0x0000, 0x18F4,0x0000,0x0000, 0x18F5,0x0000,0x0000,
+0xFBC0,0x9715,0x0000, 0xFBC0,0x9716,0x0000, 0xFBC0,0x9717,0x0000,
+0xFBC0,0x9718,0x0000, 0xFBC0,0x9719,0x0000, 0xFBC0,0x971A,0x0000,
+0xFBC0,0x971B,0x0000, 0xFBC0,0x971C,0x0000, 0xFBC0,0x971D,0x0000,
+0xFBC0,0x971E,0x0000, 0xFBC0,0x971F,0x0000, 0x18F6,0x0000,0x0000,
+0x18F7,0x0000,0x0000, 0x18F8,0x0000,0x0000, 0x18F9,0x0000,0x0000,
+0x18FA,0x0000,0x0000, 0x18FB,0x0000,0x0000, 0x18FC,0x0000,0x0000,
+0x18FD,0x0000,0x0000, 0x18FE,0x0000,0x0000, 0x18FF,0x0000,0x0000,
+0x1900,0x0000,0x0000, 0x1901,0x0000,0x0000, 0x1902,0x0000,0x0000,
+0x1903,0x0000,0x0000, 0x1904,0x0000,0x0000, 0x1905,0x0000,0x0000,
+0x1906,0x0000,0x0000, 0x1907,0x0000,0x0000, 0x1908,0x0000,0x0000,
+0x1909,0x0000,0x0000, 0x190A,0x0000,0x0000, 0x026A,0x0000,0x0000,
+0x026B,0x0000,0x0000, 0xFBC0,0x9737,0x0000, 0xFBC0,0x9738,0x0000,
+0xFBC0,0x9739,0x0000, 0xFBC0,0x973A,0x0000, 0xFBC0,0x973B,0x0000,
+0xFBC0,0x973C,0x0000, 0xFBC0,0x973D,0x0000, 0xFBC0,0x973E,0x0000,
+0xFBC0,0x973F,0x0000, 0x190B,0x0000,0x0000, 0x190C,0x0000,0x0000,
+0x190D,0x0000,0x0000, 0x190E,0x0000,0x0000, 0x190F,0x0000,0x0000,
+0x1910,0x0000,0x0000, 0x1911,0x0000,0x0000, 0x1912,0x0000,0x0000,
+0x1913,0x0000,0x0000, 0x1914,0x0000,0x0000, 0x1915,0x0000,0x0000,
+0x1916,0x0000,0x0000, 0x1917,0x0000,0x0000, 0x1918,0x0000,0x0000,
+0x1919,0x0000,0x0000, 0x191A,0x0000,0x0000, 0x191B,0x0000,0x0000,
+0x191C,0x0000,0x0000, 0x191D,0x0000,0x0000, 0x191E,0x0000,0x0000,
+0xFBC0,0x9754,0x0000, 0xFBC0,0x9755,0x0000, 0xFBC0,0x9756,0x0000,
+0xFBC0,0x9757,0x0000, 0xFBC0,0x9758,0x0000, 0xFBC0,0x9759,0x0000,
+0xFBC0,0x975A,0x0000, 0xFBC0,0x975B,0x0000, 0xFBC0,0x975C,0x0000,
+0xFBC0,0x975D,0x0000, 0xFBC0,0x975E,0x0000, 0xFBC0,0x975F,0x0000,
+0x191F,0x0000,0x0000, 0x1920,0x0000,0x0000, 0x1921,0x0000,0x0000,
+0x1922,0x0000,0x0000, 0x1923,0x0000,0x0000, 0x1924,0x0000,0x0000,
+0x1925,0x0000,0x0000, 0x1926,0x0000,0x0000, 0x1927,0x0000,0x0000,
+0x1928,0x0000,0x0000, 0x1929,0x0000,0x0000, 0x192A,0x0000,0x0000,
+0x192B,0x0000,0x0000, 0xFBC0,0x976D,0x0000, 0x192C,0x0000,0x0000,
+0x192D,0x0000,0x0000, 0x192E,0x0000,0x0000, 0xFBC0,0x9771,0x0000,
+0x192F,0x0000,0x0000, 0x1930,0x0000,0x0000, 0xFBC0,0x9774,0x0000,
+0xFBC0,0x9775,0x0000, 0xFBC0,0x9776,0x0000, 0xFBC0,0x9777,0x0000,
+0xFBC0,0x9778,0x0000, 0xFBC0,0x9779,0x0000, 0xFBC0,0x977A,0x0000,
+0xFBC0,0x977B,0x0000, 0xFBC0,0x977C,0x0000, 0xFBC0,0x977D,0x0000,
+0xFBC0,0x977E,0x0000, 0xFBC0,0x977F,0x0000, 0x196C,0x0000,0x0000,
+0x196D,0x0000,0x0000, 0x196E,0x0000,0x0000, 0x196F,0x0000,0x0000,
+0x1970,0x0000,0x0000, 0x1971,0x0000,0x0000, 0x1972,0x0000,0x0000,
+0x1973,0x0000,0x0000, 0x1974,0x0000,0x0000, 0x1975,0x0000,0x0000,
+0x1976,0x0000,0x0000, 0x1977,0x0000,0x0000, 0x1978,0x0000,0x0000,
+0x1979,0x0000,0x0000, 0x197A,0x0000,0x0000, 0x197B,0x0000,0x0000,
+0x197C,0x0000,0x0000, 0x197D,0x0000,0x0000, 0x197E,0x0000,0x0000,
+0x197F,0x0000,0x0000, 0x1980,0x0000,0x0000, 0x1981,0x0000,0x0000,
+0x1982,0x0000,0x0000, 0x1983,0x0000,0x0000, 0x1984,0x0000,0x0000,
+0x1985,0x0000,0x0000, 0x1986,0x0000,0x0000, 0x1987,0x0000,0x0000,
+0x1988,0x0000,0x0000, 0x1989,0x0000,0x0000, 0x198A,0x0000,0x0000,
+0x198B,0x0000,0x0000, 0x198C,0x0000,0x0000, 0x198D,0x0000,0x0000,
+0x198E,0x0000,0x0000, 0x1990,0x0000,0x0000, 0x1991,0x0000,0x0000,
+0x1992,0x0000,0x0000, 0x1993,0x0000,0x0000, 0x1994,0x0000,0x0000,
+0x1995,0x0000,0x0000, 0x1996,0x0000,0x0000, 0x1997,0x0000,0x0000,
+0x1998,0x0000,0x0000, 0x1999,0x0000,0x0000, 0x199A,0x0000,0x0000,
+0x199B,0x0000,0x0000, 0x199C,0x0000,0x0000, 0x199D,0x0000,0x0000,
+0x199E,0x0000,0x0000, 0x199F,0x0000,0x0000, 0x19A0,0x0000,0x0000,
+0x19A1,0x0000,0x0000, 0x19A2,0x0000,0x0000, 0x19A3,0x0000,0x0000,
+0x19A4,0x0000,0x0000, 0x19A5,0x0000,0x0000, 0x19A6,0x0000,0x0000,
+0x19A7,0x0000,0x0000, 0x19A8,0x0000,0x0000, 0x19A9,0x0000,0x0000,
+0x19AA,0x0000,0x0000, 0x19AB,0x0000,0x0000, 0x19AC,0x0000,0x0000,
+0x19AD,0x0000,0x0000, 0x19AE,0x0000,0x0000, 0x19AF,0x0000,0x0000,
+0x19B0,0x0000,0x0000, 0x19B1,0x0000,0x0000, 0x19B2,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x19B3,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x026E,0x0000,0x0000,
+0x026F,0x0000,0x0000, 0x024D,0x0000,0x0000, 0x0312,0x0000,0x0000,
+0x0313,0x0000,0x0000, 0x0314,0x0000,0x0000, 0x0315,0x0000,0x0000,
+0x0E17,0x0000,0x0000, 0x198F,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x97DE,0x0000, 0xFBC0,0x97DF,0x0000, 0x0E29,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0xFBC0,0x97EA,0x0000, 0xFBC0,0x97EB,0x0000, 0xFBC0,0x97EC,0x0000,
+0xFBC0,0x97ED,0x0000, 0xFBC0,0x97EE,0x0000, 0xFBC0,0x97EF,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0xFBC0,0x97FA,0x0000, 0xFBC0,0x97FB,0x0000,
+0xFBC0,0x97FC,0x0000, 0xFBC0,0x97FD,0x0000, 0xFBC0,0x97FE,0x0000,
+0xFBC0,0x97FF,0x0000 };
+
+static uint16 page018data[]= { /* 1800 (3 weights per char) */
+0x02F8,0x0000,0x0000, 0x025E,0x0000,0x0000, 0x0235,0x0000,0x0000,
+0x0263,0x0000,0x0000, 0x024A,0x0000,0x0000, 0x024B,0x0000,0x0000,
+0x0223,0x0000,0x0000, 0x0224,0x0000,0x0000, 0x0236,0x0000,0x0000,
+0x0264,0x0000,0x0000, 0x02F9,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x980F,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000,
+0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000,
+0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000,
+0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0xFBC0,0x981A,0x0000,
+0xFBC0,0x981B,0x0000, 0xFBC0,0x981C,0x0000, 0xFBC0,0x981D,0x0000,
+0xFBC0,0x981E,0x0000, 0xFBC0,0x981F,0x0000, 0x19DF,0x0000,0x0000,
+0x19E1,0x0000,0x0000, 0x19E4,0x0000,0x0000, 0x19EA,0x0000,0x0000,
+0x19EC,0x0000,0x0000, 0x19EF,0x0000,0x0000, 0x19F1,0x0000,0x0000,
+0x19F4,0x0000,0x0000, 0x19F5,0x0000,0x0000, 0x19F6,0x0000,0x0000,
+0x19FB,0x0000,0x0000, 0x19FD,0x0000,0x0000, 0x1A00,0x0000,0x0000,
+0x1A02,0x0000,0x0000, 0x1A07,0x0000,0x0000, 0x1A09,0x0000,0x0000,
+0x1A0A,0x0000,0x0000, 0x1A0B,0x0000,0x0000, 0x1A12,0x0000,0x0000,
+0x1A15,0x0000,0x0000, 0x1A18,0x0000,0x0000, 0x1A1D,0x0000,0x0000,
+0x1A21,0x0000,0x0000, 0x1A24,0x0000,0x0000, 0x1A26,0x0000,0x0000,
+0x1A28,0x0000,0x0000, 0x1A2B,0x0000,0x0000, 0x1A30,0x0000,0x0000,
+0x1A31,0x0000,0x0000, 0x1A34,0x0000,0x0000, 0x1A38,0x0000,0x0000,
+0x1A3B,0x0000,0x0000, 0x1A3C,0x0000,0x0000, 0x1A3D,0x0000,0x0000,
+0x1A3E,0x0000,0x0000, 0x19DE,0x0000,0x0000, 0x19E2,0x0000,0x0000,
+0x19E5,0x0000,0x0000, 0x19EB,0x0000,0x0000, 0x19ED,0x0000,0x0000,
+0x19F0,0x0000,0x0000, 0x19F2,0x0000,0x0000, 0x19F7,0x0000,0x0000,
+0x19FC,0x0000,0x0000, 0x19FE,0x0000,0x0000, 0x1A01,0x0000,0x0000,
+0x1A03,0x0000,0x0000, 0x1A08,0x0000,0x0000, 0x1A13,0x0000,0x0000,
+0x1A16,0x0000,0x0000, 0x1A19,0x0000,0x0000, 0x1A1E,0x0000,0x0000,
+0x1A32,0x0000,0x0000, 0x1A22,0x0000,0x0000, 0x1A27,0x0000,0x0000,
+0x1A2C,0x0000,0x0000, 0x1A36,0x0000,0x0000, 0x1A39,0x0000,0x0000,
+0x1A3F,0x0000,0x0000, 0x1A40,0x0000,0x0000, 0x1A1B,0x0000,0x0000,
+0x19E3,0x0000,0x0000, 0x19E6,0x0000,0x0000, 0x19E9,0x0000,0x0000,
+0x19F3,0x0000,0x0000, 0x19EE,0x0000,0x0000, 0x19F8,0x0000,0x0000,
+0x1A2D,0x0000,0x0000, 0x1A04,0x0000,0x0000, 0x1A06,0x0000,0x0000,
+0x19FF,0x0000,0x0000, 0x1A0C,0x0000,0x0000, 0x1A14,0x0000,0x0000,
+0x1A17,0x0000,0x0000, 0x1A1F,0x0000,0x0000, 0x1A29,0x0000,0x0000,
+0x1A37,0x0000,0x0000, 0x1A3A,0x0000,0x0000, 0x1A33,0x0000,0x0000,
+0x1A35,0x0000,0x0000, 0x1A41,0x0000,0x0000, 0x1A1A,0x0000,0x0000,
+0x1A23,0x0000,0x0000, 0x19E7,0x0000,0x0000, 0x1A2E,0x0000,0x0000,
+0x1A25,0x0000,0x0000, 0x1A2A,0x0000,0x0000, 0x1A20,0x0000,0x0000,
+0xFBC0,0x9878,0x0000, 0xFBC0,0x9879,0x0000, 0xFBC0,0x987A,0x0000,
+0xFBC0,0x987B,0x0000, 0xFBC0,0x987C,0x0000, 0xFBC0,0x987D,0x0000,
+0xFBC0,0x987E,0x0000, 0xFBC0,0x987F,0x0000, 0x19D7,0x0000,0x0000,
+0x19D8,0x0000,0x0000, 0x19D9,0x0000,0x0000, 0x19DA,0x0000,0x0000,
+0x19DB,0x0000,0x0000, 0x19DC,0x0000,0x0000, 0x19DD,0x0000,0x0000,
+0x19E0,0x0000,0x0000, 0x19E8,0x0000,0x0000, 0x1A2F,0x0000,0x0000,
+0x19F9,0x0000,0x0000, 0x1A1C,0x0000,0x0000, 0x1A42,0x0000,0x0000,
+0x1A44,0x0000,0x0000, 0x1A45,0x0000,0x0000, 0x1A47,0x0000,0x0000,
+0x1A48,0x0000,0x0000, 0x1A4B,0x0000,0x0000, 0x1A4D,0x0000,0x0000,
+0x1A4E,0x0000,0x0000, 0x1A50,0x0000,0x0000, 0x1A52,0x0000,0x0000,
+0x1A54,0x0000,0x0000, 0x1A55,0x0000,0x0000, 0x1A49,0x0000,0x0000,
+0x1A53,0x0000,0x0000, 0x1A05,0x0000,0x0000, 0x19FA,0x0000,0x0000,
+0x1A0D,0x0000,0x0000, 0x1A0E,0x0000,0x0000, 0x1A43,0x0000,0x0000,
+0x1A46,0x0000,0x0000, 0x1A4A,0x0000,0x0000, 0x1A4C,0x0000,0x0000,
+0x1A0F,0x0000,0x0000, 0x1A51,0x0000,0x0000, 0x1A10,0x0000,0x0000,
+0x1A11,0x0000,0x0000, 0x1A56,0x0000,0x0000, 0x1A57,0x0000,0x0000,
+0x1A4F,0x0000,0x0000, 0x1A58,0x0000,0x0000, 0xFBC0,0x98AA,0x0000,
+0xFBC0,0x98AB,0x0000, 0xFBC0,0x98AC,0x0000, 0xFBC0,0x98AD,0x0000,
+0xFBC0,0x98AE,0x0000, 0xFBC0,0x98AF,0x0000, 0xFBC0,0x98B0,0x0000,
+0xFBC0,0x98B1,0x0000, 0xFBC0,0x98B2,0x0000, 0xFBC0,0x98B3,0x0000,
+0xFBC0,0x98B4,0x0000, 0xFBC0,0x98B5,0x0000, 0xFBC0,0x98B6,0x0000,
+0xFBC0,0x98B7,0x0000, 0xFBC0,0x98B8,0x0000, 0xFBC0,0x98B9,0x0000,
+0xFBC0,0x98BA,0x0000, 0xFBC0,0x98BB,0x0000, 0xFBC0,0x98BC,0x0000,
+0xFBC0,0x98BD,0x0000, 0xFBC0,0x98BE,0x0000, 0xFBC0,0x98BF,0x0000,
+0xFBC0,0x98C0,0x0000, 0xFBC0,0x98C1,0x0000, 0xFBC0,0x98C2,0x0000,
+0xFBC0,0x98C3,0x0000, 0xFBC0,0x98C4,0x0000, 0xFBC0,0x98C5,0x0000,
+0xFBC0,0x98C6,0x0000, 0xFBC0,0x98C7,0x0000, 0xFBC0,0x98C8,0x0000,
+0xFBC0,0x98C9,0x0000, 0xFBC0,0x98CA,0x0000, 0xFBC0,0x98CB,0x0000,
+0xFBC0,0x98CC,0x0000, 0xFBC0,0x98CD,0x0000, 0xFBC0,0x98CE,0x0000,
+0xFBC0,0x98CF,0x0000, 0xFBC0,0x98D0,0x0000, 0xFBC0,0x98D1,0x0000,
+0xFBC0,0x98D2,0x0000, 0xFBC0,0x98D3,0x0000, 0xFBC0,0x98D4,0x0000,
+0xFBC0,0x98D5,0x0000, 0xFBC0,0x98D6,0x0000, 0xFBC0,0x98D7,0x0000,
+0xFBC0,0x98D8,0x0000, 0xFBC0,0x98D9,0x0000, 0xFBC0,0x98DA,0x0000,
+0xFBC0,0x98DB,0x0000, 0xFBC0,0x98DC,0x0000, 0xFBC0,0x98DD,0x0000,
+0xFBC0,0x98DE,0x0000, 0xFBC0,0x98DF,0x0000, 0xFBC0,0x98E0,0x0000,
+0xFBC0,0x98E1,0x0000, 0xFBC0,0x98E2,0x0000, 0xFBC0,0x98E3,0x0000,
+0xFBC0,0x98E4,0x0000, 0xFBC0,0x98E5,0x0000, 0xFBC0,0x98E6,0x0000,
+0xFBC0,0x98E7,0x0000, 0xFBC0,0x98E8,0x0000, 0xFBC0,0x98E9,0x0000,
+0xFBC0,0x98EA,0x0000, 0xFBC0,0x98EB,0x0000, 0xFBC0,0x98EC,0x0000,
+0xFBC0,0x98ED,0x0000, 0xFBC0,0x98EE,0x0000, 0xFBC0,0x98EF,0x0000,
+0xFBC0,0x98F0,0x0000, 0xFBC0,0x98F1,0x0000, 0xFBC0,0x98F2,0x0000,
+0xFBC0,0x98F3,0x0000, 0xFBC0,0x98F4,0x0000, 0xFBC0,0x98F5,0x0000,
+0xFBC0,0x98F6,0x0000, 0xFBC0,0x98F7,0x0000, 0xFBC0,0x98F8,0x0000,
+0xFBC0,0x98F9,0x0000, 0xFBC0,0x98FA,0x0000, 0xFBC0,0x98FB,0x0000,
+0xFBC0,0x98FC,0x0000, 0xFBC0,0x98FD,0x0000, 0xFBC0,0x98FE,0x0000,
+0xFBC0,0x98FF,0x0000 };
+
+static uint16 page019data[]= { /* 1900 (3 weights per char) */
+0x18B0,0x0000,0x0000, 0x18B1,0x0000,0x0000, 0x18B2,0x0000,0x0000,
+0x18B3,0x0000,0x0000, 0x18B4,0x0000,0x0000, 0x18B5,0x0000,0x0000,
+0x18B6,0x0000,0x0000, 0x18B7,0x0000,0x0000, 0x18B8,0x0000,0x0000,
+0x18B9,0x0000,0x0000, 0x18BA,0x0000,0x0000, 0x18BB,0x0000,0x0000,
+0x18BC,0x0000,0x0000, 0x18BD,0x0000,0x0000, 0x18BE,0x0000,0x0000,
+0x18BF,0x0000,0x0000, 0x18C0,0x0000,0x0000, 0x18C1,0x0000,0x0000,
+0x18C2,0x0000,0x0000, 0x18C3,0x0000,0x0000, 0x18C4,0x0000,0x0000,
+0x18C5,0x0000,0x0000, 0x18C6,0x0000,0x0000, 0x18C7,0x0000,0x0000,
+0x18C8,0x0000,0x0000, 0x18C9,0x0000,0x0000, 0x18CA,0x0000,0x0000,
+0x18CB,0x0000,0x0000, 0x18CC,0x0000,0x0000, 0xFBC0,0x991D,0x0000,
+0xFBC0,0x991E,0x0000, 0xFBC0,0x991F,0x0000, 0x18CD,0x0000,0x0000,
+0x18CE,0x0000,0x0000, 0x18CF,0x0000,0x0000, 0x18D0,0x0000,0x0000,
+0x18D1,0x0000,0x0000, 0x18D2,0x0000,0x0000, 0x18D3,0x0000,0x0000,
+0x18D4,0x0000,0x0000, 0x18D5,0x0000,0x0000, 0x18D6,0x0000,0x0000,
+0x18D7,0x0000,0x0000, 0x18D8,0x0000,0x0000, 0xFBC0,0x992C,0x0000,
+0xFBC0,0x992D,0x0000, 0xFBC0,0x992E,0x0000, 0xFBC0,0x992F,0x0000,
+0x18D9,0x0000,0x0000, 0x18DA,0x0000,0x0000, 0x18DB,0x0000,0x0000,
+0x18DC,0x0000,0x0000, 0x18DD,0x0000,0x0000, 0x18DE,0x0000,0x0000,
+0x18DF,0x0000,0x0000, 0x18E0,0x0000,0x0000, 0x18E1,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x993C,0x0000, 0xFBC0,0x993D,0x0000, 0xFBC0,0x993E,0x0000,
+0xFBC0,0x993F,0x0000, 0x030D,0x0000,0x0000, 0xFBC0,0x9941,0x0000,
+0xFBC0,0x9942,0x0000, 0xFBC0,0x9943,0x0000, 0x0254,0x0000,0x0000,
+0x025B,0x0000,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000,
+0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000,
+0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000,
+0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0x19B4,0x0000,0x0000,
+0x19B5,0x0000,0x0000, 0x19B6,0x0000,0x0000, 0x19B7,0x0000,0x0000,
+0x19B8,0x0000,0x0000, 0x19B9,0x0000,0x0000, 0x19BA,0x0000,0x0000,
+0x19BB,0x0000,0x0000, 0x19BC,0x0000,0x0000, 0x19BD,0x0000,0x0000,
+0x19BE,0x0000,0x0000, 0x19BF,0x0000,0x0000, 0x19C0,0x0000,0x0000,
+0x19C1,0x0000,0x0000, 0x19C2,0x0000,0x0000, 0x19C3,0x0000,0x0000,
+0x19C4,0x0000,0x0000, 0x19C5,0x0000,0x0000, 0x19C6,0x0000,0x0000,
+0x19C7,0x0000,0x0000, 0x19C8,0x0000,0x0000, 0x19C9,0x0000,0x0000,
+0x19CA,0x0000,0x0000, 0x19CB,0x0000,0x0000, 0x19CC,0x0000,0x0000,
+0x19CD,0x0000,0x0000, 0x19CE,0x0000,0x0000, 0x19CF,0x0000,0x0000,
+0x19D0,0x0000,0x0000, 0x19D1,0x0000,0x0000, 0xFBC0,0x996E,0x0000,
+0xFBC0,0x996F,0x0000, 0x19D2,0x0000,0x0000, 0x19D3,0x0000,0x0000,
+0x19D4,0x0000,0x0000, 0x19D5,0x0000,0x0000, 0x19D6,0x0000,0x0000,
+0xFBC0,0x9975,0x0000, 0xFBC0,0x9976,0x0000, 0xFBC0,0x9977,0x0000,
+0xFBC0,0x9978,0x0000, 0xFBC0,0x9979,0x0000, 0xFBC0,0x997A,0x0000,
+0xFBC0,0x997B,0x0000, 0xFBC0,0x997C,0x0000, 0xFBC0,0x997D,0x0000,
+0xFBC0,0x997E,0x0000, 0xFBC0,0x997F,0x0000, 0xFBC0,0x9980,0x0000,
+0xFBC0,0x9981,0x0000, 0xFBC0,0x9982,0x0000, 0xFBC0,0x9983,0x0000,
+0xFBC0,0x9984,0x0000, 0xFBC0,0x9985,0x0000, 0xFBC0,0x9986,0x0000,
+0xFBC0,0x9987,0x0000, 0xFBC0,0x9988,0x0000, 0xFBC0,0x9989,0x0000,
+0xFBC0,0x998A,0x0000, 0xFBC0,0x998B,0x0000, 0xFBC0,0x998C,0x0000,
+0xFBC0,0x998D,0x0000, 0xFBC0,0x998E,0x0000, 0xFBC0,0x998F,0x0000,
+0xFBC0,0x9990,0x0000, 0xFBC0,0x9991,0x0000, 0xFBC0,0x9992,0x0000,
+0xFBC0,0x9993,0x0000, 0xFBC0,0x9994,0x0000, 0xFBC0,0x9995,0x0000,
+0xFBC0,0x9996,0x0000, 0xFBC0,0x9997,0x0000, 0xFBC0,0x9998,0x0000,
+0xFBC0,0x9999,0x0000, 0xFBC0,0x999A,0x0000, 0xFBC0,0x999B,0x0000,
+0xFBC0,0x999C,0x0000, 0xFBC0,0x999D,0x0000, 0xFBC0,0x999E,0x0000,
+0xFBC0,0x999F,0x0000, 0xFBC0,0x99A0,0x0000, 0xFBC0,0x99A1,0x0000,
+0xFBC0,0x99A2,0x0000, 0xFBC0,0x99A3,0x0000, 0xFBC0,0x99A4,0x0000,
+0xFBC0,0x99A5,0x0000, 0xFBC0,0x99A6,0x0000, 0xFBC0,0x99A7,0x0000,
+0xFBC0,0x99A8,0x0000, 0xFBC0,0x99A9,0x0000, 0xFBC0,0x99AA,0x0000,
+0xFBC0,0x99AB,0x0000, 0xFBC0,0x99AC,0x0000, 0xFBC0,0x99AD,0x0000,
+0xFBC0,0x99AE,0x0000, 0xFBC0,0x99AF,0x0000, 0xFBC0,0x99B0,0x0000,
+0xFBC0,0x99B1,0x0000, 0xFBC0,0x99B2,0x0000, 0xFBC0,0x99B3,0x0000,
+0xFBC0,0x99B4,0x0000, 0xFBC0,0x99B5,0x0000, 0xFBC0,0x99B6,0x0000,
+0xFBC0,0x99B7,0x0000, 0xFBC0,0x99B8,0x0000, 0xFBC0,0x99B9,0x0000,
+0xFBC0,0x99BA,0x0000, 0xFBC0,0x99BB,0x0000, 0xFBC0,0x99BC,0x0000,
+0xFBC0,0x99BD,0x0000, 0xFBC0,0x99BE,0x0000, 0xFBC0,0x99BF,0x0000,
+0xFBC0,0x99C0,0x0000, 0xFBC0,0x99C1,0x0000, 0xFBC0,0x99C2,0x0000,
+0xFBC0,0x99C3,0x0000, 0xFBC0,0x99C4,0x0000, 0xFBC0,0x99C5,0x0000,
+0xFBC0,0x99C6,0x0000, 0xFBC0,0x99C7,0x0000, 0xFBC0,0x99C8,0x0000,
+0xFBC0,0x99C9,0x0000, 0xFBC0,0x99CA,0x0000, 0xFBC0,0x99CB,0x0000,
+0xFBC0,0x99CC,0x0000, 0xFBC0,0x99CD,0x0000, 0xFBC0,0x99CE,0x0000,
+0xFBC0,0x99CF,0x0000, 0xFBC0,0x99D0,0x0000, 0xFBC0,0x99D1,0x0000,
+0xFBC0,0x99D2,0x0000, 0xFBC0,0x99D3,0x0000, 0xFBC0,0x99D4,0x0000,
+0xFBC0,0x99D5,0x0000, 0xFBC0,0x99D6,0x0000, 0xFBC0,0x99D7,0x0000,
+0xFBC0,0x99D8,0x0000, 0xFBC0,0x99D9,0x0000, 0xFBC0,0x99DA,0x0000,
+0xFBC0,0x99DB,0x0000, 0xFBC0,0x99DC,0x0000, 0xFBC0,0x99DD,0x0000,
+0xFBC0,0x99DE,0x0000, 0xFBC0,0x99DF,0x0000, 0x037B,0x0000,0x0000,
+0x037C,0x0000,0x0000, 0x037D,0x0000,0x0000, 0x037E,0x0000,0x0000,
+0x037F,0x0000,0x0000, 0x0380,0x0000,0x0000, 0x0381,0x0000,0x0000,
+0x0382,0x0000,0x0000, 0x0383,0x0000,0x0000, 0x0384,0x0000,0x0000,
+0x0385,0x0000,0x0000, 0x0386,0x0000,0x0000, 0x0387,0x0000,0x0000,
+0x0388,0x0000,0x0000, 0x0389,0x0000,0x0000, 0x038A,0x0000,0x0000,
+0x038B,0x0000,0x0000, 0x038C,0x0000,0x0000, 0x038D,0x0000,0x0000,
+0x038E,0x0000,0x0000, 0x038F,0x0000,0x0000, 0x0390,0x0000,0x0000,
+0x0391,0x0000,0x0000, 0x0392,0x0000,0x0000, 0x0393,0x0000,0x0000,
+0x0394,0x0000,0x0000, 0x0395,0x0000,0x0000, 0x0396,0x0000,0x0000,
+0x0397,0x0000,0x0000, 0x0398,0x0000,0x0000, 0x0399,0x0000,0x0000,
+0x039A,0x0000,0x0000 };
+
+static uint16 page01Ddata[]= { /* 1D00 (3 weights per char) */
+0x0E37,0x0000,0x0000, 0x0E3C,0x0000,0x0000, 0x0E3D,0x0000,0x0000,
+0x0E57,0x0000,0x0000, 0x0E64,0x0000,0x0000, 0x0E71,0x0000,0x0000,
+0x0E8A,0x0000,0x0000, 0x0E8F,0x0000,0x0000, 0x0EA8,0x0000,0x0000,
+0x0F07,0x0000,0x0000, 0x0F14,0x0000,0x0000, 0x0F25,0x0000,0x0000,
+0x0F3A,0x0000,0x0000, 0x0F5F,0x0000,0x0000, 0x0F6D,0x0000,0x0000,
+0x0F86,0x0000,0x0000, 0x0F96,0x0000,0x0000, 0x0F87,0x0000,0x0000,
+0x0F97,0x0000,0x0000, 0x0F91,0x0000,0x0000, 0x0F8C,0x0000,0x0000,
+0x0FA6,0x0000,0x0000, 0x0F98,0x0000,0x0000, 0x0F99,0x0000,0x0000,
+0x0FAB,0x0000,0x0000, 0x0FC8,0x0000,0x0000, 0x0FCD,0x0000,0x0000,
+0x1006,0x0000,0x0000, 0x1023,0x0000,0x0000, 0x1024,0x0000,0x0000,
+0x1025,0x0000,0x0000, 0x103B,0x0000,0x0000, 0x1048,0x0000,0x0000,
+0x1055,0x0000,0x0000, 0x106E,0x0000,0x0000, 0x1083,0x0000,0x0000,
+0x10BA,0x0000,0x0000, 0x10BB,0x0000,0x0000, 0x10EB,0x0000,0x0000,
+0x10F7,0x0000,0x0000, 0x10FD,0x0000,0x0000, 0x1101,0x0000,0x0000,
+0x1108,0x0000,0x0000, 0x11B4,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E38,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E56,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E90,0x0000,0x0000,
+0x0EC1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0F10,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F2E,0x0000,0x0000,
+0x0F5B,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F6C,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0FA2,0x0000,0x0000, 0x0FA7,0x0000,0x0000,
+0x0FC0,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E3E,0x0000,0x0000,
+0x0E42,0x0000,0x0000, 0x0E3D,0x0000,0x0000, 0x0E4A,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E94,0x0000,0x0000,
+0x0E98,0x0000,0x0000, 0x0EA8,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0F07,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F5B,0x0000,0x0000,
+0x0F7E,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F92,0x0000,0x0000,
+0x0F98,0x0000,0x0000, 0x0F99,0x0000,0x0000, 0x0FA7,0x0000,0x0000,
+0x1002,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x1024,0x0000,0x0000,
+0x1037,0x0000,0x0000, 0x1044,0x0000,0x0000, 0x10BB,0x0000,0x0000,
+0x10E9,0x0000,0x0000, 0x10EA,0x0000,0x0000, 0x10EC,0x0000,0x0000,
+0x1105,0x0000,0x0000, 0x1106,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0FC0,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x1044,0x0000,0x0000,
+0x10E9,0x0000,0x0000, 0x10EA,0x0000,0x0000, 0x1100,0x0000,0x0000,
+0x1105,0x0000,0x0000, 0x1106,0x0000,0x0000, 0x1026,0x0000,0x0000,
+0xFBC0,0x9D6C,0x0000, 0xFBC0,0x9D6D,0x0000, 0xFBC0,0x9D6E,0x0000,
+0xFBC0,0x9D6F,0x0000, 0xFBC0,0x9D70,0x0000, 0xFBC0,0x9D71,0x0000,
+0xFBC0,0x9D72,0x0000, 0xFBC0,0x9D73,0x0000, 0xFBC0,0x9D74,0x0000,
+0xFBC0,0x9D75,0x0000, 0xFBC0,0x9D76,0x0000, 0xFBC0,0x9D77,0x0000,
+0xFBC0,0x9D78,0x0000, 0xFBC0,0x9D79,0x0000, 0xFBC0,0x9D7A,0x0000,
+0xFBC0,0x9D7B,0x0000, 0xFBC0,0x9D7C,0x0000, 0xFBC0,0x9D7D,0x0000,
+0xFBC0,0x9D7E,0x0000, 0xFBC0,0x9D7F,0x0000, 0xFBC0,0x9D80,0x0000,
+0xFBC0,0x9D81,0x0000, 0xFBC0,0x9D82,0x0000, 0xFBC0,0x9D83,0x0000,
+0xFBC0,0x9D84,0x0000, 0xFBC0,0x9D85,0x0000, 0xFBC0,0x9D86,0x0000,
+0xFBC0,0x9D87,0x0000, 0xFBC0,0x9D88,0x0000, 0xFBC0,0x9D89,0x0000,
+0xFBC0,0x9D8A,0x0000, 0xFBC0,0x9D8B,0x0000, 0xFBC0,0x9D8C,0x0000,
+0xFBC0,0x9D8D,0x0000, 0xFBC0,0x9D8E,0x0000, 0xFBC0,0x9D8F,0x0000,
+0xFBC0,0x9D90,0x0000, 0xFBC0,0x9D91,0x0000, 0xFBC0,0x9D92,0x0000,
+0xFBC0,0x9D93,0x0000, 0xFBC0,0x9D94,0x0000, 0xFBC0,0x9D95,0x0000,
+0xFBC0,0x9D96,0x0000, 0xFBC0,0x9D97,0x0000, 0xFBC0,0x9D98,0x0000,
+0xFBC0,0x9D99,0x0000, 0xFBC0,0x9D9A,0x0000, 0xFBC0,0x9D9B,0x0000,
+0xFBC0,0x9D9C,0x0000, 0xFBC0,0x9D9D,0x0000, 0xFBC0,0x9D9E,0x0000,
+0xFBC0,0x9D9F,0x0000, 0xFBC0,0x9DA0,0x0000, 0xFBC0,0x9DA1,0x0000,
+0xFBC0,0x9DA2,0x0000, 0xFBC0,0x9DA3,0x0000, 0xFBC0,0x9DA4,0x0000,
+0xFBC0,0x9DA5,0x0000, 0xFBC0,0x9DA6,0x0000, 0xFBC0,0x9DA7,0x0000,
+0xFBC0,0x9DA8,0x0000, 0xFBC0,0x9DA9,0x0000, 0xFBC0,0x9DAA,0x0000,
+0xFBC0,0x9DAB,0x0000, 0xFBC0,0x9DAC,0x0000, 0xFBC0,0x9DAD,0x0000,
+0xFBC0,0x9DAE,0x0000, 0xFBC0,0x9DAF,0x0000, 0xFBC0,0x9DB0,0x0000,
+0xFBC0,0x9DB1,0x0000, 0xFBC0,0x9DB2,0x0000, 0xFBC0,0x9DB3,0x0000,
+0xFBC0,0x9DB4,0x0000, 0xFBC0,0x9DB5,0x0000, 0xFBC0,0x9DB6,0x0000,
+0xFBC0,0x9DB7,0x0000, 0xFBC0,0x9DB8,0x0000, 0xFBC0,0x9DB9,0x0000,
+0xFBC0,0x9DBA,0x0000, 0xFBC0,0x9DBB,0x0000, 0xFBC0,0x9DBC,0x0000,
+0xFBC0,0x9DBD,0x0000, 0xFBC0,0x9DBE,0x0000, 0xFBC0,0x9DBF,0x0000,
+0xFBC0,0x9DC0,0x0000, 0xFBC0,0x9DC1,0x0000, 0xFBC0,0x9DC2,0x0000,
+0xFBC0,0x9DC3,0x0000, 0xFBC0,0x9DC4,0x0000, 0xFBC0,0x9DC5,0x0000,
+0xFBC0,0x9DC6,0x0000, 0xFBC0,0x9DC7,0x0000, 0xFBC0,0x9DC8,0x0000,
+0xFBC0,0x9DC9,0x0000, 0xFBC0,0x9DCA,0x0000, 0xFBC0,0x9DCB,0x0000,
+0xFBC0,0x9DCC,0x0000, 0xFBC0,0x9DCD,0x0000, 0xFBC0,0x9DCE,0x0000,
+0xFBC0,0x9DCF,0x0000, 0xFBC0,0x9DD0,0x0000, 0xFBC0,0x9DD1,0x0000,
+0xFBC0,0x9DD2,0x0000, 0xFBC0,0x9DD3,0x0000, 0xFBC0,0x9DD4,0x0000,
+0xFBC0,0x9DD5,0x0000, 0xFBC0,0x9DD6,0x0000, 0xFBC0,0x9DD7,0x0000,
+0xFBC0,0x9DD8,0x0000, 0xFBC0,0x9DD9,0x0000, 0xFBC0,0x9DDA,0x0000,
+0xFBC0,0x9DDB,0x0000, 0xFBC0,0x9DDC,0x0000, 0xFBC0,0x9DDD,0x0000,
+0xFBC0,0x9DDE,0x0000, 0xFBC0,0x9DDF,0x0000, 0xFBC0,0x9DE0,0x0000,
+0xFBC0,0x9DE1,0x0000, 0xFBC0,0x9DE2,0x0000, 0xFBC0,0x9DE3,0x0000,
+0xFBC0,0x9DE4,0x0000, 0xFBC0,0x9DE5,0x0000, 0xFBC0,0x9DE6,0x0000,
+0xFBC0,0x9DE7,0x0000, 0xFBC0,0x9DE8,0x0000, 0xFBC0,0x9DE9,0x0000,
+0xFBC0,0x9DEA,0x0000, 0xFBC0,0x9DEB,0x0000, 0xFBC0,0x9DEC,0x0000,
+0xFBC0,0x9DED,0x0000, 0xFBC0,0x9DEE,0x0000, 0xFBC0,0x9DEF,0x0000,
+0xFBC0,0x9DF0,0x0000, 0xFBC0,0x9DF1,0x0000, 0xFBC0,0x9DF2,0x0000,
+0xFBC0,0x9DF3,0x0000, 0xFBC0,0x9DF4,0x0000, 0xFBC0,0x9DF5,0x0000,
+0xFBC0,0x9DF6,0x0000, 0xFBC0,0x9DF7,0x0000, 0xFBC0,0x9DF8,0x0000,
+0xFBC0,0x9DF9,0x0000, 0xFBC0,0x9DFA,0x0000, 0xFBC0,0x9DFB,0x0000,
+0xFBC0,0x9DFC,0x0000, 0xFBC0,0x9DFD,0x0000, 0xFBC0,0x9DFE,0x0000,
+0xFBC0,0x9DFF,0x0000 };
+
+static uint16 page01Edata[]= { /* 1E00 (3 weights per char) */
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E4A,0x0000,0x0000,
+0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000,
+0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E60,0x0000,0x0000,
+0x0E60,0x0000,0x0000, 0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0EB9,0x0000,0x0000, 0x0EB9,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EC1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000,
+0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000,
+0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000,
+0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000,
+0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F5B,0x0000,0x0000,
+0x0F5B,0x0000,0x0000, 0x0F5B,0x0000,0x0000, 0x0F5B,0x0000,0x0000,
+0x0F5B,0x0000,0x0000, 0x0F5B,0x0000,0x0000, 0x0F64,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0FA7,0x0000,0x0000, 0x0FA7,0x0000,0x0000, 0x0FA7,0x0000,0x0000,
+0x0FA7,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000,
+0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000,
+0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x1044,0x0000,0x0000, 0x1044,0x0000,0x0000,
+0x1044,0x0000,0x0000, 0x1044,0x0000,0x0000, 0x1051,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000,
+0x105A,0x0000,0x0000, 0x105A,0x0000,0x0000, 0x105A,0x0000,0x0000,
+0x105A,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000,
+0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1051,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0x0E33,0x10B3,0x0000, 0x0FEA,0x0000,0x0000,
+0xFBC0,0x9E9C,0x0000, 0xFBC0,0x9E9D,0x0000, 0xFBC0,0x9E9E,0x0000,
+0xFBC0,0x9E9F,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0xFBC0,0x9EFA,0x0000, 0xFBC0,0x9EFB,0x0000,
+0xFBC0,0x9EFC,0x0000, 0xFBC0,0x9EFD,0x0000, 0xFBC0,0x9EFE,0x0000,
+0xFBC0,0x9EFF,0x0000 };
+
+static uint16 page01Fdata[]= { /* 1F00 (3 weights per char) */
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000,
+0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000,
+0x10ED,0x0000,0x0000, 0xFBC0,0x9F16,0x0000, 0xFBC0,0x9F17,0x0000,
+0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000,
+0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000,
+0xFBC0,0x9F1E,0x0000, 0xFBC0,0x9F1F,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000,
+0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000,
+0x10FB,0x0000,0x0000, 0xFBC0,0x9F46,0x0000, 0xFBC0,0x9F47,0x0000,
+0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000,
+0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000,
+0xFBC0,0x9F4E,0x0000, 0xFBC0,0x9F4F,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0xFBC0,0x9F58,0x0000, 0x1104,0x0000,0x0000,
+0xFBC0,0x9F5A,0x0000, 0x1104,0x0000,0x0000, 0xFBC0,0x9F5C,0x0000,
+0x1104,0x0000,0x0000, 0xFBC0,0x9F5E,0x0000, 0x1104,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0xFBC0,0x9F7E,0x0000, 0xFBC0,0x9F7F,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0xFBC0,0x9FB5,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x0217,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x0217,0x0000,0x0000,
+0x021D,0x0000,0x0000, 0x0214,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0xFBC0,0x9FC5,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10ED,0x0000,0x0000,
+0x10ED,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x0217,0x0000,0x0000, 0x0217,0x0000,0x0000,
+0x0217,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0xFBC0,0x9FD4,0x0000,
+0xFBC0,0x9FD5,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0xFBC0,0x9FDC,0x0000, 0x0218,0x0000,0x0000,
+0x0218,0x0000,0x0000, 0x0218,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1100,0x0000,0x0000, 0x1100,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1100,0x0000,0x0000,
+0x0214,0x0000,0x0000, 0x0214,0x0000,0x0000, 0x020C,0x0000,0x0000,
+0xFBC0,0x9FF0,0x0000, 0xFBC0,0x9FF1,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0xFBC0,0x9FF5,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x10FB,0x0000,0x0000,
+0x10FB,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x020D,0x0000,0x0000, 0x0218,0x0000,0x0000,
+0xFBC0,0x9FFF,0x0000 };
+
+static uint16 page020data[]= { /* 2000 (5 weights per char) */
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0225,0x0000,0x0000,0x0000,0x0000,
+0x0225,0x0000,0x0000,0x0000,0x0000,
+0x0226,0x0000,0x0000,0x0000,0x0000,
+0x0227,0x0000,0x0000,0x0000,0x0000,
+0x0228,0x0000,0x0000,0x0000,0x0000,
+0x0229,0x0000,0x0000,0x0000,0x0000,
+0x0432,0x0000,0x0000,0x0000,0x0000,
+0x021C,0x0000,0x0000,0x0000,0x0000,
+0x0278,0x0000,0x0000,0x0000,0x0000,
+0x0279,0x0000,0x0000,0x0000,0x0000,
+0x027A,0x0000,0x0000,0x0000,0x0000,
+0x027B,0x0000,0x0000,0x0000,0x0000,
+0x027F,0x0000,0x0000,0x0000,0x0000,
+0x0280,0x0000,0x0000,0x0000,0x0000,
+0x0281,0x0000,0x0000,0x0000,0x0000,
+0x0282,0x0000,0x0000,0x0000,0x0000,
+0x02D8,0x0000,0x0000,0x0000,0x0000,
+0x02D9,0x0000,0x0000,0x0000,0x0000,
+0x02DA,0x0000,0x0000,0x0000,0x0000,
+0x02DB,0x0000,0x0000,0x0000,0x0000,
+0x025D,0x0000,0x0000,0x0000,0x0000,
+0x025D,0x025D,0x0000,0x0000,0x0000,
+0x025D,0x025D,0x025D,0x0000,0x0000,
+0x02DC,0x0000,0x0000,0x0000,0x0000,
+0x0207,0x0000,0x0000,0x0000,0x0000,
+0x0208,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x02D5,0x0000,0x0000,0x0000,0x0000,
+0x02D6,0x0000,0x0000,0x0000,0x0000,
+0x02E0,0x0000,0x0000,0x0000,0x0000,
+0x02E0,0x02E0,0x0000,0x0000,0x0000,
+0x02E0,0x02E0,0x02E0,0x0000,0x0000,
+0x02E1,0x0000,0x0000,0x0000,0x0000,
+0x02E1,0x02E1,0x0000,0x0000,0x0000,
+0x02E1,0x02E1,0x02E1,0x0000,0x0000,
+0x02E4,0x0000,0x0000,0x0000,0x0000,
+0x027C,0x0000,0x0000,0x0000,0x0000,
+0x027D,0x0000,0x0000,0x0000,0x0000,
+0x02E5,0x0000,0x0000,0x0000,0x0000,
+0x0251,0x0251,0x0000,0x0000,0x0000,
+0x025C,0x0000,0x0000,0x0000,0x0000,
+0x0211,0x0000,0x0000,0x0000,0x0000,
+0x02E6,0x0000,0x0000,0x0000,0x0000,
+0x02E8,0x0000,0x0000,0x0000,0x0000,
+0x02EA,0x0000,0x0000,0x0000,0x0000,
+0x02EB,0x0000,0x0000,0x0000,0x0000,
+0x02DD,0x0000,0x0000,0x0000,0x0000,
+0x02CD,0x0000,0x0000,0x0000,0x0000,
+0x0294,0x0000,0x0000,0x0000,0x0000,
+0x0295,0x0000,0x0000,0x0000,0x0000,
+0x0255,0x0255,0x0000,0x0000,0x0000,
+0x0255,0x0251,0x0000,0x0000,0x0000,
+0x0251,0x0255,0x0000,0x0000,0x0000,
+0x02D1,0x0000,0x0000,0x0000,0x0000,
+0x02C4,0x0000,0x0000,0x0000,0x0000,
+0x02DE,0x0000,0x0000,0x0000,0x0000,
+0x02DF,0x0000,0x0000,0x0000,0x0000,
+0x02C9,0x0000,0x0000,0x0000,0x0000,
+0x023C,0x0000,0x0000,0x0000,0x0000,
+0x02E9,0x0000,0x0000,0x0000,0x0000,
+0x02CA,0x0000,0x0000,0x0000,0x0000,
+0x02D7,0x0000,0x0000,0x0000,0x0000,
+0x022A,0x0000,0x0000,0x0000,0x0000,
+0x02E7,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA055,0x0000,0x0000,0x0000,
+0xFBC0,0xA056,0x0000,0x0000,0x0000,
+0x02E0,0x02E0,0x02E0,0x02E0,0x0000,
+0xFBC0,0xA058,0x0000,0x0000,0x0000,
+0xFBC0,0xA059,0x0000,0x0000,0x0000,
+0xFBC0,0xA05A,0x0000,0x0000,0x0000,
+0xFBC0,0xA05B,0x0000,0x0000,0x0000,
+0xFBC0,0xA05C,0x0000,0x0000,0x0000,
+0xFBC0,0xA05D,0x0000,0x0000,0x0000,
+0xFBC0,0xA05E,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA064,0x0000,0x0000,0x0000,
+0xFBC0,0xA065,0x0000,0x0000,0x0000,
+0xFBC0,0xA066,0x0000,0x0000,0x0000,
+0xFBC0,0xA067,0x0000,0x0000,0x0000,
+0xFBC0,0xA068,0x0000,0x0000,0x0000,
+0xFBC0,0xA069,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E29,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA072,0x0000,0x0000,0x0000,
+0xFBC0,0xA073,0x0000,0x0000,0x0000,
+0x0E2D,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0x0000,0x0000,0x0000,0x0000,
+0x0428,0x0000,0x0000,0x0000,0x0000,
+0x0434,0x0000,0x0000,0x0000,0x0000,
+0x042D,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x0000,0x0000,0x0000,0x0000,
+0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0000,0x0000,0x0000,0x0000,
+0x0E29,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0x0000,0x0000,0x0000,0x0000,
+0x0428,0x0000,0x0000,0x0000,0x0000,
+0x0434,0x0000,0x0000,0x0000,0x0000,
+0x042D,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x0000,0x0000,0x0000,0x0000,
+0x0289,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA08F,0x0000,0x0000,0x0000,
+0xFBC0,0xA090,0x0000,0x0000,0x0000,
+0xFBC0,0xA091,0x0000,0x0000,0x0000,
+0xFBC0,0xA092,0x0000,0x0000,0x0000,
+0xFBC0,0xA093,0x0000,0x0000,0x0000,
+0xFBC0,0xA094,0x0000,0x0000,0x0000,
+0xFBC0,0xA095,0x0000,0x0000,0x0000,
+0xFBC0,0xA096,0x0000,0x0000,0x0000,
+0xFBC0,0xA097,0x0000,0x0000,0x0000,
+0xFBC0,0xA098,0x0000,0x0000,0x0000,
+0xFBC0,0xA099,0x0000,0x0000,0x0000,
+0xFBC0,0xA09A,0x0000,0x0000,0x0000,
+0xFBC0,0xA09B,0x0000,0x0000,0x0000,
+0xFBC0,0xA09C,0x0000,0x0000,0x0000,
+0xFBC0,0xA09D,0x0000,0x0000,0x0000,
+0xFBC0,0xA09E,0x0000,0x0000,0x0000,
+0xFBC0,0xA09F,0x0000,0x0000,0x0000,
+0x0E18,0x0000,0x0000,0x0000,0x0000,
+0x0E19,0x0000,0x0000,0x0000,0x0000,
+0x0E1A,0x0000,0x0000,0x0000,0x0000,
+0x0E1B,0x0000,0x0000,0x0000,0x0000,
+0x0E1C,0x0000,0x0000,0x0000,0x0000,
+0x0E1D,0x0000,0x0000,0x0000,0x0000,
+0x0E1E,0x0000,0x0000,0x0000,0x0000,
+0x0E1F,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0FEA,0x0000,0x0000,0x0000,
+0x0E20,0x0000,0x0000,0x0000,0x0000,
+0x0E21,0x0000,0x0000,0x0000,0x0000,
+0x0E22,0x0000,0x0000,0x0000,0x0000,
+0x0E23,0x0000,0x0000,0x0000,0x0000,
+0x0E24,0x0000,0x0000,0x0000,0x0000,
+0x0E25,0x0000,0x0000,0x0000,0x0000,
+0x0E26,0x0000,0x0000,0x0000,0x0000,
+0x0E27,0x0000,0x0000,0x0000,0x0000,
+0x0E28,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B2,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B3,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B4,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B5,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B6,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B7,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B8,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B9,0x0000,0x0000,0x0000,
+0xFBC0,0xA0BA,0x0000,0x0000,0x0000,
+0xFBC0,0xA0BB,0x0000,0x0000,0x0000,
+0xFBC0,0xA0BC,0x0000,0x0000,0x0000,
+0xFBC0,0xA0BD,0x0000,0x0000,0x0000,
+0xFBC0,0xA0BE,0x0000,0x0000,0x0000,
+0xFBC0,0xA0BF,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C0,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C1,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C2,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C3,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C4,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C5,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C6,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C7,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C8,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C9,0x0000,0x0000,0x0000,
+0xFBC0,0xA0CA,0x0000,0x0000,0x0000,
+0xFBC0,0xA0CB,0x0000,0x0000,0x0000,
+0xFBC0,0xA0CC,0x0000,0x0000,0x0000,
+0xFBC0,0xA0CD,0x0000,0x0000,0x0000,
+0xFBC0,0xA0CE,0x0000,0x0000,0x0000,
+0xFBC0,0xA0CF,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA0EB,0x0000,0x0000,0x0000,
+0xFBC0,0xA0EC,0x0000,0x0000,0x0000,
+0xFBC0,0xA0ED,0x0000,0x0000,0x0000,
+0xFBC0,0xA0EE,0x0000,0x0000,0x0000,
+0xFBC0,0xA0EF,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F0,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F1,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F2,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F3,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F4,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F5,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F6,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F7,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F8,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F9,0x0000,0x0000,0x0000,
+0xFBC0,0xA0FA,0x0000,0x0000,0x0000,
+0xFBC0,0xA0FB,0x0000,0x0000,0x0000,
+0xFBC0,0xA0FC,0x0000,0x0000,0x0000,
+0xFBC0,0xA0FD,0x0000,0x0000,0x0000,
+0xFBC0,0xA0FE,0x0000,0x0000,0x0000,
+0xFBC0,0xA0FF,0x0000,0x0000,0x0000
+};
+
+static uint16 page021data[]= { /* 2100 (5 weights per char) */
+0x0E33,0x02CC,0x0E60,0x0000,0x0000,
+0x0E33,0x02CC,0x0FEA,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000,0x0000,
+0x034A,0x0E60,0x0000,0x0000,0x0000,
+0x039B,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x02CC,0x0F82,0x0000,0x0000,
+0x0E60,0x02CC,0x101F,0x0000,0x0000,
+0x0E98,0x0000,0x0000,0x0000,0x0000,
+0x039C,0x0000,0x0000,0x0000,0x0000,
+0x034A,0x0EB9,0x0000,0x0000,0x0000,
+0x0EC1,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000,0x0000,
+0x0EED,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000,0x0000,
+0x039D,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0F82,0x0000,0x0000,0x0000,
+0x039E,0x0000,0x0000,0x0000,0x0000,
+0x039F,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0000,0x0000,0x0000,0x0000,
+0x0FB4,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000,0x0000,
+0x03A0,0x0000,0x0000,0x0000,0x0000,
+0x03A1,0x0000,0x0000,0x0000,0x0000,
+0x0FEA,0x0F5B,0x0000,0x0000,0x0000,
+0x1002,0x0E8B,0x0F2E,0x0000,0x0000,
+0x1002,0x0F5B,0x0000,0x0000,0x0000,
+0x03A2,0x0000,0x0000,0x0000,0x0000,
+0x106A,0x0000,0x0000,0x0000,0x0000,
+0x03A3,0x0000,0x0000,0x0000,0x0000,
+0x1109,0x0000,0x0000,0x0000,0x0000,
+0x03A4,0x0000,0x0000,0x0000,0x0000,
+0x106A,0x0000,0x0000,0x0000,0x0000,
+0x03A5,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0000,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000,0x0000,
+0x0E4A,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000,0x0000,
+0x03A6,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000,0x0000,
+0x0EB9,0x0000,0x0000,0x0000,0x0000,
+0x03A7,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0000,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000,0x0000,
+0x1331,0x0000,0x0000,0x0000,0x0000,
+0x1332,0x0000,0x0000,0x0000,0x0000,
+0x1333,0x0000,0x0000,0x0000,0x0000,
+0x1334,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x03A8,0x0000,0x0000,0x0000,0x0000,
+0x0EB9,0x0E33,0x105A,0x0000,0x0000,
+0xFBC0,0xA13C,0x0000,0x0000,0x0000,
+0x10EA,0x0000,0x0000,0x0000,0x0000,
+0x10EA,0x0000,0x0000,0x0000,0x0000,
+0x10FC,0x0000,0x0000,0x0000,0x0000,
+0x0427,0x0000,0x0000,0x0000,0x0000,
+0x03A9,0x0000,0x0000,0x0000,0x0000,
+0x03AA,0x0000,0x0000,0x0000,0x0000,
+0x03AB,0x0000,0x0000,0x0000,0x0000,
+0x03AC,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0F10,0x0000,0x0000,0x0000,0x0000,
+0x03AD,0x0000,0x0000,0x0000,0x0000,
+0x02D0,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA14C,0x0000,0x0000,0x0000,
+0xFBC0,0xA14D,0x0000,0x0000,0x0000,
+0xFBC0,0xA14E,0x0000,0x0000,0x0000,
+0xFBC0,0xA14F,0x0000,0x0000,0x0000,
+0xFBC0,0xA150,0x0000,0x0000,0x0000,
+0xFBC0,0xA151,0x0000,0x0000,0x0000,
+0xFBC0,0xA152,0x0000,0x0000,0x0000,
+0x0E2A,0x02CD,0x0E2C,0x0000,0x0000,
+0x0E2B,0x02CD,0x0E2C,0x0000,0x0000,
+0x0E2A,0x02CD,0x0E2E,0x0000,0x0000,
+0x0E2B,0x02CD,0x0E2E,0x0000,0x0000,
+0x0E2C,0x02CD,0x0E2E,0x0000,0x0000,
+0x0E2D,0x02CD,0x0E2E,0x0000,0x0000,
+0x0E2A,0x02CD,0x0E2F,0x0000,0x0000,
+0x0E2E,0x02CD,0x0E2F,0x0000,0x0000,
+0x0E2A,0x02CD,0x0E31,0x0000,0x0000,
+0x0E2C,0x02CD,0x0E31,0x0000,0x0000,
+0x0E2E,0x02CD,0x0E31,0x0000,0x0000,
+0x0E30,0x02CD,0x0E31,0x0000,0x0000,
+0x0E2A,0x02CD,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0EFB,0x0000,0x0000,0x0000,
+0x0EFB,0x0EFB,0x0EFB,0x0000,0x0000,
+0x0EFB,0x1044,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000,0x0000,
+0x1044,0x0EFB,0x0000,0x0000,0x0000,
+0x1044,0x0EFB,0x0EFB,0x0000,0x0000,
+0x1044,0x0EFB,0x0EFB,0x0EFB,0x0000,
+0x0EFB,0x105A,0x0000,0x0000,0x0000,
+0x105A,0x0000,0x0000,0x0000,0x0000,
+0x105A,0x0EFB,0x0000,0x0000,0x0000,
+0x105A,0x0EFB,0x0EFB,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0EFB,0x0000,0x0000,0x0000,
+0x0EFB,0x0EFB,0x0EFB,0x0000,0x0000,
+0x0EFB,0x1044,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000,0x0000,
+0x1044,0x0EFB,0x0000,0x0000,0x0000,
+0x1044,0x0EFB,0x0EFB,0x0000,0x0000,
+0x1044,0x0EFB,0x0EFB,0x0EFB,0x0000,
+0x0EFB,0x105A,0x0000,0x0000,0x0000,
+0x105A,0x0000,0x0000,0x0000,0x0000,
+0x105A,0x0EFB,0x0000,0x0000,0x0000,
+0x105A,0x0EFB,0x0EFB,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0000,0x0000,0x0000,0x0000,
+0x0DD7,0x0000,0x0000,0x0000,0x0000,
+0x0DD8,0x0000,0x0000,0x0000,0x0000,
+0x0DD9,0x0000,0x0000,0x0000,0x0000,
+0x0DDA,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA184,0x0000,0x0000,0x0000,
+0xFBC0,0xA185,0x0000,0x0000,0x0000,
+0xFBC0,0xA186,0x0000,0x0000,0x0000,
+0xFBC0,0xA187,0x0000,0x0000,0x0000,
+0xFBC0,0xA188,0x0000,0x0000,0x0000,
+0xFBC0,0xA189,0x0000,0x0000,0x0000,
+0xFBC0,0xA18A,0x0000,0x0000,0x0000,
+0xFBC0,0xA18B,0x0000,0x0000,0x0000,
+0xFBC0,0xA18C,0x0000,0x0000,0x0000,
+0xFBC0,0xA18D,0x0000,0x0000,0x0000,
+0xFBC0,0xA18E,0x0000,0x0000,0x0000,
+0xFBC0,0xA18F,0x0000,0x0000,0x0000,
+0x03AE,0x0000,0x0000,0x0000,0x0000,
+0x03B0,0x0000,0x0000,0x0000,0x0000,
+0x03AF,0x0000,0x0000,0x0000,0x0000,
+0x03B1,0x0000,0x0000,0x0000,0x0000,
+0x03B2,0x0000,0x0000,0x0000,0x0000,
+0x03B3,0x0000,0x0000,0x0000,0x0000,
+0x03B4,0x0000,0x0000,0x0000,0x0000,
+0x03B5,0x0000,0x0000,0x0000,0x0000,
+0x03B6,0x0000,0x0000,0x0000,0x0000,
+0x03B7,0x0000,0x0000,0x0000,0x0000,
+0x03AE,0x0000,0x0000,0x0000,0x0000,
+0x03AF,0x0000,0x0000,0x0000,0x0000,
+0x03B8,0x0000,0x0000,0x0000,0x0000,
+0x03B9,0x0000,0x0000,0x0000,0x0000,
+0x03BA,0x0000,0x0000,0x0000,0x0000,
+0x03BB,0x0000,0x0000,0x0000,0x0000,
+0x03BC,0x0000,0x0000,0x0000,0x0000,
+0x03BD,0x0000,0x0000,0x0000,0x0000,
+0x03BE,0x0000,0x0000,0x0000,0x0000,
+0x03BF,0x0000,0x0000,0x0000,0x0000,
+0x03C0,0x0000,0x0000,0x0000,0x0000,
+0x03C1,0x0000,0x0000,0x0000,0x0000,
+0x03C2,0x0000,0x0000,0x0000,0x0000,
+0x03C3,0x0000,0x0000,0x0000,0x0000,
+0x03C4,0x0000,0x0000,0x0000,0x0000,
+0x03C5,0x0000,0x0000,0x0000,0x0000,
+0x03C6,0x0000,0x0000,0x0000,0x0000,
+0x03C7,0x0000,0x0000,0x0000,0x0000,
+0x03C8,0x0000,0x0000,0x0000,0x0000,
+0x03C9,0x0000,0x0000,0x0000,0x0000,
+0x03B2,0x0000,0x0000,0x0000,0x0000,
+0x03CA,0x0000,0x0000,0x0000,0x0000,
+0x03CB,0x0000,0x0000,0x0000,0x0000,
+0x03CC,0x0000,0x0000,0x0000,0x0000,
+0x03CD,0x0000,0x0000,0x0000,0x0000,
+0x03CE,0x0000,0x0000,0x0000,0x0000,
+0x03CF,0x0000,0x0000,0x0000,0x0000,
+0x03D0,0x0000,0x0000,0x0000,0x0000,
+0x03D1,0x0000,0x0000,0x0000,0x0000,
+0x03D2,0x0000,0x0000,0x0000,0x0000,
+0x03D3,0x0000,0x0000,0x0000,0x0000,
+0x03D4,0x0000,0x0000,0x0000,0x0000,
+0x03D5,0x0000,0x0000,0x0000,0x0000,
+0x03D6,0x0000,0x0000,0x0000,0x0000,
+0x03D7,0x0000,0x0000,0x0000,0x0000,
+0x03D8,0x0000,0x0000,0x0000,0x0000,
+0x03D9,0x0000,0x0000,0x0000,0x0000,
+0x03DA,0x0000,0x0000,0x0000,0x0000,
+0x03DB,0x0000,0x0000,0x0000,0x0000,
+0x03DC,0x0000,0x0000,0x0000,0x0000,
+0x03DD,0x0000,0x0000,0x0000,0x0000,
+0x03DE,0x0000,0x0000,0x0000,0x0000,
+0x03DF,0x0000,0x0000,0x0000,0x0000,
+0x03E0,0x0000,0x0000,0x0000,0x0000,
+0x03E1,0x0000,0x0000,0x0000,0x0000,
+0x03E2,0x0000,0x0000,0x0000,0x0000,
+0x03E3,0x0000,0x0000,0x0000,0x0000,
+0x03E4,0x0000,0x0000,0x0000,0x0000,
+0x03E5,0x0000,0x0000,0x0000,0x0000,
+0x03E6,0x0000,0x0000,0x0000,0x0000,
+0x03E7,0x0000,0x0000,0x0000,0x0000,
+0x03E8,0x0000,0x0000,0x0000,0x0000,
+0x03EC,0x0000,0x0000,0x0000,0x0000,
+0x03EA,0x0000,0x0000,0x0000,0x0000,
+0x03E8,0x0000,0x0000,0x0000,0x0000,
+0x03E9,0x0000,0x0000,0x0000,0x0000,
+0x03EA,0x0000,0x0000,0x0000,0x0000,
+0x03EB,0x0000,0x0000,0x0000,0x0000,
+0x03EC,0x0000,0x0000,0x0000,0x0000,
+0x03ED,0x0000,0x0000,0x0000,0x0000,
+0x03EE,0x0000,0x0000,0x0000,0x0000,
+0x03EF,0x0000,0x0000,0x0000,0x0000,
+0x03F0,0x0000,0x0000,0x0000,0x0000,
+0x03F1,0x0000,0x0000,0x0000,0x0000,
+0x03F2,0x0000,0x0000,0x0000,0x0000,
+0x03F3,0x0000,0x0000,0x0000,0x0000,
+0x03F4,0x0000,0x0000,0x0000,0x0000,
+0x03F5,0x0000,0x0000,0x0000,0x0000,
+0x03F6,0x0000,0x0000,0x0000,0x0000,
+0x03F7,0x0000,0x0000,0x0000,0x0000,
+0x03F8,0x0000,0x0000,0x0000,0x0000,
+0x03F9,0x0000,0x0000,0x0000,0x0000,
+0x03FA,0x0000,0x0000,0x0000,0x0000,
+0x03FB,0x0000,0x0000,0x0000,0x0000,
+0x03FC,0x0000,0x0000,0x0000,0x0000,
+0x03FD,0x0000,0x0000,0x0000,0x0000,
+0x03FE,0x0000,0x0000,0x0000,0x0000,
+0x03FF,0x0000,0x0000,0x0000,0x0000,
+0x0400,0x0000,0x0000,0x0000,0x0000,
+0x0401,0x0000,0x0000,0x0000,0x0000,
+0x0402,0x0000,0x0000,0x0000,0x0000,
+0x0403,0x0000,0x0000,0x0000,0x0000,
+0x0404,0x0000,0x0000,0x0000,0x0000,
+0x0405,0x0000,0x0000,0x0000,0x0000,
+0x0406,0x0000,0x0000,0x0000,0x0000,
+0x0407,0x0000,0x0000,0x0000,0x0000,
+0x0408,0x0000,0x0000,0x0000,0x0000,
+0x0409,0x0000,0x0000,0x0000,0x0000,
+0x040A,0x0000,0x0000,0x0000,0x0000,
+0x040B,0x0000,0x0000,0x0000,0x0000,
+0x040C,0x0000,0x0000,0x0000,0x0000,
+0x040D,0x0000,0x0000,0x0000,0x0000,
+0x040E,0x0000,0x0000,0x0000,0x0000,
+0x040F,0x0000,0x0000,0x0000,0x0000,
+0x0410,0x0000,0x0000,0x0000,0x0000,
+0x0411,0x0000,0x0000,0x0000,0x0000,
+0x0412,0x0000,0x0000,0x0000,0x0000,
+0x0413,0x0000,0x0000,0x0000,0x0000,
+0x0414,0x0000,0x0000,0x0000,0x0000,
+0x0415,0x0000,0x0000,0x0000,0x0000,
+0x0416,0x0000,0x0000,0x0000,0x0000,
+0x0417,0x0000,0x0000,0x0000,0x0000
+};
+
+static uint16 page022data[]= { /* 2200 (4 weights per char) */
+0x0418,0x0000,0x0000,0x0000, 0x0419,0x0000,0x0000,0x0000,
+0x041A,0x0000,0x0000,0x0000, 0x041B,0x0000,0x0000,0x0000,
+0x041B,0x0000,0x0000,0x0000, 0x041C,0x0000,0x0000,0x0000,
+0x041D,0x0000,0x0000,0x0000, 0x041E,0x0000,0x0000,0x0000,
+0x041F,0x0000,0x0000,0x0000, 0x041F,0x0000,0x0000,0x0000,
+0x0420,0x0000,0x0000,0x0000, 0x0421,0x0000,0x0000,0x0000,
+0x0421,0x0000,0x0000,0x0000, 0x0422,0x0000,0x0000,0x0000,
+0x0424,0x0000,0x0000,0x0000, 0x0425,0x0000,0x0000,0x0000,
+0x0426,0x0000,0x0000,0x0000, 0x0427,0x0000,0x0000,0x0000,
+0x0434,0x0000,0x0000,0x0000, 0x0435,0x0000,0x0000,0x0000,
+0x0436,0x0000,0x0000,0x0000, 0x0437,0x0000,0x0000,0x0000,
+0x0438,0x0000,0x0000,0x0000, 0x0439,0x0000,0x0000,0x0000,
+0x043A,0x0000,0x0000,0x0000, 0x043B,0x0000,0x0000,0x0000,
+0x043C,0x0000,0x0000,0x0000, 0x043D,0x0000,0x0000,0x0000,
+0x043E,0x0000,0x0000,0x0000, 0x043F,0x0000,0x0000,0x0000,
+0x0440,0x0000,0x0000,0x0000, 0x0441,0x0000,0x0000,0x0000,
+0x0442,0x0000,0x0000,0x0000, 0x0443,0x0000,0x0000,0x0000,
+0x0444,0x0000,0x0000,0x0000, 0x0445,0x0000,0x0000,0x0000,
+0x0445,0x0000,0x0000,0x0000, 0x0446,0x0000,0x0000,0x0000,
+0x0446,0x0000,0x0000,0x0000, 0x0447,0x0000,0x0000,0x0000,
+0x0448,0x0000,0x0000,0x0000, 0x0449,0x0000,0x0000,0x0000,
+0x044A,0x0000,0x0000,0x0000, 0x044B,0x0000,0x0000,0x0000,
+0x044B,0x044B,0x0000,0x0000, 0x044B,0x044B,0x044B,0x0000,
+0x044C,0x0000,0x0000,0x0000, 0x044C,0x044C,0x0000,0x0000,
+0x044C,0x044C,0x044C,0x0000, 0x044D,0x0000,0x0000,0x0000,
+0x044E,0x0000,0x0000,0x0000, 0x044F,0x0000,0x0000,0x0000,
+0x0450,0x0000,0x0000,0x0000, 0x0451,0x0000,0x0000,0x0000,
+0x0452,0x0000,0x0000,0x0000, 0x0453,0x0000,0x0000,0x0000,
+0x0454,0x0000,0x0000,0x0000, 0x0455,0x0000,0x0000,0x0000,
+0x0456,0x0000,0x0000,0x0000, 0x0457,0x0000,0x0000,0x0000,
+0x0458,0x0000,0x0000,0x0000, 0x0459,0x0000,0x0000,0x0000,
+0x045A,0x0000,0x0000,0x0000, 0x045B,0x0000,0x0000,0x0000,
+0x045C,0x0000,0x0000,0x0000, 0x0458,0x0000,0x0000,0x0000,
+0x045D,0x0000,0x0000,0x0000, 0x045E,0x0000,0x0000,0x0000,
+0x045E,0x0000,0x0000,0x0000, 0x045F,0x0000,0x0000,0x0000,
+0x0460,0x0000,0x0000,0x0000, 0x045F,0x0000,0x0000,0x0000,
+0x0461,0x0000,0x0000,0x0000, 0x0461,0x0000,0x0000,0x0000,
+0x0462,0x0000,0x0000,0x0000, 0x0463,0x0000,0x0000,0x0000,
+0x0464,0x0000,0x0000,0x0000, 0x0465,0x0000,0x0000,0x0000,
+0x0466,0x0000,0x0000,0x0000, 0x0467,0x0000,0x0000,0x0000,
+0x0468,0x0000,0x0000,0x0000, 0x0469,0x0000,0x0000,0x0000,
+0x046A,0x0000,0x0000,0x0000, 0x046B,0x0000,0x0000,0x0000,
+0x046C,0x0000,0x0000,0x0000, 0x046D,0x0000,0x0000,0x0000,
+0x046E,0x0000,0x0000,0x0000, 0x046F,0x0000,0x0000,0x0000,
+0x0470,0x0000,0x0000,0x0000, 0x0471,0x0000,0x0000,0x0000,
+0x0472,0x0000,0x0000,0x0000, 0x0473,0x0000,0x0000,0x0000,
+0x0474,0x0000,0x0000,0x0000, 0x0475,0x0000,0x0000,0x0000,
+0x0476,0x0000,0x0000,0x0000, 0x0477,0x0000,0x0000,0x0000,
+0x042D,0x0000,0x0000,0x0000, 0x0478,0x0000,0x0000,0x0000,
+0x0478,0x0000,0x0000,0x0000, 0x0479,0x0000,0x0000,0x0000,
+0x047A,0x0000,0x0000,0x0000, 0x047B,0x0000,0x0000,0x0000,
+0x047C,0x0000,0x0000,0x0000, 0x047D,0x0000,0x0000,0x0000,
+0x047E,0x0000,0x0000,0x0000, 0x047F,0x0000,0x0000,0x0000,
+0x0480,0x0000,0x0000,0x0000, 0x0481,0x0000,0x0000,0x0000,
+0x0482,0x0000,0x0000,0x0000, 0x0465,0x0000,0x0000,0x0000,
+0x042C,0x0000,0x0000,0x0000, 0x042E,0x0000,0x0000,0x0000,
+0x047A,0x0000,0x0000,0x0000, 0x047B,0x0000,0x0000,0x0000,
+0x0483,0x0000,0x0000,0x0000, 0x0484,0x0000,0x0000,0x0000,
+0x0483,0x0000,0x0000,0x0000, 0x0484,0x0000,0x0000,0x0000,
+0x0485,0x0000,0x0000,0x0000, 0x0486,0x0000,0x0000,0x0000,
+0x0485,0x0000,0x0000,0x0000, 0x0486,0x0000,0x0000,0x0000,
+0x0487,0x0000,0x0000,0x0000, 0x0488,0x0000,0x0000,0x0000,
+0x0489,0x0000,0x0000,0x0000, 0x048A,0x0000,0x0000,0x0000,
+0x048B,0x0000,0x0000,0x0000, 0x048C,0x0000,0x0000,0x0000,
+0x0487,0x0000,0x0000,0x0000, 0x0488,0x0000,0x0000,0x0000,
+0x048D,0x0000,0x0000,0x0000, 0x048E,0x0000,0x0000,0x0000,
+0x048D,0x0000,0x0000,0x0000, 0x048E,0x0000,0x0000,0x0000,
+0x048F,0x0000,0x0000,0x0000, 0x0490,0x0000,0x0000,0x0000,
+0x048F,0x0000,0x0000,0x0000, 0x0490,0x0000,0x0000,0x0000,
+0x0491,0x0000,0x0000,0x0000, 0x0492,0x0000,0x0000,0x0000,
+0x0493,0x0000,0x0000,0x0000, 0x0494,0x0000,0x0000,0x0000,
+0x0495,0x0000,0x0000,0x0000, 0x0496,0x0000,0x0000,0x0000,
+0x0497,0x0000,0x0000,0x0000, 0x0498,0x0000,0x0000,0x0000,
+0x0499,0x0000,0x0000,0x0000, 0x049A,0x0000,0x0000,0x0000,
+0x049B,0x0000,0x0000,0x0000, 0x049C,0x0000,0x0000,0x0000,
+0x049D,0x0000,0x0000,0x0000, 0x049E,0x0000,0x0000,0x0000,
+0x049F,0x0000,0x0000,0x0000, 0x04A0,0x0000,0x0000,0x0000,
+0x04A1,0x0000,0x0000,0x0000, 0x04A2,0x0000,0x0000,0x0000,
+0x04A3,0x0000,0x0000,0x0000, 0x04A4,0x0000,0x0000,0x0000,
+0x04A5,0x0000,0x0000,0x0000, 0x04A6,0x0000,0x0000,0x0000,
+0x04A7,0x0000,0x0000,0x0000, 0x04A8,0x0000,0x0000,0x0000,
+0x04A9,0x0000,0x0000,0x0000, 0x04AA,0x0000,0x0000,0x0000,
+0x04AB,0x0000,0x0000,0x0000, 0x04AC,0x0000,0x0000,0x0000,
+0x04AD,0x0000,0x0000,0x0000, 0x04AE,0x0000,0x0000,0x0000,
+0x04AF,0x0000,0x0000,0x0000, 0x04B0,0x0000,0x0000,0x0000,
+0x04B1,0x0000,0x0000,0x0000, 0x04B2,0x0000,0x0000,0x0000,
+0x04A9,0x0000,0x0000,0x0000, 0x04AF,0x0000,0x0000,0x0000,
+0x04B0,0x0000,0x0000,0x0000, 0x04B2,0x0000,0x0000,0x0000,
+0x04B3,0x0000,0x0000,0x0000, 0x04B4,0x0000,0x0000,0x0000,
+0x04B5,0x0000,0x0000,0x0000, 0x04B6,0x0000,0x0000,0x0000,
+0x04B7,0x0000,0x0000,0x0000, 0x04B8,0x0000,0x0000,0x0000,
+0x04B9,0x0000,0x0000,0x0000, 0x04BA,0x0000,0x0000,0x0000,
+0x04BB,0x0000,0x0000,0x0000, 0x04BC,0x0000,0x0000,0x0000,
+0x04BD,0x0000,0x0000,0x0000, 0x04BE,0x0000,0x0000,0x0000,
+0x04BF,0x0000,0x0000,0x0000, 0x04C0,0x0000,0x0000,0x0000,
+0x04C1,0x0000,0x0000,0x0000, 0x04C2,0x0000,0x0000,0x0000,
+0x04C3,0x0000,0x0000,0x0000, 0x04C4,0x0000,0x0000,0x0000,
+0x04C5,0x0000,0x0000,0x0000, 0x04C6,0x0000,0x0000,0x0000,
+0x04C7,0x0000,0x0000,0x0000, 0x04C8,0x0000,0x0000,0x0000,
+0x04C9,0x0000,0x0000,0x0000, 0x04CA,0x0000,0x0000,0x0000,
+0x04CB,0x0000,0x0000,0x0000, 0x04CC,0x0000,0x0000,0x0000,
+0x04CD,0x0000,0x0000,0x0000, 0x04CE,0x0000,0x0000,0x0000,
+0x04CF,0x0000,0x0000,0x0000, 0x04D0,0x0000,0x0000,0x0000,
+0x04D1,0x0000,0x0000,0x0000, 0x04D2,0x0000,0x0000,0x0000,
+0x04D3,0x0000,0x0000,0x0000, 0x04D4,0x0000,0x0000,0x0000,
+0x04D5,0x0000,0x0000,0x0000, 0x04D6,0x0000,0x0000,0x0000,
+0x04D7,0x0000,0x0000,0x0000, 0x04D8,0x0000,0x0000,0x0000,
+0x04D9,0x0000,0x0000,0x0000, 0x04DA,0x0000,0x0000,0x0000,
+0x04DB,0x0000,0x0000,0x0000, 0x04DC,0x0000,0x0000,0x0000,
+0x04DD,0x0000,0x0000,0x0000, 0x04DE,0x0000,0x0000,0x0000,
+0x04DF,0x0000,0x0000,0x0000, 0x04E0,0x0000,0x0000,0x0000,
+0x04E1,0x0000,0x0000,0x0000, 0x04E2,0x0000,0x0000,0x0000,
+0x0489,0x0000,0x0000,0x0000, 0x048A,0x0000,0x0000,0x0000,
+0x0498,0x0000,0x0000,0x0000, 0x0499,0x0000,0x0000,0x0000,
+0x04E3,0x0000,0x0000,0x0000, 0x04E4,0x0000,0x0000,0x0000,
+0x04E5,0x0000,0x0000,0x0000, 0x04E6,0x0000,0x0000,0x0000,
+0x04E7,0x0000,0x0000,0x0000, 0x04E8,0x0000,0x0000,0x0000,
+0x04B5,0x0000,0x0000,0x0000, 0x04B6,0x0000,0x0000,0x0000,
+0x04B7,0x0000,0x0000,0x0000, 0x04B8,0x0000,0x0000,0x0000,
+0x04E9,0x0000,0x0000,0x0000, 0x04EA,0x0000,0x0000,0x0000,
+0x04EB,0x0000,0x0000,0x0000, 0x04EC,0x0000,0x0000,0x0000,
+0x04ED,0x0000,0x0000,0x0000, 0x04EE,0x0000,0x0000,0x0000,
+0x04EF,0x0000,0x0000,0x0000, 0x04F0,0x0000,0x0000,0x0000,
+0x04F1,0x0000,0x0000,0x0000, 0x04F2,0x0000,0x0000,0x0000,
+0x04F3,0x0000,0x0000,0x0000, 0x04F4,0x0000,0x0000,0x0000,
+0x04F5,0x0000,0x0000,0x0000, 0x04F6,0x0000,0x0000,0x0000,
+0x04F7,0x0000,0x0000,0x0000, 0x04F8,0x0000,0x0000,0x0000,
+0x04F9,0x0000,0x0000,0x0000, 0x04FA,0x0000,0x0000,0x0000
+};
+
+static uint16 page023data[]= { /* 2300 (3 weights per char) */
+0x04FB,0x0000,0x0000, 0x04FC,0x0000,0x0000, 0x04FD,0x0000,0x0000,
+0x04FE,0x0000,0x0000, 0x04FF,0x0000,0x0000, 0x0500,0x0000,0x0000,
+0x0501,0x0000,0x0000, 0x0502,0x0000,0x0000, 0x0503,0x0000,0x0000,
+0x0504,0x0000,0x0000, 0x0505,0x0000,0x0000, 0x0506,0x0000,0x0000,
+0x0507,0x0000,0x0000, 0x0508,0x0000,0x0000, 0x0509,0x0000,0x0000,
+0x050A,0x0000,0x0000, 0x050B,0x0000,0x0000, 0x050C,0x0000,0x0000,
+0x050D,0x0000,0x0000, 0x050E,0x0000,0x0000, 0x050F,0x0000,0x0000,
+0x0510,0x0000,0x0000, 0x0511,0x0000,0x0000, 0x0512,0x0000,0x0000,
+0x0513,0x0000,0x0000, 0x0514,0x0000,0x0000, 0x0515,0x0000,0x0000,
+0x0516,0x0000,0x0000, 0x0517,0x0000,0x0000, 0x0518,0x0000,0x0000,
+0x0519,0x0000,0x0000, 0x051A,0x0000,0x0000, 0x051B,0x0000,0x0000,
+0x051C,0x0000,0x0000, 0x051D,0x0000,0x0000, 0x051E,0x0000,0x0000,
+0x051F,0x0000,0x0000, 0x0520,0x0000,0x0000, 0x0521,0x0000,0x0000,
+0x0522,0x0000,0x0000, 0x0523,0x0000,0x0000, 0x02AE,0x0000,0x0000,
+0x02AF,0x0000,0x0000, 0x0524,0x0000,0x0000, 0x0525,0x0000,0x0000,
+0x0526,0x0000,0x0000, 0x0527,0x0000,0x0000, 0x0528,0x0000,0x0000,
+0x0529,0x0000,0x0000, 0x052A,0x0000,0x0000, 0x052B,0x0000,0x0000,
+0x052C,0x0000,0x0000, 0x052D,0x0000,0x0000, 0x052E,0x0000,0x0000,
+0x052F,0x0000,0x0000, 0x0530,0x0000,0x0000, 0x0531,0x0000,0x0000,
+0x0532,0x0000,0x0000, 0x0533,0x0000,0x0000, 0x0534,0x0000,0x0000,
+0x0535,0x0000,0x0000, 0x0536,0x0000,0x0000, 0x0537,0x0000,0x0000,
+0x0538,0x0000,0x0000, 0x0539,0x0000,0x0000, 0x053A,0x0000,0x0000,
+0x053B,0x0000,0x0000, 0x053C,0x0000,0x0000, 0x053D,0x0000,0x0000,
+0x053E,0x0000,0x0000, 0x053F,0x0000,0x0000, 0x0540,0x0000,0x0000,
+0x0541,0x0000,0x0000, 0x0542,0x0000,0x0000, 0x0543,0x0000,0x0000,
+0x0544,0x0000,0x0000, 0x0545,0x0000,0x0000, 0x0546,0x0000,0x0000,
+0x0547,0x0000,0x0000, 0x0548,0x0000,0x0000, 0x0549,0x0000,0x0000,
+0x054A,0x0000,0x0000, 0x054B,0x0000,0x0000, 0x054C,0x0000,0x0000,
+0x054D,0x0000,0x0000, 0x054E,0x0000,0x0000, 0x054F,0x0000,0x0000,
+0x0550,0x0000,0x0000, 0x0551,0x0000,0x0000, 0x0552,0x0000,0x0000,
+0x0553,0x0000,0x0000, 0x0554,0x0000,0x0000, 0x0555,0x0000,0x0000,
+0x0556,0x0000,0x0000, 0x0557,0x0000,0x0000, 0x0558,0x0000,0x0000,
+0x0559,0x0000,0x0000, 0x055A,0x0000,0x0000, 0x055B,0x0000,0x0000,
+0x055C,0x0000,0x0000, 0x055D,0x0000,0x0000, 0x055E,0x0000,0x0000,
+0x055F,0x0000,0x0000, 0x0560,0x0000,0x0000, 0x0561,0x0000,0x0000,
+0x0562,0x0000,0x0000, 0x0563,0x0000,0x0000, 0x0564,0x0000,0x0000,
+0x0565,0x0000,0x0000, 0x0566,0x0000,0x0000, 0x0567,0x0000,0x0000,
+0x0568,0x0000,0x0000, 0x0569,0x0000,0x0000, 0x056A,0x0000,0x0000,
+0x056B,0x0000,0x0000, 0x056C,0x0000,0x0000, 0x056D,0x0000,0x0000,
+0x056E,0x0000,0x0000, 0x056F,0x0000,0x0000, 0x0570,0x0000,0x0000,
+0x0571,0x0000,0x0000, 0x0572,0x0000,0x0000, 0x0573,0x0000,0x0000,
+0x0574,0x0000,0x0000, 0x0575,0x0000,0x0000, 0x0576,0x0000,0x0000,
+0x0577,0x0000,0x0000, 0x0578,0x0000,0x0000, 0x0579,0x0000,0x0000,
+0x057A,0x0000,0x0000, 0x057B,0x0000,0x0000, 0x057C,0x0000,0x0000,
+0x057D,0x0000,0x0000, 0x057E,0x0000,0x0000, 0x057F,0x0000,0x0000,
+0x0580,0x0000,0x0000, 0x0581,0x0000,0x0000, 0x0582,0x0000,0x0000,
+0x0583,0x0000,0x0000, 0x0584,0x0000,0x0000, 0x0585,0x0000,0x0000,
+0x0586,0x0000,0x0000, 0x0587,0x0000,0x0000, 0x0588,0x0000,0x0000,
+0x0589,0x0000,0x0000, 0x058A,0x0000,0x0000, 0x058B,0x0000,0x0000,
+0x058C,0x0000,0x0000, 0x058D,0x0000,0x0000, 0x058E,0x0000,0x0000,
+0x058F,0x0000,0x0000, 0x0590,0x0000,0x0000, 0x0591,0x0000,0x0000,
+0x0592,0x0000,0x0000, 0x0593,0x0000,0x0000, 0x0594,0x0000,0x0000,
+0x0595,0x0000,0x0000, 0x0596,0x0000,0x0000, 0x0597,0x0000,0x0000,
+0x0598,0x0000,0x0000, 0x0599,0x0000,0x0000, 0x059A,0x0000,0x0000,
+0x059B,0x0000,0x0000, 0x059C,0x0000,0x0000, 0x059D,0x0000,0x0000,
+0x059E,0x0000,0x0000, 0x059F,0x0000,0x0000, 0x05A0,0x0000,0x0000,
+0x05A1,0x0000,0x0000, 0x05A2,0x0000,0x0000, 0x05A3,0x0000,0x0000,
+0x05A4,0x0000,0x0000, 0x05A5,0x0000,0x0000, 0x05A6,0x0000,0x0000,
+0x05A7,0x0000,0x0000, 0x05A8,0x0000,0x0000, 0x05A9,0x0000,0x0000,
+0x05AA,0x0000,0x0000, 0x05AB,0x0000,0x0000, 0x05AC,0x0000,0x0000,
+0x05AD,0x0000,0x0000, 0x05AE,0x0000,0x0000, 0x05AF,0x0000,0x0000,
+0x05B0,0x0000,0x0000, 0x05B1,0x0000,0x0000, 0x05B2,0x0000,0x0000,
+0x05B3,0x0000,0x0000, 0x05B4,0x0000,0x0000, 0x05B5,0x0000,0x0000,
+0x05B6,0x0000,0x0000, 0x05B7,0x0000,0x0000, 0x05B8,0x0000,0x0000,
+0x05B9,0x0000,0x0000, 0x05BA,0x0000,0x0000, 0x05BB,0x0000,0x0000,
+0x05BC,0x0000,0x0000, 0x05BD,0x0000,0x0000, 0x05BE,0x0000,0x0000,
+0x05BF,0x0000,0x0000, 0x05C0,0x0000,0x0000, 0x05C1,0x0000,0x0000,
+0x05C2,0x0000,0x0000, 0x05C3,0x0000,0x0000, 0x05C4,0x0000,0x0000,
+0x05C5,0x0000,0x0000, 0x05C6,0x0000,0x0000, 0x05C7,0x0000,0x0000,
+0x05C8,0x0000,0x0000, 0x05C9,0x0000,0x0000, 0xFBC0,0xA3D1,0x0000,
+0xFBC0,0xA3D2,0x0000, 0xFBC0,0xA3D3,0x0000, 0xFBC0,0xA3D4,0x0000,
+0xFBC0,0xA3D5,0x0000, 0xFBC0,0xA3D6,0x0000, 0xFBC0,0xA3D7,0x0000,
+0xFBC0,0xA3D8,0x0000, 0xFBC0,0xA3D9,0x0000, 0xFBC0,0xA3DA,0x0000,
+0xFBC0,0xA3DB,0x0000, 0xFBC0,0xA3DC,0x0000, 0xFBC0,0xA3DD,0x0000,
+0xFBC0,0xA3DE,0x0000, 0xFBC0,0xA3DF,0x0000, 0xFBC0,0xA3E0,0x0000,
+0xFBC0,0xA3E1,0x0000, 0xFBC0,0xA3E2,0x0000, 0xFBC0,0xA3E3,0x0000,
+0xFBC0,0xA3E4,0x0000, 0xFBC0,0xA3E5,0x0000, 0xFBC0,0xA3E6,0x0000,
+0xFBC0,0xA3E7,0x0000, 0xFBC0,0xA3E8,0x0000, 0xFBC0,0xA3E9,0x0000,
+0xFBC0,0xA3EA,0x0000, 0xFBC0,0xA3EB,0x0000, 0xFBC0,0xA3EC,0x0000,
+0xFBC0,0xA3ED,0x0000, 0xFBC0,0xA3EE,0x0000, 0xFBC0,0xA3EF,0x0000,
+0xFBC0,0xA3F0,0x0000, 0xFBC0,0xA3F1,0x0000, 0xFBC0,0xA3F2,0x0000,
+0xFBC0,0xA3F3,0x0000, 0xFBC0,0xA3F4,0x0000, 0xFBC0,0xA3F5,0x0000,
+0xFBC0,0xA3F6,0x0000, 0xFBC0,0xA3F7,0x0000, 0xFBC0,0xA3F8,0x0000,
+0xFBC0,0xA3F9,0x0000, 0xFBC0,0xA3FA,0x0000, 0xFBC0,0xA3FB,0x0000,
+0xFBC0,0xA3FC,0x0000, 0xFBC0,0xA3FD,0x0000, 0xFBC0,0xA3FE,0x0000,
+0xFBC0,0xA3FF,0x0000 };
+
+static uint16 page024data[]= { /* 2400 (5 weights per char) */
+0x05CA,0x0000,0x0000,0x0000,0x0000,
+0x05CB,0x0000,0x0000,0x0000,0x0000,
+0x05CC,0x0000,0x0000,0x0000,0x0000,
+0x05CD,0x0000,0x0000,0x0000,0x0000,
+0x05CE,0x0000,0x0000,0x0000,0x0000,
+0x05CF,0x0000,0x0000,0x0000,0x0000,
+0x05D0,0x0000,0x0000,0x0000,0x0000,
+0x05D1,0x0000,0x0000,0x0000,0x0000,
+0x05D2,0x0000,0x0000,0x0000,0x0000,
+0x05D3,0x0000,0x0000,0x0000,0x0000,
+0x05D4,0x0000,0x0000,0x0000,0x0000,
+0x05D5,0x0000,0x0000,0x0000,0x0000,
+0x05D6,0x0000,0x0000,0x0000,0x0000,
+0x05D7,0x0000,0x0000,0x0000,0x0000,
+0x05D8,0x0000,0x0000,0x0000,0x0000,
+0x05D9,0x0000,0x0000,0x0000,0x0000,
+0x05DA,0x0000,0x0000,0x0000,0x0000,
+0x05DB,0x0000,0x0000,0x0000,0x0000,
+0x05DC,0x0000,0x0000,0x0000,0x0000,
+0x05DD,0x0000,0x0000,0x0000,0x0000,
+0x05DE,0x0000,0x0000,0x0000,0x0000,
+0x05DF,0x0000,0x0000,0x0000,0x0000,
+0x05E0,0x0000,0x0000,0x0000,0x0000,
+0x05E1,0x0000,0x0000,0x0000,0x0000,
+0x05E2,0x0000,0x0000,0x0000,0x0000,
+0x05E3,0x0000,0x0000,0x0000,0x0000,
+0x05E4,0x0000,0x0000,0x0000,0x0000,
+0x05E5,0x0000,0x0000,0x0000,0x0000,
+0x05E6,0x0000,0x0000,0x0000,0x0000,
+0x05E7,0x0000,0x0000,0x0000,0x0000,
+0x05E8,0x0000,0x0000,0x0000,0x0000,
+0x05E9,0x0000,0x0000,0x0000,0x0000,
+0x05EA,0x0000,0x0000,0x0000,0x0000,
+0x05EB,0x0000,0x0000,0x0000,0x0000,
+0x05EC,0x0000,0x0000,0x0000,0x0000,
+0x05ED,0x0000,0x0000,0x0000,0x0000,
+0x05EE,0x0000,0x0000,0x0000,0x0000,
+0x05EF,0x0000,0x0000,0x0000,0x0000,
+0x05F0,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA427,0x0000,0x0000,0x0000,
+0xFBC0,0xA428,0x0000,0x0000,0x0000,
+0xFBC0,0xA429,0x0000,0x0000,0x0000,
+0xFBC0,0xA42A,0x0000,0x0000,0x0000,
+0xFBC0,0xA42B,0x0000,0x0000,0x0000,
+0xFBC0,0xA42C,0x0000,0x0000,0x0000,
+0xFBC0,0xA42D,0x0000,0x0000,0x0000,
+0xFBC0,0xA42E,0x0000,0x0000,0x0000,
+0xFBC0,0xA42F,0x0000,0x0000,0x0000,
+0xFBC0,0xA430,0x0000,0x0000,0x0000,
+0xFBC0,0xA431,0x0000,0x0000,0x0000,
+0xFBC0,0xA432,0x0000,0x0000,0x0000,
+0xFBC0,0xA433,0x0000,0x0000,0x0000,
+0xFBC0,0xA434,0x0000,0x0000,0x0000,
+0xFBC0,0xA435,0x0000,0x0000,0x0000,
+0xFBC0,0xA436,0x0000,0x0000,0x0000,
+0xFBC0,0xA437,0x0000,0x0000,0x0000,
+0xFBC0,0xA438,0x0000,0x0000,0x0000,
+0xFBC0,0xA439,0x0000,0x0000,0x0000,
+0xFBC0,0xA43A,0x0000,0x0000,0x0000,
+0xFBC0,0xA43B,0x0000,0x0000,0x0000,
+0xFBC0,0xA43C,0x0000,0x0000,0x0000,
+0xFBC0,0xA43D,0x0000,0x0000,0x0000,
+0xFBC0,0xA43E,0x0000,0x0000,0x0000,
+0xFBC0,0xA43F,0x0000,0x0000,0x0000,
+0x05F1,0x0000,0x0000,0x0000,0x0000,
+0x05F2,0x0000,0x0000,0x0000,0x0000,
+0x05F3,0x0000,0x0000,0x0000,0x0000,
+0x05F4,0x0000,0x0000,0x0000,0x0000,
+0x05F5,0x0000,0x0000,0x0000,0x0000,
+0x05F6,0x0000,0x0000,0x0000,0x0000,
+0x05F7,0x0000,0x0000,0x0000,0x0000,
+0x05F8,0x0000,0x0000,0x0000,0x0000,
+0x05F9,0x0000,0x0000,0x0000,0x0000,
+0x05FA,0x0000,0x0000,0x0000,0x0000,
+0x05FB,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA44B,0x0000,0x0000,0x0000,
+0xFBC0,0xA44C,0x0000,0x0000,0x0000,
+0xFBC0,0xA44D,0x0000,0x0000,0x0000,
+0xFBC0,0xA44E,0x0000,0x0000,0x0000,
+0xFBC0,0xA44F,0x0000,0x0000,0x0000,
+0xFBC0,0xA450,0x0000,0x0000,0x0000,
+0xFBC0,0xA451,0x0000,0x0000,0x0000,
+0xFBC0,0xA452,0x0000,0x0000,0x0000,
+0xFBC0,0xA453,0x0000,0x0000,0x0000,
+0xFBC0,0xA454,0x0000,0x0000,0x0000,
+0xFBC0,0xA455,0x0000,0x0000,0x0000,
+0xFBC0,0xA456,0x0000,0x0000,0x0000,
+0xFBC0,0xA457,0x0000,0x0000,0x0000,
+0xFBC0,0xA458,0x0000,0x0000,0x0000,
+0xFBC0,0xA459,0x0000,0x0000,0x0000,
+0xFBC0,0xA45A,0x0000,0x0000,0x0000,
+0xFBC0,0xA45B,0x0000,0x0000,0x0000,
+0xFBC0,0xA45C,0x0000,0x0000,0x0000,
+0xFBC0,0xA45D,0x0000,0x0000,0x0000,
+0xFBC0,0xA45E,0x0000,0x0000,0x0000,
+0xFBC0,0xA45F,0x0000,0x0000,0x0000,
+0x0E2A,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E29,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2A,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2B,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2C,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2D,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2E,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2F,0x0000,0x0000,0x0000,
+0x0E2A,0x0E30,0x0000,0x0000,0x0000,
+0x0E2A,0x0E31,0x0000,0x0000,0x0000,
+0x0E2A,0x0E32,0x0000,0x0000,0x0000,
+0x0E2B,0x0E29,0x0000,0x0000,0x0000,
+0x0288,0x0E2A,0x0289,0x0000,0x0000,
+0x0288,0x0E2B,0x0289,0x0000,0x0000,
+0x0288,0x0E2C,0x0289,0x0000,0x0000,
+0x0288,0x0E2D,0x0289,0x0000,0x0000,
+0x0288,0x0E2E,0x0289,0x0000,0x0000,
+0x0288,0x0E2F,0x0289,0x0000,0x0000,
+0x0288,0x0E30,0x0289,0x0000,0x0000,
+0x0288,0x0E31,0x0289,0x0000,0x0000,
+0x0288,0x0E32,0x0289,0x0000,0x0000,
+0x0288,0x0E2A,0x0E29,0x0289,0x0000,
+0x0288,0x0E2A,0x0E2A,0x0289,0x0000,
+0x0288,0x0E2A,0x0E2B,0x0289,0x0000,
+0x0288,0x0E2A,0x0E2C,0x0289,0x0000,
+0x0288,0x0E2A,0x0E2D,0x0289,0x0000,
+0x0288,0x0E2A,0x0E2E,0x0289,0x0000,
+0x0288,0x0E2A,0x0E2F,0x0289,0x0000,
+0x0288,0x0E2A,0x0E30,0x0289,0x0000,
+0x0288,0x0E2A,0x0E31,0x0289,0x0000,
+0x0288,0x0E2A,0x0E32,0x0289,0x0000,
+0x0288,0x0E2B,0x0E29,0x0289,0x0000,
+0x0E2A,0x025D,0x0000,0x0000,0x0000,
+0x0E2B,0x025D,0x0000,0x0000,0x0000,
+0x0E2C,0x025D,0x0000,0x0000,0x0000,
+0x0E2D,0x025D,0x0000,0x0000,0x0000,
+0x0E2E,0x025D,0x0000,0x0000,0x0000,
+0x0E2F,0x025D,0x0000,0x0000,0x0000,
+0x0E30,0x025D,0x0000,0x0000,0x0000,
+0x0E31,0x025D,0x0000,0x0000,0x0000,
+0x0E32,0x025D,0x0000,0x0000,0x0000,
+0x0E2A,0x0E29,0x025D,0x0000,0x0000,
+0x0E2A,0x0E2A,0x025D,0x0000,0x0000,
+0x0E2A,0x0E2B,0x025D,0x0000,0x0000,
+0x0E2A,0x0E2C,0x025D,0x0000,0x0000,
+0x0E2A,0x0E2D,0x025D,0x0000,0x0000,
+0x0E2A,0x0E2E,0x025D,0x0000,0x0000,
+0x0E2A,0x0E2F,0x025D,0x0000,0x0000,
+0x0E2A,0x0E30,0x025D,0x0000,0x0000,
+0x0E2A,0x0E31,0x025D,0x0000,0x0000,
+0x0E2A,0x0E32,0x025D,0x0000,0x0000,
+0x0E2B,0x0E29,0x025D,0x0000,0x0000,
+0x0288,0x0E33,0x0289,0x0000,0x0000,
+0x0288,0x0E4A,0x0289,0x0000,0x0000,
+0x0288,0x0E60,0x0289,0x0000,0x0000,
+0x0288,0x0E6D,0x0289,0x0000,0x0000,
+0x0288,0x0E8B,0x0289,0x0000,0x0000,
+0x0288,0x0EB9,0x0289,0x0000,0x0000,
+0x0288,0x0EC1,0x0289,0x0000,0x0000,
+0x0288,0x0EE1,0x0289,0x0000,0x0000,
+0x0288,0x0EFB,0x0289,0x0000,0x0000,
+0x0288,0x0F10,0x0289,0x0000,0x0000,
+0x0288,0x0F21,0x0289,0x0000,0x0000,
+0x0288,0x0F2E,0x0289,0x0000,0x0000,
+0x0288,0x0F5B,0x0289,0x0000,0x0000,
+0x0288,0x0F64,0x0289,0x0000,0x0000,
+0x0288,0x0F82,0x0289,0x0000,0x0000,
+0x0288,0x0FA7,0x0289,0x0000,0x0000,
+0x0288,0x0FB4,0x0289,0x0000,0x0000,
+0x0288,0x0FC0,0x0289,0x0000,0x0000,
+0x0288,0x0FEA,0x0289,0x0000,0x0000,
+0x0288,0x1002,0x0289,0x0000,0x0000,
+0x0288,0x101F,0x0289,0x0000,0x0000,
+0x0288,0x1044,0x0289,0x0000,0x0000,
+0x0288,0x1051,0x0289,0x0000,0x0000,
+0x0288,0x105A,0x0289,0x0000,0x0000,
+0x0288,0x105E,0x0289,0x0000,0x0000,
+0x0288,0x106A,0x0289,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000,0x0000,
+0x0E4A,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000,0x0000,
+0x0EB9,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0F10,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0000,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0000,0x0000,0x0000,0x0000,
+0x0FB4,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000,0x0000,
+0x0FEA,0x0000,0x0000,0x0000,0x0000,
+0x1002,0x0000,0x0000,0x0000,0x0000,
+0x101F,0x0000,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000,0x0000,
+0x1051,0x0000,0x0000,0x0000,0x0000,
+0x105A,0x0000,0x0000,0x0000,0x0000,
+0x105E,0x0000,0x0000,0x0000,0x0000,
+0x106A,0x0000,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000,0x0000,
+0x0E4A,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000,0x0000,
+0x0EB9,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0F10,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0000,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0000,0x0000,0x0000,0x0000,
+0x0FB4,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000,0x0000,
+0x0FEA,0x0000,0x0000,0x0000,0x0000,
+0x1002,0x0000,0x0000,0x0000,0x0000,
+0x101F,0x0000,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000,0x0000,
+0x1051,0x0000,0x0000,0x0000,0x0000,
+0x105A,0x0000,0x0000,0x0000,0x0000,
+0x105E,0x0000,0x0000,0x0000,0x0000,
+0x106A,0x0000,0x0000,0x0000,0x0000,
+0x0E29,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2A,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2B,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2C,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2D,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2E,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2F,0x0000,0x0000,0x0000,
+0x0E2A,0x0E30,0x0000,0x0000,0x0000,
+0x0E2A,0x0E31,0x0000,0x0000,0x0000,
+0x0E2A,0x0E32,0x0000,0x0000,0x0000,
+0x0E2B,0x0E29,0x0000,0x0000,0x0000,
+0x0E2A,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E29,0x0000,0x0000,0x0000,
+0x0E29,0x0000,0x0000,0x0000,0x0000
+};
+
+static uint16 page025data[]= { /* 2500 (2 weights per char) */
+0x05FC,0x0000, 0x05FD,0x0000, 0x05FE,0x0000, 0x05FF,0x0000,
+0x0600,0x0000, 0x0601,0x0000, 0x0602,0x0000, 0x0603,0x0000,
+0x0604,0x0000, 0x0605,0x0000, 0x0606,0x0000, 0x0607,0x0000,
+0x0608,0x0000, 0x0609,0x0000, 0x060A,0x0000, 0x060B,0x0000,
+0x060C,0x0000, 0x060D,0x0000, 0x060E,0x0000, 0x060F,0x0000,
+0x0610,0x0000, 0x0611,0x0000, 0x0612,0x0000, 0x0613,0x0000,
+0x0614,0x0000, 0x0615,0x0000, 0x0616,0x0000, 0x0617,0x0000,
+0x0618,0x0000, 0x0619,0x0000, 0x061A,0x0000, 0x061B,0x0000,
+0x061C,0x0000, 0x061D,0x0000, 0x061E,0x0000, 0x061F,0x0000,
+0x0620,0x0000, 0x0621,0x0000, 0x0622,0x0000, 0x0623,0x0000,
+0x0624,0x0000, 0x0625,0x0000, 0x0626,0x0000, 0x0627,0x0000,
+0x0628,0x0000, 0x0629,0x0000, 0x062A,0x0000, 0x062B,0x0000,
+0x062C,0x0000, 0x062D,0x0000, 0x062E,0x0000, 0x062F,0x0000,
+0x0630,0x0000, 0x0631,0x0000, 0x0632,0x0000, 0x0633,0x0000,
+0x0634,0x0000, 0x0635,0x0000, 0x0636,0x0000, 0x0637,0x0000,
+0x0638,0x0000, 0x0639,0x0000, 0x063A,0x0000, 0x063B,0x0000,
+0x063C,0x0000, 0x063D,0x0000, 0x063E,0x0000, 0x063F,0x0000,
+0x0640,0x0000, 0x0641,0x0000, 0x0642,0x0000, 0x0643,0x0000,
+0x0644,0x0000, 0x0645,0x0000, 0x0646,0x0000, 0x0647,0x0000,
+0x0648,0x0000, 0x0649,0x0000, 0x064A,0x0000, 0x064B,0x0000,
+0x064C,0x0000, 0x064D,0x0000, 0x064E,0x0000, 0x064F,0x0000,
+0x0650,0x0000, 0x0651,0x0000, 0x0652,0x0000, 0x0653,0x0000,
+0x0654,0x0000, 0x0655,0x0000, 0x0656,0x0000, 0x0657,0x0000,
+0x0658,0x0000, 0x0659,0x0000, 0x065A,0x0000, 0x065B,0x0000,
+0x065C,0x0000, 0x065D,0x0000, 0x065E,0x0000, 0x065F,0x0000,
+0x0660,0x0000, 0x0661,0x0000, 0x0662,0x0000, 0x0663,0x0000,
+0x0664,0x0000, 0x0665,0x0000, 0x0666,0x0000, 0x0667,0x0000,
+0x0668,0x0000, 0x0669,0x0000, 0x066A,0x0000, 0x066B,0x0000,
+0x066C,0x0000, 0x066D,0x0000, 0x066E,0x0000, 0x066F,0x0000,
+0x0670,0x0000, 0x0671,0x0000, 0x0672,0x0000, 0x0673,0x0000,
+0x0674,0x0000, 0x0675,0x0000, 0x0676,0x0000, 0x0677,0x0000,
+0x0678,0x0000, 0x0679,0x0000, 0x067A,0x0000, 0x067B,0x0000,
+0x067C,0x0000, 0x067D,0x0000, 0x067E,0x0000, 0x067F,0x0000,
+0x0680,0x0000, 0x0681,0x0000, 0x0682,0x0000, 0x0683,0x0000,
+0x0684,0x0000, 0x0685,0x0000, 0x0686,0x0000, 0x0687,0x0000,
+0x0688,0x0000, 0x0689,0x0000, 0x068A,0x0000, 0x068B,0x0000,
+0x068C,0x0000, 0x068D,0x0000, 0x068E,0x0000, 0x068F,0x0000,
+0x0690,0x0000, 0x0691,0x0000, 0x0692,0x0000, 0x0693,0x0000,
+0x0694,0x0000, 0x0695,0x0000, 0x0696,0x0000, 0x0697,0x0000,
+0x0698,0x0000, 0x0699,0x0000, 0x069A,0x0000, 0x069B,0x0000,
+0x069C,0x0000, 0x069D,0x0000, 0x069E,0x0000, 0x069F,0x0000,
+0x06A0,0x0000, 0x06A1,0x0000, 0x06A2,0x0000, 0x06A3,0x0000,
+0x06A4,0x0000, 0x06A5,0x0000, 0x06A6,0x0000, 0x06A7,0x0000,
+0x06A8,0x0000, 0x06A9,0x0000, 0x06AA,0x0000, 0x06AB,0x0000,
+0x06AC,0x0000, 0x06AD,0x0000, 0x06AE,0x0000, 0x06AF,0x0000,
+0x06B0,0x0000, 0x06B1,0x0000, 0x06B2,0x0000, 0x06B3,0x0000,
+0x06B4,0x0000, 0x06B5,0x0000, 0x06B6,0x0000, 0x06B7,0x0000,
+0x06B8,0x0000, 0x06B9,0x0000, 0x06BA,0x0000, 0x06BB,0x0000,
+0x06BC,0x0000, 0x06BD,0x0000, 0x06BE,0x0000, 0x06BF,0x0000,
+0x06C0,0x0000, 0x06C1,0x0000, 0x06C2,0x0000, 0x06C3,0x0000,
+0x06C4,0x0000, 0x06C5,0x0000, 0x06C6,0x0000, 0x06C7,0x0000,
+0x06C8,0x0000, 0x06C9,0x0000, 0x06CA,0x0000, 0x06CB,0x0000,
+0x06CC,0x0000, 0x06CD,0x0000, 0x06CE,0x0000, 0x06CF,0x0000,
+0x06D0,0x0000, 0x06D1,0x0000, 0x06D2,0x0000, 0x06D3,0x0000,
+0x06D4,0x0000, 0x06D5,0x0000, 0x06D6,0x0000, 0x06D7,0x0000,
+0x06D8,0x0000, 0x06D9,0x0000, 0x06DA,0x0000, 0x06DB,0x0000,
+0x06DC,0x0000, 0x06DD,0x0000, 0x06DE,0x0000, 0x06DF,0x0000,
+0x06E0,0x0000, 0x06E1,0x0000, 0x06E2,0x0000, 0x06E3,0x0000,
+0x06E4,0x0000, 0x06E5,0x0000, 0x06E6,0x0000, 0x06E7,0x0000,
+0x06E8,0x0000, 0x06E9,0x0000, 0x06EA,0x0000, 0x06EB,0x0000,
+0x06EC,0x0000, 0x06ED,0x0000, 0x06EE,0x0000, 0x06EF,0x0000,
+0x06F0,0x0000, 0x06F1,0x0000, 0x06F2,0x0000, 0x06F3,0x0000,
+0x06F4,0x0000, 0x06F5,0x0000, 0x06F6,0x0000, 0x06F7,0x0000,
+0x06F8,0x0000, 0x06F9,0x0000, 0x06FA,0x0000, 0x06FB,0x0000
+};
+
+static uint16 page026data[]= { /* 2600 (3 weights per char) */
+0x06FC,0x0000,0x0000, 0x06FD,0x0000,0x0000, 0x06FE,0x0000,0x0000,
+0x06FF,0x0000,0x0000, 0x0700,0x0000,0x0000, 0x0701,0x0000,0x0000,
+0x0702,0x0000,0x0000, 0x0703,0x0000,0x0000, 0x0704,0x0000,0x0000,
+0x0705,0x0000,0x0000, 0x0706,0x0000,0x0000, 0x0707,0x0000,0x0000,
+0x0708,0x0000,0x0000, 0x0709,0x0000,0x0000, 0x070A,0x0000,0x0000,
+0x070B,0x0000,0x0000, 0x070C,0x0000,0x0000, 0x070D,0x0000,0x0000,
+0x070E,0x0000,0x0000, 0x070F,0x0000,0x0000, 0x0710,0x0000,0x0000,
+0x0711,0x0000,0x0000, 0x0712,0x0000,0x0000, 0x0713,0x0000,0x0000,
+0xFBC0,0xA618,0x0000, 0x0714,0x0000,0x0000, 0x0715,0x0000,0x0000,
+0x0716,0x0000,0x0000, 0x0717,0x0000,0x0000, 0x0718,0x0000,0x0000,
+0x0719,0x0000,0x0000, 0x071A,0x0000,0x0000, 0x071B,0x0000,0x0000,
+0x071C,0x0000,0x0000, 0x071D,0x0000,0x0000, 0x071E,0x0000,0x0000,
+0x071F,0x0000,0x0000, 0x0720,0x0000,0x0000, 0x0721,0x0000,0x0000,
+0x0722,0x0000,0x0000, 0x0723,0x0000,0x0000, 0x0724,0x0000,0x0000,
+0x0725,0x0000,0x0000, 0x0726,0x0000,0x0000, 0x0727,0x0000,0x0000,
+0x0728,0x0000,0x0000, 0x0729,0x0000,0x0000, 0x072A,0x0000,0x0000,
+0x0B2F,0x0000,0x0000, 0x0B30,0x0000,0x0000, 0x0B31,0x0000,0x0000,
+0x0B32,0x0000,0x0000, 0x0B33,0x0000,0x0000, 0x0B34,0x0000,0x0000,
+0x0B35,0x0000,0x0000, 0x0B36,0x0000,0x0000, 0x072B,0x0000,0x0000,
+0x072C,0x0000,0x0000, 0x072D,0x0000,0x0000, 0x072E,0x0000,0x0000,
+0x072F,0x0000,0x0000, 0x0730,0x0000,0x0000, 0x0731,0x0000,0x0000,
+0x0732,0x0000,0x0000, 0x0733,0x0000,0x0000, 0x0734,0x0000,0x0000,
+0x0735,0x0000,0x0000, 0x0736,0x0000,0x0000, 0x0737,0x0000,0x0000,
+0x0738,0x0000,0x0000, 0x0739,0x0000,0x0000, 0x073A,0x0000,0x0000,
+0x073B,0x0000,0x0000, 0x073C,0x0000,0x0000, 0x073D,0x0000,0x0000,
+0x073E,0x0000,0x0000, 0x073F,0x0000,0x0000, 0x0740,0x0000,0x0000,
+0x0741,0x0000,0x0000, 0x0742,0x0000,0x0000, 0x0743,0x0000,0x0000,
+0x0744,0x0000,0x0000, 0x0745,0x0000,0x0000, 0x0746,0x0000,0x0000,
+0x0747,0x0000,0x0000, 0x0748,0x0000,0x0000, 0x0749,0x0000,0x0000,
+0x074A,0x0000,0x0000, 0x074B,0x0000,0x0000, 0x074C,0x0000,0x0000,
+0x074D,0x0000,0x0000, 0x074E,0x0000,0x0000, 0x074F,0x0000,0x0000,
+0x0750,0x0000,0x0000, 0x0751,0x0000,0x0000, 0x0752,0x0000,0x0000,
+0x0753,0x0000,0x0000, 0x0754,0x0000,0x0000, 0x0755,0x0000,0x0000,
+0x0756,0x0000,0x0000, 0x0757,0x0000,0x0000, 0x0758,0x0000,0x0000,
+0x0759,0x0000,0x0000, 0x075A,0x0000,0x0000, 0x075B,0x0000,0x0000,
+0x075C,0x0000,0x0000, 0x075D,0x0000,0x0000, 0x075E,0x0000,0x0000,
+0x075F,0x0000,0x0000, 0x0D2B,0x0000,0x0000, 0x0D2C,0x0000,0x0000,
+0x0D2D,0x0000,0x0000, 0x0760,0x0000,0x0000, 0x0761,0x0000,0x0000,
+0x0762,0x0000,0x0000, 0x0763,0x0000,0x0000, 0x0764,0x0000,0x0000,
+0x0765,0x0000,0x0000, 0x0766,0x0000,0x0000, 0x0767,0x0000,0x0000,
+0x0768,0x0000,0x0000, 0x0769,0x0000,0x0000, 0x076A,0x0000,0x0000,
+0x076B,0x0000,0x0000, 0x076C,0x0000,0x0000, 0x076D,0x0000,0x0000,
+0xFBC0,0xA67E,0x0000, 0xFBC0,0xA67F,0x0000, 0x076E,0x0000,0x0000,
+0x076F,0x0000,0x0000, 0x0770,0x0000,0x0000, 0x0771,0x0000,0x0000,
+0x0772,0x0000,0x0000, 0x0773,0x0000,0x0000, 0x0774,0x0000,0x0000,
+0x0775,0x0000,0x0000, 0x0776,0x0000,0x0000, 0x0777,0x0000,0x0000,
+0x0B29,0x0000,0x0000, 0x0B2A,0x0000,0x0000, 0x0B2B,0x0000,0x0000,
+0x0B2C,0x0000,0x0000, 0x0B2D,0x0000,0x0000, 0x0B2E,0x0000,0x0000,
+0x0778,0x0000,0x0000, 0x0779,0x0000,0x0000, 0xFBC0,0xA692,0x0000,
+0xFBC0,0xA693,0x0000, 0xFBC0,0xA694,0x0000, 0xFBC0,0xA695,0x0000,
+0xFBC0,0xA696,0x0000, 0xFBC0,0xA697,0x0000, 0xFBC0,0xA698,0x0000,
+0xFBC0,0xA699,0x0000, 0xFBC0,0xA69A,0x0000, 0xFBC0,0xA69B,0x0000,
+0xFBC0,0xA69C,0x0000, 0xFBC0,0xA69D,0x0000, 0xFBC0,0xA69E,0x0000,
+0xFBC0,0xA69F,0x0000, 0x077A,0x0000,0x0000, 0x077B,0x0000,0x0000,
+0xFBC0,0xA6A2,0x0000, 0xFBC0,0xA6A3,0x0000, 0xFBC0,0xA6A4,0x0000,
+0xFBC0,0xA6A5,0x0000, 0xFBC0,0xA6A6,0x0000, 0xFBC0,0xA6A7,0x0000,
+0xFBC0,0xA6A8,0x0000, 0xFBC0,0xA6A9,0x0000, 0xFBC0,0xA6AA,0x0000,
+0xFBC0,0xA6AB,0x0000, 0xFBC0,0xA6AC,0x0000, 0xFBC0,0xA6AD,0x0000,
+0xFBC0,0xA6AE,0x0000, 0xFBC0,0xA6AF,0x0000, 0xFBC0,0xA6B0,0x0000,
+0xFBC0,0xA6B1,0x0000, 0xFBC0,0xA6B2,0x0000, 0xFBC0,0xA6B3,0x0000,
+0xFBC0,0xA6B4,0x0000, 0xFBC0,0xA6B5,0x0000, 0xFBC0,0xA6B6,0x0000,
+0xFBC0,0xA6B7,0x0000, 0xFBC0,0xA6B8,0x0000, 0xFBC0,0xA6B9,0x0000,
+0xFBC0,0xA6BA,0x0000, 0xFBC0,0xA6BB,0x0000, 0xFBC0,0xA6BC,0x0000,
+0xFBC0,0xA6BD,0x0000, 0xFBC0,0xA6BE,0x0000, 0xFBC0,0xA6BF,0x0000,
+0xFBC0,0xA6C0,0x0000, 0xFBC0,0xA6C1,0x0000, 0xFBC0,0xA6C2,0x0000,
+0xFBC0,0xA6C3,0x0000, 0xFBC0,0xA6C4,0x0000, 0xFBC0,0xA6C5,0x0000,
+0xFBC0,0xA6C6,0x0000, 0xFBC0,0xA6C7,0x0000, 0xFBC0,0xA6C8,0x0000,
+0xFBC0,0xA6C9,0x0000, 0xFBC0,0xA6CA,0x0000, 0xFBC0,0xA6CB,0x0000,
+0xFBC0,0xA6CC,0x0000, 0xFBC0,0xA6CD,0x0000, 0xFBC0,0xA6CE,0x0000,
+0xFBC0,0xA6CF,0x0000, 0xFBC0,0xA6D0,0x0000, 0xFBC0,0xA6D1,0x0000,
+0xFBC0,0xA6D2,0x0000, 0xFBC0,0xA6D3,0x0000, 0xFBC0,0xA6D4,0x0000,
+0xFBC0,0xA6D5,0x0000, 0xFBC0,0xA6D6,0x0000, 0xFBC0,0xA6D7,0x0000,
+0xFBC0,0xA6D8,0x0000, 0xFBC0,0xA6D9,0x0000, 0xFBC0,0xA6DA,0x0000,
+0xFBC0,0xA6DB,0x0000, 0xFBC0,0xA6DC,0x0000, 0xFBC0,0xA6DD,0x0000,
+0xFBC0,0xA6DE,0x0000, 0xFBC0,0xA6DF,0x0000, 0xFBC0,0xA6E0,0x0000,
+0xFBC0,0xA6E1,0x0000, 0xFBC0,0xA6E2,0x0000, 0xFBC0,0xA6E3,0x0000,
+0xFBC0,0xA6E4,0x0000, 0xFBC0,0xA6E5,0x0000, 0xFBC0,0xA6E6,0x0000,
+0xFBC0,0xA6E7,0x0000, 0xFBC0,0xA6E8,0x0000, 0xFBC0,0xA6E9,0x0000,
+0xFBC0,0xA6EA,0x0000, 0xFBC0,0xA6EB,0x0000, 0xFBC0,0xA6EC,0x0000,
+0xFBC0,0xA6ED,0x0000, 0xFBC0,0xA6EE,0x0000, 0xFBC0,0xA6EF,0x0000,
+0xFBC0,0xA6F0,0x0000, 0xFBC0,0xA6F1,0x0000, 0xFBC0,0xA6F2,0x0000,
+0xFBC0,0xA6F3,0x0000, 0xFBC0,0xA6F4,0x0000, 0xFBC0,0xA6F5,0x0000,
+0xFBC0,0xA6F6,0x0000, 0xFBC0,0xA6F7,0x0000, 0xFBC0,0xA6F8,0x0000,
+0xFBC0,0xA6F9,0x0000, 0xFBC0,0xA6FA,0x0000, 0xFBC0,0xA6FB,0x0000,
+0xFBC0,0xA6FC,0x0000, 0xFBC0,0xA6FD,0x0000, 0xFBC0,0xA6FE,0x0000,
+0xFBC0,0xA6FF,0x0000 };
+
+static uint16 page027data[]= { /* 2700 (3 weights per char) */
+0xFBC0,0xA700,0x0000, 0x077C,0x0000,0x0000, 0x077D,0x0000,0x0000,
+0x077E,0x0000,0x0000, 0x077F,0x0000,0x0000, 0xFBC0,0xA705,0x0000,
+0x0780,0x0000,0x0000, 0x0781,0x0000,0x0000, 0x0782,0x0000,0x0000,
+0x0783,0x0000,0x0000, 0xFBC0,0xA70A,0x0000, 0xFBC0,0xA70B,0x0000,
+0x0784,0x0000,0x0000, 0x0785,0x0000,0x0000, 0x0786,0x0000,0x0000,
+0x0787,0x0000,0x0000, 0x0788,0x0000,0x0000, 0x0789,0x0000,0x0000,
+0x078A,0x0000,0x0000, 0x078B,0x0000,0x0000, 0x078C,0x0000,0x0000,
+0x078D,0x0000,0x0000, 0x078E,0x0000,0x0000, 0x078F,0x0000,0x0000,
+0x0790,0x0000,0x0000, 0x0791,0x0000,0x0000, 0x0792,0x0000,0x0000,
+0x0793,0x0000,0x0000, 0x0794,0x0000,0x0000, 0x0795,0x0000,0x0000,
+0x0796,0x0000,0x0000, 0x0797,0x0000,0x0000, 0x0798,0x0000,0x0000,
+0x0799,0x0000,0x0000, 0x079A,0x0000,0x0000, 0x079B,0x0000,0x0000,
+0x079C,0x0000,0x0000, 0x079D,0x0000,0x0000, 0x079E,0x0000,0x0000,
+0x079F,0x0000,0x0000, 0xFBC0,0xA728,0x0000, 0x07A0,0x0000,0x0000,
+0x07A1,0x0000,0x0000, 0x07A2,0x0000,0x0000, 0x07A3,0x0000,0x0000,
+0x07A4,0x0000,0x0000, 0x07A5,0x0000,0x0000, 0x07A6,0x0000,0x0000,
+0x07A7,0x0000,0x0000, 0x07A8,0x0000,0x0000, 0x07A9,0x0000,0x0000,
+0x07AA,0x0000,0x0000, 0x07AB,0x0000,0x0000, 0x07AC,0x0000,0x0000,
+0x07AD,0x0000,0x0000, 0x07AE,0x0000,0x0000, 0x07AF,0x0000,0x0000,
+0x07B0,0x0000,0x0000, 0x07B1,0x0000,0x0000, 0x07B2,0x0000,0x0000,
+0x07B3,0x0000,0x0000, 0x07B4,0x0000,0x0000, 0x07B5,0x0000,0x0000,
+0x07B6,0x0000,0x0000, 0x07B7,0x0000,0x0000, 0x07B8,0x0000,0x0000,
+0x07B9,0x0000,0x0000, 0x07BA,0x0000,0x0000, 0x07BB,0x0000,0x0000,
+0x07BC,0x0000,0x0000, 0x07BD,0x0000,0x0000, 0x07BE,0x0000,0x0000,
+0x07BF,0x0000,0x0000, 0x07C0,0x0000,0x0000, 0x07C1,0x0000,0x0000,
+0x07C2,0x0000,0x0000, 0xFBC0,0xA74C,0x0000, 0x07C3,0x0000,0x0000,
+0xFBC0,0xA74E,0x0000, 0x07C4,0x0000,0x0000, 0x07C5,0x0000,0x0000,
+0x07C6,0x0000,0x0000, 0x07C7,0x0000,0x0000, 0xFBC0,0xA753,0x0000,
+0xFBC0,0xA754,0x0000, 0xFBC0,0xA755,0x0000, 0x07C8,0x0000,0x0000,
+0xFBC0,0xA757,0x0000, 0x07C9,0x0000,0x0000, 0x07CA,0x0000,0x0000,
+0x07CB,0x0000,0x0000, 0x07CC,0x0000,0x0000, 0x07CD,0x0000,0x0000,
+0x07CE,0x0000,0x0000, 0x07CF,0x0000,0x0000, 0xFBC0,0xA75F,0x0000,
+0xFBC0,0xA760,0x0000, 0x07D0,0x0000,0x0000, 0x07D1,0x0000,0x0000,
+0x07D2,0x0000,0x0000, 0x07D3,0x0000,0x0000, 0x07D4,0x0000,0x0000,
+0x07D5,0x0000,0x0000, 0x07D6,0x0000,0x0000, 0x07D7,0x0000,0x0000,
+0x07D8,0x0000,0x0000, 0x07D9,0x0000,0x0000, 0x07DA,0x0000,0x0000,
+0x07DB,0x0000,0x0000, 0x07DC,0x0000,0x0000, 0x07DD,0x0000,0x0000,
+0x07DE,0x0000,0x0000, 0x07DF,0x0000,0x0000, 0x07E0,0x0000,0x0000,
+0x07E1,0x0000,0x0000, 0x07E2,0x0000,0x0000, 0x07E3,0x0000,0x0000,
+0x07E4,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0x0E2A,0x0E29,0x0000, 0x0E2A,0x0000,0x0000,
+0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000,
+0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000,
+0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0x0E2A,0x0E29,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x0E2A,0x0E29,0x0000, 0x07E5,0x0000,0x0000, 0xFBC0,0xA795,0x0000,
+0xFBC0,0xA796,0x0000, 0xFBC0,0xA797,0x0000, 0x07E6,0x0000,0x0000,
+0x07E7,0x0000,0x0000, 0x07E8,0x0000,0x0000, 0x07E9,0x0000,0x0000,
+0x07EA,0x0000,0x0000, 0x07EB,0x0000,0x0000, 0x07EC,0x0000,0x0000,
+0x07ED,0x0000,0x0000, 0x07EE,0x0000,0x0000, 0x07EF,0x0000,0x0000,
+0x07F0,0x0000,0x0000, 0x07F1,0x0000,0x0000, 0x07F2,0x0000,0x0000,
+0x07F3,0x0000,0x0000, 0x07F4,0x0000,0x0000, 0x07F5,0x0000,0x0000,
+0x07F6,0x0000,0x0000, 0x07F7,0x0000,0x0000, 0x07F8,0x0000,0x0000,
+0x07F9,0x0000,0x0000, 0x07FA,0x0000,0x0000, 0x07FB,0x0000,0x0000,
+0x07FC,0x0000,0x0000, 0x07FD,0x0000,0x0000, 0xFBC0,0xA7B0,0x0000,
+0x07FE,0x0000,0x0000, 0x07FF,0x0000,0x0000, 0x0800,0x0000,0x0000,
+0x0801,0x0000,0x0000, 0x0802,0x0000,0x0000, 0x0803,0x0000,0x0000,
+0x0804,0x0000,0x0000, 0x0805,0x0000,0x0000, 0x0806,0x0000,0x0000,
+0x0807,0x0000,0x0000, 0x0808,0x0000,0x0000, 0x0809,0x0000,0x0000,
+0x080A,0x0000,0x0000, 0x080B,0x0000,0x0000, 0xFBC0,0xA7BF,0x0000,
+0xFBC0,0xA7C0,0x0000, 0xFBC0,0xA7C1,0x0000, 0xFBC0,0xA7C2,0x0000,
+0xFBC0,0xA7C3,0x0000, 0xFBC0,0xA7C4,0x0000, 0xFBC0,0xA7C5,0x0000,
+0xFBC0,0xA7C6,0x0000, 0xFBC0,0xA7C7,0x0000, 0xFBC0,0xA7C8,0x0000,
+0xFBC0,0xA7C9,0x0000, 0xFBC0,0xA7CA,0x0000, 0xFBC0,0xA7CB,0x0000,
+0xFBC0,0xA7CC,0x0000, 0xFBC0,0xA7CD,0x0000, 0xFBC0,0xA7CE,0x0000,
+0xFBC0,0xA7CF,0x0000, 0x080C,0x0000,0x0000, 0x080D,0x0000,0x0000,
+0x080E,0x0000,0x0000, 0x080F,0x0000,0x0000, 0x0810,0x0000,0x0000,
+0x0811,0x0000,0x0000, 0x0812,0x0000,0x0000, 0x0813,0x0000,0x0000,
+0x0814,0x0000,0x0000, 0x0815,0x0000,0x0000, 0x0816,0x0000,0x0000,
+0x0817,0x0000,0x0000, 0x0818,0x0000,0x0000, 0x0819,0x0000,0x0000,
+0x081A,0x0000,0x0000, 0x081B,0x0000,0x0000, 0x081C,0x0000,0x0000,
+0x081D,0x0000,0x0000, 0x081E,0x0000,0x0000, 0x081F,0x0000,0x0000,
+0x0820,0x0000,0x0000, 0x0821,0x0000,0x0000, 0x0822,0x0000,0x0000,
+0x0823,0x0000,0x0000, 0x0824,0x0000,0x0000, 0x0825,0x0000,0x0000,
+0x0826,0x0000,0x0000, 0x0827,0x0000,0x0000, 0xFBC0,0xA7EC,0x0000,
+0xFBC0,0xA7ED,0x0000, 0xFBC0,0xA7EE,0x0000, 0xFBC0,0xA7EF,0x0000,
+0x0828,0x0000,0x0000, 0x0829,0x0000,0x0000, 0x082A,0x0000,0x0000,
+0x082B,0x0000,0x0000, 0x082C,0x0000,0x0000, 0x082D,0x0000,0x0000,
+0x082E,0x0000,0x0000, 0x082F,0x0000,0x0000, 0x0830,0x0000,0x0000,
+0x0831,0x0000,0x0000, 0x0832,0x0000,0x0000, 0x0833,0x0000,0x0000,
+0x0834,0x0000,0x0000, 0x0835,0x0000,0x0000, 0x0836,0x0000,0x0000,
+0x0837,0x0000,0x0000 };
+
+static uint16 page028data[]= { /* 2800 (2 weights per char) */
+0x0A29,0x0000, 0x0A2A,0x0000, 0x0A2B,0x0000, 0x0A2C,0x0000,
+0x0A2D,0x0000, 0x0A2E,0x0000, 0x0A2F,0x0000, 0x0A30,0x0000,
+0x0A31,0x0000, 0x0A32,0x0000, 0x0A33,0x0000, 0x0A34,0x0000,
+0x0A35,0x0000, 0x0A36,0x0000, 0x0A37,0x0000, 0x0A38,0x0000,
+0x0A39,0x0000, 0x0A3A,0x0000, 0x0A3B,0x0000, 0x0A3C,0x0000,
+0x0A3D,0x0000, 0x0A3E,0x0000, 0x0A3F,0x0000, 0x0A40,0x0000,
+0x0A41,0x0000, 0x0A42,0x0000, 0x0A43,0x0000, 0x0A44,0x0000,
+0x0A45,0x0000, 0x0A46,0x0000, 0x0A47,0x0000, 0x0A48,0x0000,
+0x0A49,0x0000, 0x0A4A,0x0000, 0x0A4B,0x0000, 0x0A4C,0x0000,
+0x0A4D,0x0000, 0x0A4E,0x0000, 0x0A4F,0x0000, 0x0A50,0x0000,
+0x0A51,0x0000, 0x0A52,0x0000, 0x0A53,0x0000, 0x0A54,0x0000,
+0x0A55,0x0000, 0x0A56,0x0000, 0x0A57,0x0000, 0x0A58,0x0000,
+0x0A59,0x0000, 0x0A5A,0x0000, 0x0A5B,0x0000, 0x0A5C,0x0000,
+0x0A5D,0x0000, 0x0A5E,0x0000, 0x0A5F,0x0000, 0x0A60,0x0000,
+0x0A61,0x0000, 0x0A62,0x0000, 0x0A63,0x0000, 0x0A64,0x0000,
+0x0A65,0x0000, 0x0A66,0x0000, 0x0A67,0x0000, 0x0A68,0x0000,
+0x0A69,0x0000, 0x0A6A,0x0000, 0x0A6B,0x0000, 0x0A6C,0x0000,
+0x0A6D,0x0000, 0x0A6E,0x0000, 0x0A6F,0x0000, 0x0A70,0x0000,
+0x0A71,0x0000, 0x0A72,0x0000, 0x0A73,0x0000, 0x0A74,0x0000,
+0x0A75,0x0000, 0x0A76,0x0000, 0x0A77,0x0000, 0x0A78,0x0000,
+0x0A79,0x0000, 0x0A7A,0x0000, 0x0A7B,0x0000, 0x0A7C,0x0000,
+0x0A7D,0x0000, 0x0A7E,0x0000, 0x0A7F,0x0000, 0x0A80,0x0000,
+0x0A81,0x0000, 0x0A82,0x0000, 0x0A83,0x0000, 0x0A84,0x0000,
+0x0A85,0x0000, 0x0A86,0x0000, 0x0A87,0x0000, 0x0A88,0x0000,
+0x0A89,0x0000, 0x0A8A,0x0000, 0x0A8B,0x0000, 0x0A8C,0x0000,
+0x0A8D,0x0000, 0x0A8E,0x0000, 0x0A8F,0x0000, 0x0A90,0x0000,
+0x0A91,0x0000, 0x0A92,0x0000, 0x0A93,0x0000, 0x0A94,0x0000,
+0x0A95,0x0000, 0x0A96,0x0000, 0x0A97,0x0000, 0x0A98,0x0000,
+0x0A99,0x0000, 0x0A9A,0x0000, 0x0A9B,0x0000, 0x0A9C,0x0000,
+0x0A9D,0x0000, 0x0A9E,0x0000, 0x0A9F,0x0000, 0x0AA0,0x0000,
+0x0AA1,0x0000, 0x0AA2,0x0000, 0x0AA3,0x0000, 0x0AA4,0x0000,
+0x0AA5,0x0000, 0x0AA6,0x0000, 0x0AA7,0x0000, 0x0AA8,0x0000,
+0x0AA9,0x0000, 0x0AAA,0x0000, 0x0AAB,0x0000, 0x0AAC,0x0000,
+0x0AAD,0x0000, 0x0AAE,0x0000, 0x0AAF,0x0000, 0x0AB0,0x0000,
+0x0AB1,0x0000, 0x0AB2,0x0000, 0x0AB3,0x0000, 0x0AB4,0x0000,
+0x0AB5,0x0000, 0x0AB6,0x0000, 0x0AB7,0x0000, 0x0AB8,0x0000,
+0x0AB9,0x0000, 0x0ABA,0x0000, 0x0ABB,0x0000, 0x0ABC,0x0000,
+0x0ABD,0x0000, 0x0ABE,0x0000, 0x0ABF,0x0000, 0x0AC0,0x0000,
+0x0AC1,0x0000, 0x0AC2,0x0000, 0x0AC3,0x0000, 0x0AC4,0x0000,
+0x0AC5,0x0000, 0x0AC6,0x0000, 0x0AC7,0x0000, 0x0AC8,0x0000,
+0x0AC9,0x0000, 0x0ACA,0x0000, 0x0ACB,0x0000, 0x0ACC,0x0000,
+0x0ACD,0x0000, 0x0ACE,0x0000, 0x0ACF,0x0000, 0x0AD0,0x0000,
+0x0AD1,0x0000, 0x0AD2,0x0000, 0x0AD3,0x0000, 0x0AD4,0x0000,
+0x0AD5,0x0000, 0x0AD6,0x0000, 0x0AD7,0x0000, 0x0AD8,0x0000,
+0x0AD9,0x0000, 0x0ADA,0x0000, 0x0ADB,0x0000, 0x0ADC,0x0000,
+0x0ADD,0x0000, 0x0ADE,0x0000, 0x0ADF,0x0000, 0x0AE0,0x0000,
+0x0AE1,0x0000, 0x0AE2,0x0000, 0x0AE3,0x0000, 0x0AE4,0x0000,
+0x0AE5,0x0000, 0x0AE6,0x0000, 0x0AE7,0x0000, 0x0AE8,0x0000,
+0x0AE9,0x0000, 0x0AEA,0x0000, 0x0AEB,0x0000, 0x0AEC,0x0000,
+0x0AED,0x0000, 0x0AEE,0x0000, 0x0AEF,0x0000, 0x0AF0,0x0000,
+0x0AF1,0x0000, 0x0AF2,0x0000, 0x0AF3,0x0000, 0x0AF4,0x0000,
+0x0AF5,0x0000, 0x0AF6,0x0000, 0x0AF7,0x0000, 0x0AF8,0x0000,
+0x0AF9,0x0000, 0x0AFA,0x0000, 0x0AFB,0x0000, 0x0AFC,0x0000,
+0x0AFD,0x0000, 0x0AFE,0x0000, 0x0AFF,0x0000, 0x0B00,0x0000,
+0x0B01,0x0000, 0x0B02,0x0000, 0x0B03,0x0000, 0x0B04,0x0000,
+0x0B05,0x0000, 0x0B06,0x0000, 0x0B07,0x0000, 0x0B08,0x0000,
+0x0B09,0x0000, 0x0B0A,0x0000, 0x0B0B,0x0000, 0x0B0C,0x0000,
+0x0B0D,0x0000, 0x0B0E,0x0000, 0x0B0F,0x0000, 0x0B10,0x0000,
+0x0B11,0x0000, 0x0B12,0x0000, 0x0B13,0x0000, 0x0B14,0x0000,
+0x0B15,0x0000, 0x0B16,0x0000, 0x0B17,0x0000, 0x0B18,0x0000,
+0x0B19,0x0000, 0x0B1A,0x0000, 0x0B1B,0x0000, 0x0B1C,0x0000,
+0x0B1D,0x0000, 0x0B1E,0x0000, 0x0B1F,0x0000, 0x0B20,0x0000,
+0x0B21,0x0000, 0x0B22,0x0000, 0x0B23,0x0000, 0x0B24,0x0000,
+0x0B25,0x0000, 0x0B26,0x0000, 0x0B27,0x0000, 0x0B28,0x0000
+};
+
+static uint16 page029data[]= { /* 2900 (2 weights per char) */
+0x0838,0x0000, 0x0839,0x0000, 0x083A,0x0000, 0x083B,0x0000,
+0x083C,0x0000, 0x083D,0x0000, 0x083E,0x0000, 0x083F,0x0000,
+0x0840,0x0000, 0x0841,0x0000, 0x0842,0x0000, 0x0843,0x0000,
+0x0844,0x0000, 0x0845,0x0000, 0x0846,0x0000, 0x0847,0x0000,
+0x0848,0x0000, 0x0849,0x0000, 0x084A,0x0000, 0x084B,0x0000,
+0x084C,0x0000, 0x084D,0x0000, 0x084E,0x0000, 0x084F,0x0000,
+0x0850,0x0000, 0x0851,0x0000, 0x0852,0x0000, 0x0853,0x0000,
+0x0854,0x0000, 0x0855,0x0000, 0x0856,0x0000, 0x0857,0x0000,
+0x0858,0x0000, 0x0859,0x0000, 0x085A,0x0000, 0x085B,0x0000,
+0x085C,0x0000, 0x085D,0x0000, 0x085E,0x0000, 0x085F,0x0000,
+0x0860,0x0000, 0x0861,0x0000, 0x0862,0x0000, 0x0863,0x0000,
+0x0864,0x0000, 0x0865,0x0000, 0x0866,0x0000, 0x0867,0x0000,
+0x0868,0x0000, 0x0869,0x0000, 0x086A,0x0000, 0x086B,0x0000,
+0x086C,0x0000, 0x086D,0x0000, 0x086E,0x0000, 0x086F,0x0000,
+0x0870,0x0000, 0x0871,0x0000, 0x0872,0x0000, 0x0873,0x0000,
+0x0874,0x0000, 0x0875,0x0000, 0x0876,0x0000, 0x0877,0x0000,
+0x0878,0x0000, 0x0879,0x0000, 0x087A,0x0000, 0x087B,0x0000,
+0x087C,0x0000, 0x087D,0x0000, 0x087E,0x0000, 0x087F,0x0000,
+0x0880,0x0000, 0x0881,0x0000, 0x0882,0x0000, 0x0883,0x0000,
+0x0884,0x0000, 0x0885,0x0000, 0x0886,0x0000, 0x0887,0x0000,
+0x0888,0x0000, 0x0889,0x0000, 0x088A,0x0000, 0x088B,0x0000,
+0x088C,0x0000, 0x088D,0x0000, 0x088E,0x0000, 0x088F,0x0000,
+0x0890,0x0000, 0x0891,0x0000, 0x0892,0x0000, 0x0893,0x0000,
+0x0894,0x0000, 0x0895,0x0000, 0x0896,0x0000, 0x0897,0x0000,
+0x0898,0x0000, 0x0899,0x0000, 0x089A,0x0000, 0x089B,0x0000,
+0x089C,0x0000, 0x089D,0x0000, 0x089E,0x0000, 0x089F,0x0000,
+0x08A0,0x0000, 0x08A1,0x0000, 0x08A2,0x0000, 0x08A3,0x0000,
+0x08A4,0x0000, 0x08A5,0x0000, 0x08A6,0x0000, 0x08A7,0x0000,
+0x08A8,0x0000, 0x08A9,0x0000, 0x08AA,0x0000, 0x08AB,0x0000,
+0x08AC,0x0000, 0x08AD,0x0000, 0x08AE,0x0000, 0x08AF,0x0000,
+0x08B0,0x0000, 0x08B1,0x0000, 0x08B2,0x0000, 0x08B3,0x0000,
+0x08B4,0x0000, 0x08B5,0x0000, 0x08B6,0x0000, 0x08B7,0x0000,
+0x08B8,0x0000, 0x08B9,0x0000, 0x08BA,0x0000, 0x0298,0x0000,
+0x0299,0x0000, 0x029A,0x0000, 0x029B,0x0000, 0x029C,0x0000,
+0x029D,0x0000, 0x029E,0x0000, 0x029F,0x0000, 0x02A0,0x0000,
+0x02A1,0x0000, 0x02A2,0x0000, 0x02A3,0x0000, 0x02A4,0x0000,
+0x02A5,0x0000, 0x02A6,0x0000, 0x02A7,0x0000, 0x02A8,0x0000,
+0x02A9,0x0000, 0x02AA,0x0000, 0x02AB,0x0000, 0x02AC,0x0000,
+0x02AD,0x0000, 0x08BB,0x0000, 0x08BC,0x0000, 0x08BD,0x0000,
+0x08BE,0x0000, 0x08BF,0x0000, 0x08C0,0x0000, 0x08C1,0x0000,
+0x08C2,0x0000, 0x08C3,0x0000, 0x08C4,0x0000, 0x08C5,0x0000,
+0x08C6,0x0000, 0x08C7,0x0000, 0x08C8,0x0000, 0x08C9,0x0000,
+0x08CA,0x0000, 0x08CB,0x0000, 0x08CC,0x0000, 0x08CD,0x0000,
+0x08CE,0x0000, 0x08CF,0x0000, 0x08D0,0x0000, 0x08D1,0x0000,
+0x08D2,0x0000, 0x08D3,0x0000, 0x08D4,0x0000, 0x08D5,0x0000,
+0x08D6,0x0000, 0x08D7,0x0000, 0x08D8,0x0000, 0x08D9,0x0000,
+0x08DA,0x0000, 0x08DB,0x0000, 0x08DC,0x0000, 0x08DD,0x0000,
+0x08DE,0x0000, 0x08DF,0x0000, 0x08E0,0x0000, 0x08E1,0x0000,
+0x08E2,0x0000, 0x08E3,0x0000, 0x08E4,0x0000, 0x08E5,0x0000,
+0x08E6,0x0000, 0x08E7,0x0000, 0x08E8,0x0000, 0x08E9,0x0000,
+0x08EA,0x0000, 0x08EB,0x0000, 0x08EC,0x0000, 0x08ED,0x0000,
+0x08EE,0x0000, 0x08EF,0x0000, 0x08F0,0x0000, 0x08F1,0x0000,
+0x08F2,0x0000, 0x08F3,0x0000, 0x08F4,0x0000, 0x08F5,0x0000,
+0x08F6,0x0000, 0x08F7,0x0000, 0x08F8,0x0000, 0x08F9,0x0000,
+0x08FA,0x0000, 0x08FB,0x0000, 0x08FC,0x0000, 0x08FD,0x0000,
+0x08FE,0x0000, 0x08FF,0x0000, 0x0900,0x0000, 0x0901,0x0000,
+0x0902,0x0000, 0x0903,0x0000, 0x0904,0x0000, 0x0905,0x0000,
+0x0906,0x0000, 0x0907,0x0000, 0x0908,0x0000, 0x0909,0x0000,
+0x090A,0x0000, 0x090B,0x0000, 0x090C,0x0000, 0x090D,0x0000,
+0x090E,0x0000, 0x090F,0x0000, 0x0910,0x0000, 0x0911,0x0000,
+0x0912,0x0000, 0x0913,0x0000, 0x0914,0x0000, 0x0915,0x0000,
+0x0916,0x0000, 0x0917,0x0000, 0x0918,0x0000, 0x0919,0x0000,
+0x091A,0x0000, 0x091B,0x0000, 0x091C,0x0000, 0x091D,0x0000,
+0x0296,0x0000, 0x0297,0x0000, 0x091E,0x0000, 0x091F,0x0000
+};
+
+static uint16 page02Adata[]= { /* 2A00 (5 weights per char) */
+0x0920,0x0000,0x0000,0x0000,0x0000,
+0x0921,0x0000,0x0000,0x0000,0x0000,
+0x0922,0x0000,0x0000,0x0000,0x0000,
+0x0923,0x0000,0x0000,0x0000,0x0000,
+0x0924,0x0000,0x0000,0x0000,0x0000,
+0x0925,0x0000,0x0000,0x0000,0x0000,
+0x0926,0x0000,0x0000,0x0000,0x0000,
+0x0927,0x0000,0x0000,0x0000,0x0000,
+0x0928,0x0000,0x0000,0x0000,0x0000,
+0x0929,0x0000,0x0000,0x0000,0x0000,
+0x092A,0x0000,0x0000,0x0000,0x0000,
+0x092B,0x0000,0x0000,0x0000,0x0000,
+0x044B,0x044B,0x044B,0x044B,0x0000,
+0x092C,0x0000,0x0000,0x0000,0x0000,
+0x092D,0x0000,0x0000,0x0000,0x0000,
+0x092E,0x0000,0x0000,0x0000,0x0000,
+0x092F,0x0000,0x0000,0x0000,0x0000,
+0x0930,0x0000,0x0000,0x0000,0x0000,
+0x0931,0x0000,0x0000,0x0000,0x0000,
+0x0932,0x0000,0x0000,0x0000,0x0000,
+0x0933,0x0000,0x0000,0x0000,0x0000,
+0x0934,0x0000,0x0000,0x0000,0x0000,
+0x0935,0x0000,0x0000,0x0000,0x0000,
+0x0936,0x0000,0x0000,0x0000,0x0000,
+0x0937,0x0000,0x0000,0x0000,0x0000,
+0x0938,0x0000,0x0000,0x0000,0x0000,
+0x0939,0x0000,0x0000,0x0000,0x0000,
+0x093A,0x0000,0x0000,0x0000,0x0000,
+0x093B,0x0000,0x0000,0x0000,0x0000,
+0x093C,0x0000,0x0000,0x0000,0x0000,
+0x093D,0x0000,0x0000,0x0000,0x0000,
+0x093E,0x0000,0x0000,0x0000,0x0000,
+0x093F,0x0000,0x0000,0x0000,0x0000,
+0x0940,0x0000,0x0000,0x0000,0x0000,
+0x0941,0x0000,0x0000,0x0000,0x0000,
+0x0942,0x0000,0x0000,0x0000,0x0000,
+0x0943,0x0000,0x0000,0x0000,0x0000,
+0x0944,0x0000,0x0000,0x0000,0x0000,
+0x0945,0x0000,0x0000,0x0000,0x0000,
+0x0946,0x0000,0x0000,0x0000,0x0000,
+0x0947,0x0000,0x0000,0x0000,0x0000,
+0x0948,0x0000,0x0000,0x0000,0x0000,
+0x0949,0x0000,0x0000,0x0000,0x0000,
+0x094A,0x0000,0x0000,0x0000,0x0000,
+0x094B,0x0000,0x0000,0x0000,0x0000,
+0x094C,0x0000,0x0000,0x0000,0x0000,
+0x094D,0x0000,0x0000,0x0000,0x0000,
+0x094E,0x0000,0x0000,0x0000,0x0000,
+0x094F,0x0000,0x0000,0x0000,0x0000,
+0x0950,0x0000,0x0000,0x0000,0x0000,
+0x0951,0x0000,0x0000,0x0000,0x0000,
+0x0952,0x0000,0x0000,0x0000,0x0000,
+0x0953,0x0000,0x0000,0x0000,0x0000,
+0x0954,0x0000,0x0000,0x0000,0x0000,
+0x0955,0x0000,0x0000,0x0000,0x0000,
+0x0956,0x0000,0x0000,0x0000,0x0000,
+0x0957,0x0000,0x0000,0x0000,0x0000,
+0x0958,0x0000,0x0000,0x0000,0x0000,
+0x0959,0x0000,0x0000,0x0000,0x0000,
+0x095A,0x0000,0x0000,0x0000,0x0000,
+0x095B,0x0000,0x0000,0x0000,0x0000,
+0x095C,0x0000,0x0000,0x0000,0x0000,
+0x095D,0x0000,0x0000,0x0000,0x0000,
+0x095E,0x0000,0x0000,0x0000,0x0000,
+0x095F,0x0000,0x0000,0x0000,0x0000,
+0x0960,0x0000,0x0000,0x0000,0x0000,
+0x0961,0x0000,0x0000,0x0000,0x0000,
+0x0962,0x0000,0x0000,0x0000,0x0000,
+0x0963,0x0000,0x0000,0x0000,0x0000,
+0x0964,0x0000,0x0000,0x0000,0x0000,
+0x0965,0x0000,0x0000,0x0000,0x0000,
+0x0966,0x0000,0x0000,0x0000,0x0000,
+0x0967,0x0000,0x0000,0x0000,0x0000,
+0x0968,0x0000,0x0000,0x0000,0x0000,
+0x0969,0x0000,0x0000,0x0000,0x0000,
+0x096A,0x0000,0x0000,0x0000,0x0000,
+0x096B,0x0000,0x0000,0x0000,0x0000,
+0x096C,0x0000,0x0000,0x0000,0x0000,
+0x096D,0x0000,0x0000,0x0000,0x0000,
+0x096E,0x0000,0x0000,0x0000,0x0000,
+0x096F,0x0000,0x0000,0x0000,0x0000,
+0x0970,0x0000,0x0000,0x0000,0x0000,
+0x0971,0x0000,0x0000,0x0000,0x0000,
+0x0972,0x0000,0x0000,0x0000,0x0000,
+0x0973,0x0000,0x0000,0x0000,0x0000,
+0x0974,0x0000,0x0000,0x0000,0x0000,
+0x0975,0x0000,0x0000,0x0000,0x0000,
+0x0976,0x0000,0x0000,0x0000,0x0000,
+0x0977,0x0000,0x0000,0x0000,0x0000,
+0x0978,0x0000,0x0000,0x0000,0x0000,
+0x0979,0x0000,0x0000,0x0000,0x0000,
+0x097A,0x0000,0x0000,0x0000,0x0000,
+0x097B,0x0000,0x0000,0x0000,0x0000,
+0x097C,0x0000,0x0000,0x0000,0x0000,
+0x097D,0x0000,0x0000,0x0000,0x0000,
+0x097E,0x0000,0x0000,0x0000,0x0000,
+0x097F,0x0000,0x0000,0x0000,0x0000,
+0x0980,0x0000,0x0000,0x0000,0x0000,
+0x0981,0x0000,0x0000,0x0000,0x0000,
+0x0982,0x0000,0x0000,0x0000,0x0000,
+0x0983,0x0000,0x0000,0x0000,0x0000,
+0x0984,0x0000,0x0000,0x0000,0x0000,
+0x0985,0x0000,0x0000,0x0000,0x0000,
+0x0986,0x0000,0x0000,0x0000,0x0000,
+0x0987,0x0000,0x0000,0x0000,0x0000,
+0x0988,0x0000,0x0000,0x0000,0x0000,
+0x0989,0x0000,0x0000,0x0000,0x0000,
+0x098A,0x0000,0x0000,0x0000,0x0000,
+0x098B,0x0000,0x0000,0x0000,0x0000,
+0x098C,0x0000,0x0000,0x0000,0x0000,
+0x098D,0x0000,0x0000,0x0000,0x0000,
+0x098E,0x0000,0x0000,0x0000,0x0000,
+0x098F,0x0000,0x0000,0x0000,0x0000,
+0x0990,0x0000,0x0000,0x0000,0x0000,
+0x0991,0x0000,0x0000,0x0000,0x0000,
+0x0992,0x0000,0x0000,0x0000,0x0000,
+0x023D,0x023D,0x042D,0x0000,0x0000,
+0x042D,0x042D,0x0000,0x0000,0x0000,
+0x042D,0x042D,0x042D,0x0000,0x0000,
+0x0993,0x0000,0x0000,0x0000,0x0000,
+0x0994,0x0000,0x0000,0x0000,0x0000,
+0x0995,0x0000,0x0000,0x0000,0x0000,
+0x0996,0x0000,0x0000,0x0000,0x0000,
+0x0997,0x0000,0x0000,0x0000,0x0000,
+0x0998,0x0000,0x0000,0x0000,0x0000,
+0x0999,0x0000,0x0000,0x0000,0x0000,
+0x099A,0x0000,0x0000,0x0000,0x0000,
+0x099B,0x0000,0x0000,0x0000,0x0000,
+0x099C,0x0000,0x0000,0x0000,0x0000,
+0x099D,0x0000,0x0000,0x0000,0x0000,
+0x099E,0x0000,0x0000,0x0000,0x0000,
+0x099F,0x0000,0x0000,0x0000,0x0000,
+0x09A0,0x0000,0x0000,0x0000,0x0000,
+0x09A1,0x0000,0x0000,0x0000,0x0000,
+0x09A2,0x0000,0x0000,0x0000,0x0000,
+0x09A3,0x0000,0x0000,0x0000,0x0000,
+0x09A4,0x0000,0x0000,0x0000,0x0000,
+0x09A5,0x0000,0x0000,0x0000,0x0000,
+0x09A6,0x0000,0x0000,0x0000,0x0000,
+0x09A7,0x0000,0x0000,0x0000,0x0000,
+0x09A8,0x0000,0x0000,0x0000,0x0000,
+0x09A9,0x0000,0x0000,0x0000,0x0000,
+0x09AA,0x0000,0x0000,0x0000,0x0000,
+0x09AB,0x0000,0x0000,0x0000,0x0000,
+0x09AC,0x0000,0x0000,0x0000,0x0000,
+0x09AD,0x0000,0x0000,0x0000,0x0000,
+0x09AE,0x0000,0x0000,0x0000,0x0000,
+0x09AF,0x0000,0x0000,0x0000,0x0000,
+0x09B0,0x0000,0x0000,0x0000,0x0000,
+0x09B1,0x0000,0x0000,0x0000,0x0000,
+0x09B2,0x0000,0x0000,0x0000,0x0000,
+0x09B3,0x0000,0x0000,0x0000,0x0000,
+0x09B4,0x0000,0x0000,0x0000,0x0000,
+0x09B5,0x0000,0x0000,0x0000,0x0000,
+0x09B6,0x0000,0x0000,0x0000,0x0000,
+0x09B7,0x0000,0x0000,0x0000,0x0000,
+0x09B8,0x0000,0x0000,0x0000,0x0000,
+0x09B9,0x0000,0x0000,0x0000,0x0000,
+0x09BA,0x0000,0x0000,0x0000,0x0000,
+0x09BB,0x0000,0x0000,0x0000,0x0000,
+0x09BC,0x0000,0x0000,0x0000,0x0000,
+0x09BD,0x0000,0x0000,0x0000,0x0000,
+0x09BE,0x0000,0x0000,0x0000,0x0000,
+0x09BF,0x0000,0x0000,0x0000,0x0000,
+0x09C0,0x0000,0x0000,0x0000,0x0000,
+0x09C1,0x0000,0x0000,0x0000,0x0000,
+0x09C2,0x0000,0x0000,0x0000,0x0000,
+0x09C3,0x0000,0x0000,0x0000,0x0000,
+0x09C4,0x0000,0x0000,0x0000,0x0000,
+0x09C5,0x0000,0x0000,0x0000,0x0000,
+0x09C6,0x0000,0x0000,0x0000,0x0000,
+0x09C7,0x0000,0x0000,0x0000,0x0000,
+0x09C8,0x0000,0x0000,0x0000,0x0000,
+0x09C9,0x0000,0x0000,0x0000,0x0000,
+0x09CA,0x0000,0x0000,0x0000,0x0000,
+0x09CB,0x0000,0x0000,0x0000,0x0000,
+0x09CC,0x0000,0x0000,0x0000,0x0000,
+0x09CD,0x0000,0x0000,0x0000,0x0000,
+0x09CE,0x0000,0x0000,0x0000,0x0000,
+0x09CF,0x0000,0x0000,0x0000,0x0000,
+0x09D0,0x0000,0x0000,0x0000,0x0000,
+0x09D1,0x0000,0x0000,0x0000,0x0000,
+0x09D2,0x0000,0x0000,0x0000,0x0000,
+0x09D3,0x0000,0x0000,0x0000,0x0000,
+0x09D4,0x0000,0x0000,0x0000,0x0000,
+0x09D5,0x0000,0x0000,0x0000,0x0000,
+0x09D6,0x0000,0x0000,0x0000,0x0000,
+0x09D7,0x0000,0x0000,0x0000,0x0000,
+0x09D8,0x0000,0x0000,0x0000,0x0000,
+0x09D9,0x0000,0x0000,0x0000,0x0000,
+0x09DA,0x0000,0x0000,0x0000,0x0000,
+0x09DB,0x0000,0x0000,0x0000,0x0000,
+0x09DC,0x0000,0x0000,0x0000,0x0000,
+0x09DD,0x0000,0x0000,0x0000,0x0000,
+0x09DE,0x0000,0x0000,0x0000,0x0000,
+0x09DF,0x0000,0x0000,0x0000,0x0000,
+0x09E0,0x0000,0x0000,0x0000,0x0000,
+0x09E1,0x0000,0x0000,0x0000,0x0000,
+0x09E2,0x0000,0x0000,0x0000,0x0000,
+0x09E3,0x0000,0x0000,0x0000,0x0000,
+0x09E4,0x0000,0x0000,0x0000,0x0000,
+0x09E5,0x0000,0x0000,0x0000,0x0000,
+0x09E6,0x0000,0x0000,0x0000,0x0000,
+0x09E7,0x0000,0x0000,0x0000,0x0000,
+0x09E8,0x0000,0x0000,0x0000,0x0000,
+0x09E9,0x0000,0x0000,0x0000,0x0000,
+0x09EA,0x0000,0x0000,0x0000,0x0000,
+0x09EB,0x0000,0x0000,0x0000,0x0000,
+0x09EC,0x0000,0x0000,0x0000,0x0000,
+0x09ED,0x0000,0x0000,0x0000,0x0000,
+0x09EE,0x0000,0x0000,0x0000,0x0000,
+0x09EF,0x0000,0x0000,0x0000,0x0000,
+0x09F0,0x0000,0x0000,0x0000,0x0000,
+0x09F1,0x0000,0x0000,0x0000,0x0000,
+0x09F2,0x0000,0x0000,0x0000,0x0000,
+0x09F3,0x0000,0x0000,0x0000,0x0000,
+0x09F4,0x0000,0x0000,0x0000,0x0000,
+0x09F5,0x0000,0x0000,0x0000,0x0000,
+0x09F6,0x0000,0x0000,0x0000,0x0000,
+0x09F7,0x0000,0x0000,0x0000,0x0000,
+0x09F8,0x0000,0x0000,0x0000,0x0000,
+0x09F8,0x0000,0x0000,0x0000,0x0000,
+0x09F9,0x0000,0x0000,0x0000,0x0000,
+0x09FA,0x0000,0x0000,0x0000,0x0000,
+0x09FB,0x0000,0x0000,0x0000,0x0000,
+0x09FC,0x0000,0x0000,0x0000,0x0000,
+0x09FD,0x0000,0x0000,0x0000,0x0000,
+0x09FE,0x0000,0x0000,0x0000,0x0000,
+0x09FF,0x0000,0x0000,0x0000,0x0000,
+0x0A00,0x0000,0x0000,0x0000,0x0000,
+0x0A01,0x0000,0x0000,0x0000,0x0000,
+0x0A02,0x0000,0x0000,0x0000,0x0000,
+0x0A03,0x0000,0x0000,0x0000,0x0000,
+0x0A04,0x0000,0x0000,0x0000,0x0000,
+0x0A05,0x0000,0x0000,0x0000,0x0000,
+0x0A06,0x0000,0x0000,0x0000,0x0000,
+0x0A07,0x0000,0x0000,0x0000,0x0000,
+0x0A08,0x0000,0x0000,0x0000,0x0000,
+0x0A09,0x0000,0x0000,0x0000,0x0000,
+0x0A0A,0x0000,0x0000,0x0000,0x0000,
+0x0A0B,0x0000,0x0000,0x0000,0x0000,
+0x0A0C,0x0000,0x0000,0x0000,0x0000,
+0x0A0D,0x0000,0x0000,0x0000,0x0000,
+0x0A0E,0x0000,0x0000,0x0000,0x0000,
+0x0A0F,0x0000,0x0000,0x0000,0x0000,
+0x0A10,0x0000,0x0000,0x0000,0x0000,
+0x0A11,0x0000,0x0000,0x0000,0x0000,
+0x0A12,0x0000,0x0000,0x0000,0x0000,
+0x0A13,0x0000,0x0000,0x0000,0x0000,
+0x0A14,0x0000,0x0000,0x0000,0x0000,
+0x0A15,0x0000,0x0000,0x0000,0x0000,
+0x0A16,0x0000,0x0000,0x0000,0x0000,
+0x0A17,0x0000,0x0000,0x0000,0x0000,
+0x0A18,0x0000,0x0000,0x0000,0x0000,
+0x0A19,0x0000,0x0000,0x0000,0x0000,
+0x0A1A,0x0000,0x0000,0x0000,0x0000
+};
+
+static uint16 page02Bdata[]= { /* 2B00 (3 weights per char) */
+0x0A1B,0x0000,0x0000, 0x0A1C,0x0000,0x0000, 0x0A1D,0x0000,0x0000,
+0x0A1E,0x0000,0x0000, 0x0A1F,0x0000,0x0000, 0x0A20,0x0000,0x0000,
+0x0A21,0x0000,0x0000, 0x0A22,0x0000,0x0000, 0x0A23,0x0000,0x0000,
+0x0A24,0x0000,0x0000, 0x0A25,0x0000,0x0000, 0x0A26,0x0000,0x0000,
+0x0A27,0x0000,0x0000, 0x0A28,0x0000,0x0000, 0xFBC0,0xAB0E,0x0000,
+0xFBC0,0xAB0F,0x0000, 0xFBC0,0xAB10,0x0000, 0xFBC0,0xAB11,0x0000,
+0xFBC0,0xAB12,0x0000, 0xFBC0,0xAB13,0x0000, 0xFBC0,0xAB14,0x0000,
+0xFBC0,0xAB15,0x0000, 0xFBC0,0xAB16,0x0000, 0xFBC0,0xAB17,0x0000,
+0xFBC0,0xAB18,0x0000, 0xFBC0,0xAB19,0x0000, 0xFBC0,0xAB1A,0x0000,
+0xFBC0,0xAB1B,0x0000, 0xFBC0,0xAB1C,0x0000, 0xFBC0,0xAB1D,0x0000,
+0xFBC0,0xAB1E,0x0000, 0xFBC0,0xAB1F,0x0000, 0xFBC0,0xAB20,0x0000,
+0xFBC0,0xAB21,0x0000, 0xFBC0,0xAB22,0x0000, 0xFBC0,0xAB23,0x0000,
+0xFBC0,0xAB24,0x0000, 0xFBC0,0xAB25,0x0000, 0xFBC0,0xAB26,0x0000,
+0xFBC0,0xAB27,0x0000, 0xFBC0,0xAB28,0x0000, 0xFBC0,0xAB29,0x0000,
+0xFBC0,0xAB2A,0x0000, 0xFBC0,0xAB2B,0x0000, 0xFBC0,0xAB2C,0x0000,
+0xFBC0,0xAB2D,0x0000, 0xFBC0,0xAB2E,0x0000, 0xFBC0,0xAB2F,0x0000,
+0xFBC0,0xAB30,0x0000, 0xFBC0,0xAB31,0x0000, 0xFBC0,0xAB32,0x0000,
+0xFBC0,0xAB33,0x0000, 0xFBC0,0xAB34,0x0000, 0xFBC0,0xAB35,0x0000,
+0xFBC0,0xAB36,0x0000, 0xFBC0,0xAB37,0x0000, 0xFBC0,0xAB38,0x0000,
+0xFBC0,0xAB39,0x0000, 0xFBC0,0xAB3A,0x0000, 0xFBC0,0xAB3B,0x0000,
+0xFBC0,0xAB3C,0x0000, 0xFBC0,0xAB3D,0x0000, 0xFBC0,0xAB3E,0x0000,
+0xFBC0,0xAB3F,0x0000, 0xFBC0,0xAB40,0x0000, 0xFBC0,0xAB41,0x0000,
+0xFBC0,0xAB42,0x0000, 0xFBC0,0xAB43,0x0000, 0xFBC0,0xAB44,0x0000,
+0xFBC0,0xAB45,0x0000, 0xFBC0,0xAB46,0x0000, 0xFBC0,0xAB47,0x0000,
+0xFBC0,0xAB48,0x0000, 0xFBC0,0xAB49,0x0000, 0xFBC0,0xAB4A,0x0000,
+0xFBC0,0xAB4B,0x0000, 0xFBC0,0xAB4C,0x0000, 0xFBC0,0xAB4D,0x0000,
+0xFBC0,0xAB4E,0x0000, 0xFBC0,0xAB4F,0x0000, 0xFBC0,0xAB50,0x0000,
+0xFBC0,0xAB51,0x0000, 0xFBC0,0xAB52,0x0000, 0xFBC0,0xAB53,0x0000,
+0xFBC0,0xAB54,0x0000, 0xFBC0,0xAB55,0x0000, 0xFBC0,0xAB56,0x0000,
+0xFBC0,0xAB57,0x0000, 0xFBC0,0xAB58,0x0000, 0xFBC0,0xAB59,0x0000,
+0xFBC0,0xAB5A,0x0000, 0xFBC0,0xAB5B,0x0000, 0xFBC0,0xAB5C,0x0000,
+0xFBC0,0xAB5D,0x0000, 0xFBC0,0xAB5E,0x0000, 0xFBC0,0xAB5F,0x0000,
+0xFBC0,0xAB60,0x0000, 0xFBC0,0xAB61,0x0000, 0xFBC0,0xAB62,0x0000,
+0xFBC0,0xAB63,0x0000, 0xFBC0,0xAB64,0x0000, 0xFBC0,0xAB65,0x0000,
+0xFBC0,0xAB66,0x0000, 0xFBC0,0xAB67,0x0000, 0xFBC0,0xAB68,0x0000,
+0xFBC0,0xAB69,0x0000, 0xFBC0,0xAB6A,0x0000, 0xFBC0,0xAB6B,0x0000,
+0xFBC0,0xAB6C,0x0000, 0xFBC0,0xAB6D,0x0000, 0xFBC0,0xAB6E,0x0000,
+0xFBC0,0xAB6F,0x0000, 0xFBC0,0xAB70,0x0000, 0xFBC0,0xAB71,0x0000,
+0xFBC0,0xAB72,0x0000, 0xFBC0,0xAB73,0x0000, 0xFBC0,0xAB74,0x0000,
+0xFBC0,0xAB75,0x0000, 0xFBC0,0xAB76,0x0000, 0xFBC0,0xAB77,0x0000,
+0xFBC0,0xAB78,0x0000, 0xFBC0,0xAB79,0x0000, 0xFBC0,0xAB7A,0x0000,
+0xFBC0,0xAB7B,0x0000, 0xFBC0,0xAB7C,0x0000, 0xFBC0,0xAB7D,0x0000,
+0xFBC0,0xAB7E,0x0000, 0xFBC0,0xAB7F,0x0000, 0xFBC0,0xAB80,0x0000,
+0xFBC0,0xAB81,0x0000, 0xFBC0,0xAB82,0x0000, 0xFBC0,0xAB83,0x0000,
+0xFBC0,0xAB84,0x0000, 0xFBC0,0xAB85,0x0000, 0xFBC0,0xAB86,0x0000,
+0xFBC0,0xAB87,0x0000, 0xFBC0,0xAB88,0x0000, 0xFBC0,0xAB89,0x0000,
+0xFBC0,0xAB8A,0x0000, 0xFBC0,0xAB8B,0x0000, 0xFBC0,0xAB8C,0x0000,
+0xFBC0,0xAB8D,0x0000, 0xFBC0,0xAB8E,0x0000, 0xFBC0,0xAB8F,0x0000,
+0xFBC0,0xAB90,0x0000, 0xFBC0,0xAB91,0x0000, 0xFBC0,0xAB92,0x0000,
+0xFBC0,0xAB93,0x0000, 0xFBC0,0xAB94,0x0000, 0xFBC0,0xAB95,0x0000,
+0xFBC0,0xAB96,0x0000, 0xFBC0,0xAB97,0x0000, 0xFBC0,0xAB98,0x0000,
+0xFBC0,0xAB99,0x0000, 0xFBC0,0xAB9A,0x0000, 0xFBC0,0xAB9B,0x0000,
+0xFBC0,0xAB9C,0x0000, 0xFBC0,0xAB9D,0x0000, 0xFBC0,0xAB9E,0x0000,
+0xFBC0,0xAB9F,0x0000, 0xFBC0,0xABA0,0x0000, 0xFBC0,0xABA1,0x0000,
+0xFBC0,0xABA2,0x0000, 0xFBC0,0xABA3,0x0000, 0xFBC0,0xABA4,0x0000,
+0xFBC0,0xABA5,0x0000, 0xFBC0,0xABA6,0x0000, 0xFBC0,0xABA7,0x0000,
+0xFBC0,0xABA8,0x0000, 0xFBC0,0xABA9,0x0000, 0xFBC0,0xABAA,0x0000,
+0xFBC0,0xABAB,0x0000, 0xFBC0,0xABAC,0x0000, 0xFBC0,0xABAD,0x0000,
+0xFBC0,0xABAE,0x0000, 0xFBC0,0xABAF,0x0000, 0xFBC0,0xABB0,0x0000,
+0xFBC0,0xABB1,0x0000, 0xFBC0,0xABB2,0x0000, 0xFBC0,0xABB3,0x0000,
+0xFBC0,0xABB4,0x0000, 0xFBC0,0xABB5,0x0000, 0xFBC0,0xABB6,0x0000,
+0xFBC0,0xABB7,0x0000, 0xFBC0,0xABB8,0x0000, 0xFBC0,0xABB9,0x0000,
+0xFBC0,0xABBA,0x0000, 0xFBC0,0xABBB,0x0000, 0xFBC0,0xABBC,0x0000,
+0xFBC0,0xABBD,0x0000, 0xFBC0,0xABBE,0x0000, 0xFBC0,0xABBF,0x0000,
+0xFBC0,0xABC0,0x0000, 0xFBC0,0xABC1,0x0000, 0xFBC0,0xABC2,0x0000,
+0xFBC0,0xABC3,0x0000, 0xFBC0,0xABC4,0x0000, 0xFBC0,0xABC5,0x0000,
+0xFBC0,0xABC6,0x0000, 0xFBC0,0xABC7,0x0000, 0xFBC0,0xABC8,0x0000,
+0xFBC0,0xABC9,0x0000, 0xFBC0,0xABCA,0x0000, 0xFBC0,0xABCB,0x0000,
+0xFBC0,0xABCC,0x0000, 0xFBC0,0xABCD,0x0000, 0xFBC0,0xABCE,0x0000,
+0xFBC0,0xABCF,0x0000, 0xFBC0,0xABD0,0x0000, 0xFBC0,0xABD1,0x0000,
+0xFBC0,0xABD2,0x0000, 0xFBC0,0xABD3,0x0000, 0xFBC0,0xABD4,0x0000,
+0xFBC0,0xABD5,0x0000, 0xFBC0,0xABD6,0x0000, 0xFBC0,0xABD7,0x0000,
+0xFBC0,0xABD8,0x0000, 0xFBC0,0xABD9,0x0000, 0xFBC0,0xABDA,0x0000,
+0xFBC0,0xABDB,0x0000, 0xFBC0,0xABDC,0x0000, 0xFBC0,0xABDD,0x0000,
+0xFBC0,0xABDE,0x0000, 0xFBC0,0xABDF,0x0000, 0xFBC0,0xABE0,0x0000,
+0xFBC0,0xABE1,0x0000, 0xFBC0,0xABE2,0x0000, 0xFBC0,0xABE3,0x0000,
+0xFBC0,0xABE4,0x0000, 0xFBC0,0xABE5,0x0000, 0xFBC0,0xABE6,0x0000,
+0xFBC0,0xABE7,0x0000, 0xFBC0,0xABE8,0x0000, 0xFBC0,0xABE9,0x0000,
+0xFBC0,0xABEA,0x0000, 0xFBC0,0xABEB,0x0000, 0xFBC0,0xABEC,0x0000,
+0xFBC0,0xABED,0x0000, 0xFBC0,0xABEE,0x0000, 0xFBC0,0xABEF,0x0000,
+0xFBC0,0xABF0,0x0000, 0xFBC0,0xABF1,0x0000, 0xFBC0,0xABF2,0x0000,
+0xFBC0,0xABF3,0x0000, 0xFBC0,0xABF4,0x0000, 0xFBC0,0xABF5,0x0000,
+0xFBC0,0xABF6,0x0000, 0xFBC0,0xABF7,0x0000, 0xFBC0,0xABF8,0x0000,
+0xFBC0,0xABF9,0x0000, 0xFBC0,0xABFA,0x0000, 0xFBC0,0xABFB,0x0000,
+0xFBC0,0xABFC,0x0000, 0xFBC0,0xABFD,0x0000, 0xFBC0,0xABFE,0x0000,
+0xFBC0,0xABFF,0x0000 };
+
+static uint16 page02Edata[]= { /* 2E00 (3 weights per char) */
+0xFBC0,0xAE00,0x0000, 0xFBC0,0xAE01,0x0000, 0xFBC0,0xAE02,0x0000,
+0xFBC0,0xAE03,0x0000, 0xFBC0,0xAE04,0x0000, 0xFBC0,0xAE05,0x0000,
+0xFBC0,0xAE06,0x0000, 0xFBC0,0xAE07,0x0000, 0xFBC0,0xAE08,0x0000,
+0xFBC0,0xAE09,0x0000, 0xFBC0,0xAE0A,0x0000, 0xFBC0,0xAE0B,0x0000,
+0xFBC0,0xAE0C,0x0000, 0xFBC0,0xAE0D,0x0000, 0xFBC0,0xAE0E,0x0000,
+0xFBC0,0xAE0F,0x0000, 0xFBC0,0xAE10,0x0000, 0xFBC0,0xAE11,0x0000,
+0xFBC0,0xAE12,0x0000, 0xFBC0,0xAE13,0x0000, 0xFBC0,0xAE14,0x0000,
+0xFBC0,0xAE15,0x0000, 0xFBC0,0xAE16,0x0000, 0xFBC0,0xAE17,0x0000,
+0xFBC0,0xAE18,0x0000, 0xFBC0,0xAE19,0x0000, 0xFBC0,0xAE1A,0x0000,
+0xFBC0,0xAE1B,0x0000, 0xFBC0,0xAE1C,0x0000, 0xFBC0,0xAE1D,0x0000,
+0xFBC0,0xAE1E,0x0000, 0xFBC0,0xAE1F,0x0000, 0xFBC0,0xAE20,0x0000,
+0xFBC0,0xAE21,0x0000, 0xFBC0,0xAE22,0x0000, 0xFBC0,0xAE23,0x0000,
+0xFBC0,0xAE24,0x0000, 0xFBC0,0xAE25,0x0000, 0xFBC0,0xAE26,0x0000,
+0xFBC0,0xAE27,0x0000, 0xFBC0,0xAE28,0x0000, 0xFBC0,0xAE29,0x0000,
+0xFBC0,0xAE2A,0x0000, 0xFBC0,0xAE2B,0x0000, 0xFBC0,0xAE2C,0x0000,
+0xFBC0,0xAE2D,0x0000, 0xFBC0,0xAE2E,0x0000, 0xFBC0,0xAE2F,0x0000,
+0xFBC0,0xAE30,0x0000, 0xFBC0,0xAE31,0x0000, 0xFBC0,0xAE32,0x0000,
+0xFBC0,0xAE33,0x0000, 0xFBC0,0xAE34,0x0000, 0xFBC0,0xAE35,0x0000,
+0xFBC0,0xAE36,0x0000, 0xFBC0,0xAE37,0x0000, 0xFBC0,0xAE38,0x0000,
+0xFBC0,0xAE39,0x0000, 0xFBC0,0xAE3A,0x0000, 0xFBC0,0xAE3B,0x0000,
+0xFBC0,0xAE3C,0x0000, 0xFBC0,0xAE3D,0x0000, 0xFBC0,0xAE3E,0x0000,
+0xFBC0,0xAE3F,0x0000, 0xFBC0,0xAE40,0x0000, 0xFBC0,0xAE41,0x0000,
+0xFBC0,0xAE42,0x0000, 0xFBC0,0xAE43,0x0000, 0xFBC0,0xAE44,0x0000,
+0xFBC0,0xAE45,0x0000, 0xFBC0,0xAE46,0x0000, 0xFBC0,0xAE47,0x0000,
+0xFBC0,0xAE48,0x0000, 0xFBC0,0xAE49,0x0000, 0xFBC0,0xAE4A,0x0000,
+0xFBC0,0xAE4B,0x0000, 0xFBC0,0xAE4C,0x0000, 0xFBC0,0xAE4D,0x0000,
+0xFBC0,0xAE4E,0x0000, 0xFBC0,0xAE4F,0x0000, 0xFBC0,0xAE50,0x0000,
+0xFBC0,0xAE51,0x0000, 0xFBC0,0xAE52,0x0000, 0xFBC0,0xAE53,0x0000,
+0xFBC0,0xAE54,0x0000, 0xFBC0,0xAE55,0x0000, 0xFBC0,0xAE56,0x0000,
+0xFBC0,0xAE57,0x0000, 0xFBC0,0xAE58,0x0000, 0xFBC0,0xAE59,0x0000,
+0xFBC0,0xAE5A,0x0000, 0xFBC0,0xAE5B,0x0000, 0xFBC0,0xAE5C,0x0000,
+0xFBC0,0xAE5D,0x0000, 0xFBC0,0xAE5E,0x0000, 0xFBC0,0xAE5F,0x0000,
+0xFBC0,0xAE60,0x0000, 0xFBC0,0xAE61,0x0000, 0xFBC0,0xAE62,0x0000,
+0xFBC0,0xAE63,0x0000, 0xFBC0,0xAE64,0x0000, 0xFBC0,0xAE65,0x0000,
+0xFBC0,0xAE66,0x0000, 0xFBC0,0xAE67,0x0000, 0xFBC0,0xAE68,0x0000,
+0xFBC0,0xAE69,0x0000, 0xFBC0,0xAE6A,0x0000, 0xFBC0,0xAE6B,0x0000,
+0xFBC0,0xAE6C,0x0000, 0xFBC0,0xAE6D,0x0000, 0xFBC0,0xAE6E,0x0000,
+0xFBC0,0xAE6F,0x0000, 0xFBC0,0xAE70,0x0000, 0xFBC0,0xAE71,0x0000,
+0xFBC0,0xAE72,0x0000, 0xFBC0,0xAE73,0x0000, 0xFBC0,0xAE74,0x0000,
+0xFBC0,0xAE75,0x0000, 0xFBC0,0xAE76,0x0000, 0xFBC0,0xAE77,0x0000,
+0xFBC0,0xAE78,0x0000, 0xFBC0,0xAE79,0x0000, 0xFBC0,0xAE7A,0x0000,
+0xFBC0,0xAE7B,0x0000, 0xFBC0,0xAE7C,0x0000, 0xFBC0,0xAE7D,0x0000,
+0xFBC0,0xAE7E,0x0000, 0xFBC0,0xAE7F,0x0000, 0xFB40,0xCE36,0x0000,
+0xFB40,0xD382,0x0000, 0xFB40,0xCE5B,0x0000, 0xFB40,0xCE5A,0x0000,
+0xFB40,0xCE59,0x0000, 0xFB40,0xCEBB,0x0000, 0xFB40,0xD182,0x0000,
+0xFB40,0xD1E0,0x0000, 0xFB40,0xD200,0x0000, 0xFB40,0xD202,0x0000,
+0xFB40,0xD35C,0x0000, 0xFB40,0xD369,0x0000, 0xFB40,0xDC0F,0x0000,
+0xFB40,0xDC0F,0x0000, 0xFB40,0xDC22,0x0000, 0xFB40,0xDC23,0x0000,
+0xFB40,0xDC22,0x0000, 0xFB40,0xDC23,0x0000, 0xFB40,0xDDF3,0x0000,
+0xFB40,0xDE7A,0x0000, 0xFB40,0xDF51,0x0000, 0xFB40,0xDF50,0x0000,
+0xFB40,0xDFC4,0x0000, 0xFB40,0xDFC3,0x0000, 0xFB40,0xE24C,0x0000,
+0xFB40,0xE535,0x0000, 0xFBC0,0xAE9A,0x0000, 0xFB40,0xE5E1,0x0000,
+0xFB40,0xE5E5,0x0000, 0xFB40,0xE708,0x0000, 0xFB40,0xEB7A,0x0000,
+0xFB40,0xEBCD,0x0000, 0xFB40,0xEC11,0x0000, 0xFB40,0xEC35,0x0000,
+0xFB40,0xEC3A,0x0000, 0xFB40,0xF06C,0x0000, 0xFB40,0xF22B,0x0000,
+0xFB40,0xF22B,0x0000, 0xFB40,0xCE2C,0x0000, 0xFB40,0xF25B,0x0000,
+0xFB40,0xF2AD,0x0000, 0xFB40,0xF38B,0x0000, 0xFB40,0xF58B,0x0000,
+0xFB40,0xF6EE,0x0000, 0xFB40,0xF93A,0x0000, 0xFB40,0xF93B,0x0000,
+0xFB40,0xFAF9,0x0000, 0xFB40,0xFCF9,0x0000, 0xFB40,0xFE9F,0x0000,
+0xFB40,0xFF53,0x0000, 0xFB40,0xFF52,0x0000, 0xFB40,0xFF53,0x0000,
+0xFB40,0xFF53,0x0000, 0xFB40,0xFF52,0x0000, 0xFB40,0xFF8A,0x0000,
+0xFB40,0xFF8A,0x0000, 0xFB40,0xFF8B,0x0000, 0xFB41,0x8002,0x0000,
+0xFB41,0x8080,0x0000, 0xFB41,0x807F,0x0000, 0xFB41,0x8089,0x0000,
+0xFB41,0x81FC,0x0000, 0xFB41,0x8279,0x0000, 0xFB41,0x8279,0x0000,
+0xFB41,0x8279,0x0000, 0xFB41,0x864E,0x0000, 0xFB41,0x8864,0x0000,
+0xFB41,0x8980,0x0000, 0xFB41,0x897F,0x0000, 0xFB41,0x89C1,0x0000,
+0xFB41,0x89D2,0x0000, 0xFB41,0x89D2,0x0000, 0xFB41,0x8BA0,0x0000,
+0xFB41,0x8D1D,0x0000, 0xFB41,0x8DB3,0x0000, 0xFB41,0x8F66,0x0000,
+0xFB41,0x8FB6,0x0000, 0xFB41,0x8FB6,0x0000, 0xFB41,0x8FB6,0x0000,
+0xFB41,0x9091,0x0000, 0xFB41,0x9485,0x0000, 0xFB41,0x9577,0x0000,
+0xFB41,0x9578,0x0000, 0xFB41,0x957F,0x0000, 0xFB41,0x95E8,0x0000,
+0xFB41,0x961C,0x0000, 0xFB41,0x961D,0x0000, 0xFB41,0x96E8,0x0000,
+0xFB41,0x9752,0x0000, 0xFB41,0x97E6,0x0000, 0xFB41,0x9875,0x0000,
+0xFB41,0x98CE,0x0000, 0xFB41,0x98DE,0x0000, 0xFB41,0x98DF,0x0000,
+0xFB41,0x98E0,0x0000, 0xFB41,0x98E0,0x0000, 0xFB41,0x9963,0x0000,
+0xFB41,0x9996,0x0000, 0xFB41,0x9A6C,0x0000, 0xFB41,0x9AA8,0x0000,
+0xFB41,0x9B3C,0x0000, 0xFB41,0x9C7C,0x0000, 0xFB41,0x9E1F,0x0000,
+0xFB41,0x9E75,0x0000, 0xFB41,0x9EA6,0x0000, 0xFB41,0x9EC4,0x0000,
+0xFB41,0x9EFE,0x0000, 0xFB41,0x9F4A,0x0000, 0xFB41,0x9F50,0x0000,
+0xFB41,0x9F52,0x0000, 0xFB41,0x9F7F,0x0000, 0xFB41,0x9F8D,0x0000,
+0xFB41,0x9F99,0x0000, 0xFB41,0x9F9C,0x0000, 0xFB41,0x9F9C,0x0000,
+0xFB41,0x9F9F,0x0000, 0xFBC0,0xAEF4,0x0000, 0xFBC0,0xAEF5,0x0000,
+0xFBC0,0xAEF6,0x0000, 0xFBC0,0xAEF7,0x0000, 0xFBC0,0xAEF8,0x0000,
+0xFBC0,0xAEF9,0x0000, 0xFBC0,0xAEFA,0x0000, 0xFBC0,0xAEFB,0x0000,
+0xFBC0,0xAEFC,0x0000, 0xFBC0,0xAEFD,0x0000, 0xFBC0,0xAEFE,0x0000,
+0xFBC0,0xAEFF,0x0000 };
+
+static uint16 page02Fdata[]= { /* 2F00 (3 weights per char) */
+0xFB40,0xCE00,0x0000, 0xFB40,0xCE28,0x0000, 0xFB40,0xCE36,0x0000,
+0xFB40,0xCE3F,0x0000, 0xFB40,0xCE59,0x0000, 0xFB40,0xCE85,0x0000,
+0xFB40,0xCE8C,0x0000, 0xFB40,0xCEA0,0x0000, 0xFB40,0xCEBA,0x0000,
+0xFB40,0xD13F,0x0000, 0xFB40,0xD165,0x0000, 0xFB40,0xD16B,0x0000,
+0xFB40,0xD182,0x0000, 0xFB40,0xD196,0x0000, 0xFB40,0xD1AB,0x0000,
+0xFB40,0xD1E0,0x0000, 0xFB40,0xD1F5,0x0000, 0xFB40,0xD200,0x0000,
+0xFB40,0xD29B,0x0000, 0xFB40,0xD2F9,0x0000, 0xFB40,0xD315,0x0000,
+0xFB40,0xD31A,0x0000, 0xFB40,0xD338,0x0000, 0xFB40,0xD341,0x0000,
+0xFB40,0xD35C,0x0000, 0xFB40,0xD369,0x0000, 0xFB40,0xD382,0x0000,
+0xFB40,0xD3B6,0x0000, 0xFB40,0xD3C8,0x0000, 0xFB40,0xD3E3,0x0000,
+0xFB40,0xD6D7,0x0000, 0xFB40,0xD71F,0x0000, 0xFB40,0xD8EB,0x0000,
+0xFB40,0xD902,0x0000, 0xFB40,0xD90A,0x0000, 0xFB40,0xD915,0x0000,
+0xFB40,0xD927,0x0000, 0xFB40,0xD973,0x0000, 0xFB40,0xDB50,0x0000,
+0xFB40,0xDB80,0x0000, 0xFB40,0xDBF8,0x0000, 0xFB40,0xDC0F,0x0000,
+0xFB40,0xDC22,0x0000, 0xFB40,0xDC38,0x0000, 0xFB40,0xDC6E,0x0000,
+0xFB40,0xDC71,0x0000, 0xFB40,0xDDDB,0x0000, 0xFB40,0xDDE5,0x0000,
+0xFB40,0xDDF1,0x0000, 0xFB40,0xDDFE,0x0000, 0xFB40,0xDE72,0x0000,
+0xFB40,0xDE7A,0x0000, 0xFB40,0xDE7F,0x0000, 0xFB40,0xDEF4,0x0000,
+0xFB40,0xDEFE,0x0000, 0xFB40,0xDF0B,0x0000, 0xFB40,0xDF13,0x0000,
+0xFB40,0xDF50,0x0000, 0xFB40,0xDF61,0x0000, 0xFB40,0xDF73,0x0000,
+0xFB40,0xDFC3,0x0000, 0xFB40,0xE208,0x0000, 0xFB40,0xE236,0x0000,
+0xFB40,0xE24B,0x0000, 0xFB40,0xE52F,0x0000, 0xFB40,0xE534,0x0000,
+0xFB40,0xE587,0x0000, 0xFB40,0xE597,0x0000, 0xFB40,0xE5A4,0x0000,
+0xFB40,0xE5B9,0x0000, 0xFB40,0xE5E0,0x0000, 0xFB40,0xE5E5,0x0000,
+0xFB40,0xE6F0,0x0000, 0xFB40,0xE708,0x0000, 0xFB40,0xE728,0x0000,
+0xFB40,0xEB20,0x0000, 0xFB40,0xEB62,0x0000, 0xFB40,0xEB79,0x0000,
+0xFB40,0xEBB3,0x0000, 0xFB40,0xEBCB,0x0000, 0xFB40,0xEBD4,0x0000,
+0xFB40,0xEBDB,0x0000, 0xFB40,0xEC0F,0x0000, 0xFB40,0xEC14,0x0000,
+0xFB40,0xEC34,0x0000, 0xFB40,0xF06B,0x0000, 0xFB40,0xF22A,0x0000,
+0xFB40,0xF236,0x0000, 0xFB40,0xF23B,0x0000, 0xFB40,0xF23F,0x0000,
+0xFB40,0xF247,0x0000, 0xFB40,0xF259,0x0000, 0xFB40,0xF25B,0x0000,
+0xFB40,0xF2AC,0x0000, 0xFB40,0xF384,0x0000, 0xFB40,0xF389,0x0000,
+0xFB40,0xF4DC,0x0000, 0xFB40,0xF4E6,0x0000, 0xFB40,0xF518,0x0000,
+0xFB40,0xF51F,0x0000, 0xFB40,0xF528,0x0000, 0xFB40,0xF530,0x0000,
+0xFB40,0xF58B,0x0000, 0xFB40,0xF592,0x0000, 0xFB40,0xF676,0x0000,
+0xFB40,0xF67D,0x0000, 0xFB40,0xF6AE,0x0000, 0xFB40,0xF6BF,0x0000,
+0xFB40,0xF6EE,0x0000, 0xFB40,0xF7DB,0x0000, 0xFB40,0xF7E2,0x0000,
+0xFB40,0xF7F3,0x0000, 0xFB40,0xF93A,0x0000, 0xFB40,0xF9B8,0x0000,
+0xFB40,0xF9BE,0x0000, 0xFB40,0xFA74,0x0000, 0xFB40,0xFACB,0x0000,
+0xFB40,0xFAF9,0x0000, 0xFB40,0xFC73,0x0000, 0xFB40,0xFCF8,0x0000,
+0xFB40,0xFF36,0x0000, 0xFB40,0xFF51,0x0000, 0xFB40,0xFF8A,0x0000,
+0xFB40,0xFFBD,0x0000, 0xFB41,0x8001,0x0000, 0xFB41,0x800C,0x0000,
+0xFB41,0x8012,0x0000, 0xFB41,0x8033,0x0000, 0xFB41,0x807F,0x0000,
+0xFB41,0x8089,0x0000, 0xFB41,0x81E3,0x0000, 0xFB41,0x81EA,0x0000,
+0xFB41,0x81F3,0x0000, 0xFB41,0x81FC,0x0000, 0xFB41,0x820C,0x0000,
+0xFB41,0x821B,0x0000, 0xFB41,0x821F,0x0000, 0xFB41,0x826E,0x0000,
+0xFB41,0x8272,0x0000, 0xFB41,0x8278,0x0000, 0xFB41,0x864D,0x0000,
+0xFB41,0x866B,0x0000, 0xFB41,0x8840,0x0000, 0xFB41,0x884C,0x0000,
+0xFB41,0x8863,0x0000, 0xFB41,0x897E,0x0000, 0xFB41,0x898B,0x0000,
+0xFB41,0x89D2,0x0000, 0xFB41,0x8A00,0x0000, 0xFB41,0x8C37,0x0000,
+0xFB41,0x8C46,0x0000, 0xFB41,0x8C55,0x0000, 0xFB41,0x8C78,0x0000,
+0xFB41,0x8C9D,0x0000, 0xFB41,0x8D64,0x0000, 0xFB41,0x8D70,0x0000,
+0xFB41,0x8DB3,0x0000, 0xFB41,0x8EAB,0x0000, 0xFB41,0x8ECA,0x0000,
+0xFB41,0x8F9B,0x0000, 0xFB41,0x8FB0,0x0000, 0xFB41,0x8FB5,0x0000,
+0xFB41,0x9091,0x0000, 0xFB41,0x9149,0x0000, 0xFB41,0x91C6,0x0000,
+0xFB41,0x91CC,0x0000, 0xFB41,0x91D1,0x0000, 0xFB41,0x9577,0x0000,
+0xFB41,0x9580,0x0000, 0xFB41,0x961C,0x0000, 0xFB41,0x96B6,0x0000,
+0xFB41,0x96B9,0x0000, 0xFB41,0x96E8,0x0000, 0xFB41,0x9751,0x0000,
+0xFB41,0x975E,0x0000, 0xFB41,0x9762,0x0000, 0xFB41,0x9769,0x0000,
+0xFB41,0x97CB,0x0000, 0xFB41,0x97ED,0x0000, 0xFB41,0x97F3,0x0000,
+0xFB41,0x9801,0x0000, 0xFB41,0x98A8,0x0000, 0xFB41,0x98DB,0x0000,
+0xFB41,0x98DF,0x0000, 0xFB41,0x9996,0x0000, 0xFB41,0x9999,0x0000,
+0xFB41,0x99AC,0x0000, 0xFB41,0x9AA8,0x0000, 0xFB41,0x9AD8,0x0000,
+0xFB41,0x9ADF,0x0000, 0xFB41,0x9B25,0x0000, 0xFB41,0x9B2F,0x0000,
+0xFB41,0x9B32,0x0000, 0xFB41,0x9B3C,0x0000, 0xFB41,0x9B5A,0x0000,
+0xFB41,0x9CE5,0x0000, 0xFB41,0x9E75,0x0000, 0xFB41,0x9E7F,0x0000,
+0xFB41,0x9EA5,0x0000, 0xFB41,0x9EBB,0x0000, 0xFB41,0x9EC3,0x0000,
+0xFB41,0x9ECD,0x0000, 0xFB41,0x9ED1,0x0000, 0xFB41,0x9EF9,0x0000,
+0xFB41,0x9EFD,0x0000, 0xFB41,0x9F0E,0x0000, 0xFB41,0x9F13,0x0000,
+0xFB41,0x9F20,0x0000, 0xFB41,0x9F3B,0x0000, 0xFB41,0x9F4A,0x0000,
+0xFB41,0x9F52,0x0000, 0xFB41,0x9F8D,0x0000, 0xFB41,0x9F9C,0x0000,
+0xFB41,0x9FA0,0x0000, 0xFBC0,0xAFD6,0x0000, 0xFBC0,0xAFD7,0x0000,
+0xFBC0,0xAFD8,0x0000, 0xFBC0,0xAFD9,0x0000, 0xFBC0,0xAFDA,0x0000,
+0xFBC0,0xAFDB,0x0000, 0xFBC0,0xAFDC,0x0000, 0xFBC0,0xAFDD,0x0000,
+0xFBC0,0xAFDE,0x0000, 0xFBC0,0xAFDF,0x0000, 0xFBC0,0xAFE0,0x0000,
+0xFBC0,0xAFE1,0x0000, 0xFBC0,0xAFE2,0x0000, 0xFBC0,0xAFE3,0x0000,
+0xFBC0,0xAFE4,0x0000, 0xFBC0,0xAFE5,0x0000, 0xFBC0,0xAFE6,0x0000,
+0xFBC0,0xAFE7,0x0000, 0xFBC0,0xAFE8,0x0000, 0xFBC0,0xAFE9,0x0000,
+0xFBC0,0xAFEA,0x0000, 0xFBC0,0xAFEB,0x0000, 0xFBC0,0xAFEC,0x0000,
+0xFBC0,0xAFED,0x0000, 0xFBC0,0xAFEE,0x0000, 0xFBC0,0xAFEF,0x0000,
+0x0DAF,0x0000,0x0000, 0x0DB0,0x0000,0x0000, 0x0DB1,0x0000,0x0000,
+0x0DB2,0x0000,0x0000, 0x0DB3,0x0000,0x0000, 0x0DB4,0x0000,0x0000,
+0x0DB5,0x0000,0x0000, 0x0DB6,0x0000,0x0000, 0x0DB7,0x0000,0x0000,
+0x0DB8,0x0000,0x0000, 0x0DB9,0x0000,0x0000, 0x0DBA,0x0000,0x0000,
+0xFBC0,0xAFFC,0x0000, 0xFBC0,0xAFFD,0x0000, 0xFBC0,0xAFFE,0x0000,
+0xFBC0,0xAFFF,0x0000 };
+
+static uint16 page030data[]= { /* 3000 (3 weights per char) */
+0x0209,0x0000,0x0000, 0x0237,0x0000,0x0000, 0x0266,0x0000,0x0000,
+0x02E2,0x0000,0x0000, 0x0DBB,0x0000,0x0000, 0x0E05,0x0000,0x0000,
+0x1E5D,0x1E73,0x0000, 0x0E29,0x0000,0x0000, 0x02AE,0x0000,0x0000,
+0x02AF,0x0000,0x0000, 0x02B0,0x0000,0x0000, 0x02B1,0x0000,0x0000,
+0x02B2,0x0000,0x0000, 0x02B3,0x0000,0x0000, 0x02B4,0x0000,0x0000,
+0x02B5,0x0000,0x0000, 0x02B6,0x0000,0x0000, 0x02B7,0x0000,0x0000,
+0x0DBC,0x0000,0x0000, 0x0DBD,0x0000,0x0000, 0x02B8,0x0000,0x0000,
+0x02B9,0x0000,0x0000, 0x02BA,0x0000,0x0000, 0x02BB,0x0000,0x0000,
+0x02BC,0x0000,0x0000, 0x02BD,0x0000,0x0000, 0x02BE,0x0000,0x0000,
+0x02BF,0x0000,0x0000, 0x022B,0x0000,0x0000, 0x0283,0x0000,0x0000,
+0x0284,0x0000,0x0000, 0x0285,0x0000,0x0000, 0x0DBE,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x022C,0x0000,0x0000, 0x0E07,0x0000,0x0000, 0x0E07,0x0000,0x0000,
+0x0E08,0x0000,0x0000, 0x0E08,0x0000,0x0000, 0x0E09,0x0000,0x0000,
+0x0DBC,0x0000,0x0000, 0x0DBF,0x0000,0x0000, 0xFB40,0xD341,0x0000,
+0xFB40,0xD344,0x0000, 0xFB40,0xD345,0x0000, 0x0E06,0x0000,0x0000,
+0x1E70,0x1E5E,0x0000, 0x02E3,0x0000,0x0000, 0x0DC0,0x0000,0x0000,
+0x0DC1,0x0000,0x0000, 0xFBC0,0xB040,0x0000, 0x1E52,0x0000,0x0000,
+0x1E52,0x0000,0x0000, 0x1E53,0x0000,0x0000, 0x1E53,0x0000,0x0000,
+0x1E54,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E55,0x0000,0x0000,
+0x1E55,0x0000,0x0000, 0x1E56,0x0000,0x0000, 0x1E56,0x0000,0x0000,
+0x1E57,0x0000,0x0000, 0x1E57,0x0000,0x0000, 0x1E58,0x0000,0x0000,
+0x1E58,0x0000,0x0000, 0x1E59,0x0000,0x0000, 0x1E59,0x0000,0x0000,
+0x1E5A,0x0000,0x0000, 0x1E5A,0x0000,0x0000, 0x1E5B,0x0000,0x0000,
+0x1E5B,0x0000,0x0000, 0x1E5C,0x0000,0x0000, 0x1E5C,0x0000,0x0000,
+0x1E5D,0x0000,0x0000, 0x1E5D,0x0000,0x0000, 0x1E5E,0x0000,0x0000,
+0x1E5E,0x0000,0x0000, 0x1E5F,0x0000,0x0000, 0x1E5F,0x0000,0x0000,
+0x1E60,0x0000,0x0000, 0x1E60,0x0000,0x0000, 0x1E61,0x0000,0x0000,
+0x1E61,0x0000,0x0000, 0x1E62,0x0000,0x0000, 0x1E62,0x0000,0x0000,
+0x1E63,0x0000,0x0000, 0x1E63,0x0000,0x0000, 0x1E63,0x0000,0x0000,
+0x1E64,0x0000,0x0000, 0x1E64,0x0000,0x0000, 0x1E65,0x0000,0x0000,
+0x1E65,0x0000,0x0000, 0x1E66,0x0000,0x0000, 0x1E67,0x0000,0x0000,
+0x1E68,0x0000,0x0000, 0x1E69,0x0000,0x0000, 0x1E6A,0x0000,0x0000,
+0x1E6B,0x0000,0x0000, 0x1E6B,0x0000,0x0000, 0x1E6B,0x0000,0x0000,
+0x1E6C,0x0000,0x0000, 0x1E6C,0x0000,0x0000, 0x1E6C,0x0000,0x0000,
+0x1E6D,0x0000,0x0000, 0x1E6D,0x0000,0x0000, 0x1E6D,0x0000,0x0000,
+0x1E6E,0x0000,0x0000, 0x1E6E,0x0000,0x0000, 0x1E6E,0x0000,0x0000,
+0x1E6F,0x0000,0x0000, 0x1E6F,0x0000,0x0000, 0x1E6F,0x0000,0x0000,
+0x1E70,0x0000,0x0000, 0x1E71,0x0000,0x0000, 0x1E72,0x0000,0x0000,
+0x1E73,0x0000,0x0000, 0x1E74,0x0000,0x0000, 0x1E75,0x0000,0x0000,
+0x1E75,0x0000,0x0000, 0x1E76,0x0000,0x0000, 0x1E76,0x0000,0x0000,
+0x1E77,0x0000,0x0000, 0x1E77,0x0000,0x0000, 0x1E78,0x0000,0x0000,
+0x1E79,0x0000,0x0000, 0x1E7A,0x0000,0x0000, 0x1E7B,0x0000,0x0000,
+0x1E7C,0x0000,0x0000, 0x1E7D,0x0000,0x0000, 0x1E7D,0x0000,0x0000,
+0x1E7E,0x0000,0x0000, 0x1E7F,0x0000,0x0000, 0x1E80,0x0000,0x0000,
+0x1E81,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E57,0x0000,0x0000,
+0x1E5A,0x0000,0x0000, 0xFBC0,0xB097,0x0000, 0xFBC0,0xB098,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x021E,0x0000,0x0000,
+0x021F,0x0000,0x0000, 0x0E0A,0x0000,0x0000, 0x0E0A,0x0000,0x0000,
+0x1E77,0x1E79,0x0000, 0x022D,0x0000,0x0000, 0x1E52,0x0000,0x0000,
+0x1E52,0x0000,0x0000, 0x1E53,0x0000,0x0000, 0x1E53,0x0000,0x0000,
+0x1E54,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E55,0x0000,0x0000,
+0x1E55,0x0000,0x0000, 0x1E56,0x0000,0x0000, 0x1E56,0x0000,0x0000,
+0x1E57,0x0000,0x0000, 0x1E57,0x0000,0x0000, 0x1E58,0x0000,0x0000,
+0x1E58,0x0000,0x0000, 0x1E59,0x0000,0x0000, 0x1E59,0x0000,0x0000,
+0x1E5A,0x0000,0x0000, 0x1E5A,0x0000,0x0000, 0x1E5B,0x0000,0x0000,
+0x1E5B,0x0000,0x0000, 0x1E5C,0x0000,0x0000, 0x1E5C,0x0000,0x0000,
+0x1E5D,0x0000,0x0000, 0x1E5D,0x0000,0x0000, 0x1E5E,0x0000,0x0000,
+0x1E5E,0x0000,0x0000, 0x1E5F,0x0000,0x0000, 0x1E5F,0x0000,0x0000,
+0x1E60,0x0000,0x0000, 0x1E60,0x0000,0x0000, 0x1E61,0x0000,0x0000,
+0x1E61,0x0000,0x0000, 0x1E62,0x0000,0x0000, 0x1E62,0x0000,0x0000,
+0x1E63,0x0000,0x0000, 0x1E63,0x0000,0x0000, 0x1E63,0x0000,0x0000,
+0x1E64,0x0000,0x0000, 0x1E64,0x0000,0x0000, 0x1E65,0x0000,0x0000,
+0x1E65,0x0000,0x0000, 0x1E66,0x0000,0x0000, 0x1E67,0x0000,0x0000,
+0x1E68,0x0000,0x0000, 0x1E69,0x0000,0x0000, 0x1E6A,0x0000,0x0000,
+0x1E6B,0x0000,0x0000, 0x1E6B,0x0000,0x0000, 0x1E6B,0x0000,0x0000,
+0x1E6C,0x0000,0x0000, 0x1E6C,0x0000,0x0000, 0x1E6C,0x0000,0x0000,
+0x1E6D,0x0000,0x0000, 0x1E6D,0x0000,0x0000, 0x1E6D,0x0000,0x0000,
+0x1E6E,0x0000,0x0000, 0x1E6E,0x0000,0x0000, 0x1E6E,0x0000,0x0000,
+0x1E6F,0x0000,0x0000, 0x1E6F,0x0000,0x0000, 0x1E6F,0x0000,0x0000,
+0x1E70,0x0000,0x0000, 0x1E71,0x0000,0x0000, 0x1E72,0x0000,0x0000,
+0x1E73,0x0000,0x0000, 0x1E74,0x0000,0x0000, 0x1E75,0x0000,0x0000,
+0x1E75,0x0000,0x0000, 0x1E76,0x0000,0x0000, 0x1E76,0x0000,0x0000,
+0x1E77,0x0000,0x0000, 0x1E77,0x0000,0x0000, 0x1E78,0x0000,0x0000,
+0x1E79,0x0000,0x0000, 0x1E7A,0x0000,0x0000, 0x1E7B,0x0000,0x0000,
+0x1E7C,0x0000,0x0000, 0x1E7D,0x0000,0x0000, 0x1E7D,0x0000,0x0000,
+0x1E7E,0x0000,0x0000, 0x1E7F,0x0000,0x0000, 0x1E80,0x0000,0x0000,
+0x1E81,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E57,0x0000,0x0000,
+0x1E5A,0x0000,0x0000, 0x1E7D,0x0000,0x0000, 0x1E7E,0x0000,0x0000,
+0x1E7F,0x0000,0x0000, 0x1E80,0x0000,0x0000, 0x022E,0x0000,0x0000,
+0x0E0B,0x0000,0x0000, 0x0E0C,0x0000,0x0000, 0x0E0C,0x0000,0x0000,
+0x1E5B,0x1E65,0x0000 };
+
+static uint16 page031data[]= { /* 3100 (3 weights per char) */
+0xFBC0,0xB100,0x0000, 0xFBC0,0xB101,0x0000, 0xFBC0,0xB102,0x0000,
+0xFBC0,0xB103,0x0000, 0xFBC0,0xB104,0x0000, 0x1E82,0x0000,0x0000,
+0x1E83,0x0000,0x0000, 0x1E84,0x0000,0x0000, 0x1E85,0x0000,0x0000,
+0x1E87,0x0000,0x0000, 0x1E88,0x0000,0x0000, 0x1E89,0x0000,0x0000,
+0x1E8A,0x0000,0x0000, 0x1E8B,0x0000,0x0000, 0x1E8C,0x0000,0x0000,
+0x1E8F,0x0000,0x0000, 0x1E90,0x0000,0x0000, 0x1E91,0x0000,0x0000,
+0x1E92,0x0000,0x0000, 0x1E94,0x0000,0x0000, 0x1E95,0x0000,0x0000,
+0x1E96,0x0000,0x0000, 0x1E97,0x0000,0x0000, 0x1E98,0x0000,0x0000,
+0x1E99,0x0000,0x0000, 0x1E9A,0x0000,0x0000, 0x1E9B,0x0000,0x0000,
+0x1E9C,0x0000,0x0000, 0x1E9E,0x0000,0x0000, 0x1E9F,0x0000,0x0000,
+0x1EA1,0x0000,0x0000, 0x1EA2,0x0000,0x0000, 0x1EA3,0x0000,0x0000,
+0x1EA4,0x0000,0x0000, 0x1EA5,0x0000,0x0000, 0x1EA6,0x0000,0x0000,
+0x1EA7,0x0000,0x0000, 0x1EA9,0x0000,0x0000, 0x1EAD,0x0000,0x0000,
+0x1EAE,0x0000,0x0000, 0x1EAF,0x0000,0x0000, 0x1EB0,0x0000,0x0000,
+0x1E86,0x0000,0x0000, 0x1E8D,0x0000,0x0000, 0x1E93,0x0000,0x0000,
+0xFBC0,0xB12D,0x0000, 0xFBC0,0xB12E,0x0000, 0xFBC0,0xB12F,0x0000,
+0xFBC0,0xB130,0x0000, 0x1D62,0x0000,0x0000, 0x1D63,0x0000,0x0000,
+0x1E02,0x0000,0x0000, 0x1D64,0x0000,0x0000, 0x1E04,0x0000,0x0000,
+0x1E05,0x0000,0x0000, 0x1D65,0x0000,0x0000, 0x1D66,0x0000,0x0000,
+0x1D67,0x0000,0x0000, 0x1E08,0x0000,0x0000, 0x1E09,0x0000,0x0000,
+0x1E0A,0x0000,0x0000, 0x1E0B,0x0000,0x0000, 0x1E0C,0x0000,0x0000,
+0x1E0D,0x0000,0x0000, 0x1D7C,0x0000,0x0000, 0x1D68,0x0000,0x0000,
+0x1D69,0x0000,0x0000, 0x1D6A,0x0000,0x0000, 0x1D83,0x0000,0x0000,
+0x1D6B,0x0000,0x0000, 0x1D6C,0x0000,0x0000, 0x1D6D,0x0000,0x0000,
+0x1D6E,0x0000,0x0000, 0x1D6F,0x0000,0x0000, 0x1D70,0x0000,0x0000,
+0x1D71,0x0000,0x0000, 0x1D72,0x0000,0x0000, 0x1D73,0x0000,0x0000,
+0x1D74,0x0000,0x0000, 0x1DBE,0x0000,0x0000, 0x1DBF,0x0000,0x0000,
+0x1DC0,0x0000,0x0000, 0x1DC1,0x0000,0x0000, 0x1DC2,0x0000,0x0000,
+0x1DC3,0x0000,0x0000, 0x1DC4,0x0000,0x0000, 0x1DC5,0x0000,0x0000,
+0x1DC6,0x0000,0x0000, 0x1DC7,0x0000,0x0000, 0x1DC8,0x0000,0x0000,
+0x1DC9,0x0000,0x0000, 0x1DCA,0x0000,0x0000, 0x1DCB,0x0000,0x0000,
+0x1DCC,0x0000,0x0000, 0x1DCD,0x0000,0x0000, 0x1DCE,0x0000,0x0000,
+0x1DCF,0x0000,0x0000, 0x1DD0,0x0000,0x0000, 0x1DD1,0x0000,0x0000,
+0x1DD2,0x0000,0x0000, 0x1DBD,0x0000,0x0000, 0x1D76,0x0000,0x0000,
+0x1D77,0x0000,0x0000, 0x1E1F,0x0000,0x0000, 0x1E20,0x0000,0x0000,
+0x1E24,0x0000,0x0000, 0x1E26,0x0000,0x0000, 0x1E2B,0x0000,0x0000,
+0x1E2F,0x0000,0x0000, 0x1E31,0x0000,0x0000, 0x1D7E,0x0000,0x0000,
+0x1E35,0x0000,0x0000, 0x1E37,0x0000,0x0000, 0x1D7F,0x0000,0x0000,
+0x1D80,0x0000,0x0000, 0x1D82,0x0000,0x0000, 0x1D84,0x0000,0x0000,
+0x1D85,0x0000,0x0000, 0x1D89,0x0000,0x0000, 0x1D8B,0x0000,0x0000,
+0x1D8D,0x0000,0x0000, 0x1D8E,0x0000,0x0000, 0x1D8F,0x0000,0x0000,
+0x1D90,0x0000,0x0000, 0x1D91,0x0000,0x0000, 0x1D94,0x0000,0x0000,
+0x1D98,0x0000,0x0000, 0x1DA2,0x0000,0x0000, 0x1DA9,0x0000,0x0000,
+0x1DAE,0x0000,0x0000, 0x1E49,0x0000,0x0000, 0x1E4A,0x0000,0x0000,
+0x1DB9,0x0000,0x0000, 0x1DBA,0x0000,0x0000, 0x1DBB,0x0000,0x0000,
+0x1DE1,0x0000,0x0000, 0x1DE2,0x0000,0x0000, 0x1DE5,0x0000,0x0000,
+0x1DEE,0x0000,0x0000, 0x1DEF,0x0000,0x0000, 0x1DF1,0x0000,0x0000,
+0x1DFB,0x0000,0x0000, 0x1DFE,0x0000,0x0000, 0xFBC0,0xB18F,0x0000,
+0x0DC2,0x0000,0x0000, 0x0DC3,0x0000,0x0000, 0xFB40,0xCE00,0x0000,
+0xFB40,0xCE8C,0x0000, 0xFB40,0xCE09,0x0000, 0xFB40,0xD6DB,0x0000,
+0xFB40,0xCE0A,0x0000, 0xFB40,0xCE2D,0x0000, 0xFB40,0xCE0B,0x0000,
+0xFB40,0xF532,0x0000, 0xFB40,0xCE59,0x0000, 0xFB40,0xCE19,0x0000,
+0xFB40,0xCE01,0x0000, 0xFB40,0xD929,0x0000, 0xFB40,0xD730,0x0000,
+0xFB40,0xCEBA,0x0000, 0x1E82,0x0000,0x0000, 0x1E98,0x0000,0x0000,
+0x1E90,0x0000,0x0000, 0x1E8B,0x0000,0x0000, 0x1EA0,0x0000,0x0000,
+0x1EA0,0x0000,0x0000, 0x1E9D,0x0000,0x0000, 0x1E9C,0x0000,0x0000,
+0x1EAF,0x0000,0x0000, 0x1E9B,0x0000,0x0000, 0x1EAE,0x0000,0x0000,
+0x1EAF,0x0000,0x0000, 0x1EAC,0x0000,0x0000, 0x1E8E,0x0000,0x0000,
+0x1EA1,0x0000,0x0000, 0x1EA3,0x0000,0x0000, 0x1EAA,0x0000,0x0000,
+0x1EAB,0x0000,0x0000, 0x1EA8,0x0000,0x0000, 0x1EAE,0x0000,0x0000,
+0x1E83,0x0000,0x0000, 0x1E88,0x0000,0x0000, 0x1E8C,0x0000,0x0000,
+0x1E8F,0x0000,0x0000, 0xFBC0,0xB1B8,0x0000, 0xFBC0,0xB1B9,0x0000,
+0xFBC0,0xB1BA,0x0000, 0xFBC0,0xB1BB,0x0000, 0xFBC0,0xB1BC,0x0000,
+0xFBC0,0xB1BD,0x0000, 0xFBC0,0xB1BE,0x0000, 0xFBC0,0xB1BF,0x0000,
+0xFBC0,0xB1C0,0x0000, 0xFBC0,0xB1C1,0x0000, 0xFBC0,0xB1C2,0x0000,
+0xFBC0,0xB1C3,0x0000, 0xFBC0,0xB1C4,0x0000, 0xFBC0,0xB1C5,0x0000,
+0xFBC0,0xB1C6,0x0000, 0xFBC0,0xB1C7,0x0000, 0xFBC0,0xB1C8,0x0000,
+0xFBC0,0xB1C9,0x0000, 0xFBC0,0xB1CA,0x0000, 0xFBC0,0xB1CB,0x0000,
+0xFBC0,0xB1CC,0x0000, 0xFBC0,0xB1CD,0x0000, 0xFBC0,0xB1CE,0x0000,
+0xFBC0,0xB1CF,0x0000, 0xFBC0,0xB1D0,0x0000, 0xFBC0,0xB1D1,0x0000,
+0xFBC0,0xB1D2,0x0000, 0xFBC0,0xB1D3,0x0000, 0xFBC0,0xB1D4,0x0000,
+0xFBC0,0xB1D5,0x0000, 0xFBC0,0xB1D6,0x0000, 0xFBC0,0xB1D7,0x0000,
+0xFBC0,0xB1D8,0x0000, 0xFBC0,0xB1D9,0x0000, 0xFBC0,0xB1DA,0x0000,
+0xFBC0,0xB1DB,0x0000, 0xFBC0,0xB1DC,0x0000, 0xFBC0,0xB1DD,0x0000,
+0xFBC0,0xB1DE,0x0000, 0xFBC0,0xB1DF,0x0000, 0xFBC0,0xB1E0,0x0000,
+0xFBC0,0xB1E1,0x0000, 0xFBC0,0xB1E2,0x0000, 0xFBC0,0xB1E3,0x0000,
+0xFBC0,0xB1E4,0x0000, 0xFBC0,0xB1E5,0x0000, 0xFBC0,0xB1E6,0x0000,
+0xFBC0,0xB1E7,0x0000, 0xFBC0,0xB1E8,0x0000, 0xFBC0,0xB1E9,0x0000,
+0xFBC0,0xB1EA,0x0000, 0xFBC0,0xB1EB,0x0000, 0xFBC0,0xB1EC,0x0000,
+0xFBC0,0xB1ED,0x0000, 0xFBC0,0xB1EE,0x0000, 0xFBC0,0xB1EF,0x0000,
+0x1E59,0x0000,0x0000, 0x1E5D,0x0000,0x0000, 0x1E5E,0x0000,0x0000,
+0x1E65,0x0000,0x0000, 0x1E68,0x0000,0x0000, 0x1E6B,0x0000,0x0000,
+0x1E6C,0x0000,0x0000, 0x1E6D,0x0000,0x0000, 0x1E6E,0x0000,0x0000,
+0x1E6F,0x0000,0x0000, 0x1E72,0x0000,0x0000, 0x1E78,0x0000,0x0000,
+0x1E79,0x0000,0x0000, 0x1E7A,0x0000,0x0000, 0x1E7B,0x0000,0x0000,
+0x1E7C,0x0000,0x0000 };
+
+static uint16 page032data[]= { /* 3200 (8 weights per char) */
+0x0288,0x1D62,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D64,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D65,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D67,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D68,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D69,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6B,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6D,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6E,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D70,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D71,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D72,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D73,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D74,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D62,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D64,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D65,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D67,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D68,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D69,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6B,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6D,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6E,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D70,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D71,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D72,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D73,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D74,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6E,0x1DCB,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6D,0x1DC6,0x1D6E,0x1DC2,0x1E03,0x0289,0x0000,
+0x0288,0x1D6D,0x1DC6,0x1D74,0x1DCB,0x0289,0x0000,0x0000,
+0xFBC0,0xB21F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCE00,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCE8C,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCE09,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD6DB,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCE94,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD16D,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCE03,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD16B,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCE5D,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD341,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xE708,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xF06B,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xEC34,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xE728,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB41,0x91D1,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD71F,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xE5E5,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xE82A,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xE709,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xF93E,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD40D,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xF279,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB41,0x8CA1,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xF95D,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD2B4,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCEE3,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD47C,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xDB66,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xF6E3,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCF01,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB41,0x8CC7,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD354,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xF96D,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCF11,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB41,0x81EA,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB41,0x81F3,0x0289,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB244,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB245,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB246,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB247,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB248,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB249,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB24A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB24B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB24C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB24D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB24E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB24F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x1002,0x0E8B,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E30,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E32,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E29,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D62,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D64,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D67,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D68,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D69,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D6B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D6D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D6E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D70,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D71,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D73,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D74,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D62,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D64,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D65,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D67,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D68,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D69,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D6B,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D6D,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D6E,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D70,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D71,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D72,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D73,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D74,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D70,0x1DBE,0x1E0F,0x1D62,0x1DC6,0x0000,0x0000,0x0000,
+0x1D6E,0x1DCB,0x1D6D,0x1DD1,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB27E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0DC4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE00,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE8C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE09,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD6DB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE94,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD16D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE03,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD16B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE5D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD341,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF06B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xEC34,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE728,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB41,0x91D1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD71F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE82A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE709,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF93E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD40D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF279,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB41,0x8CA1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF95D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD2B4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF9D8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF537,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD973,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB41,0x9069,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD12A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD370,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xECE8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB41,0x9805,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCF11,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD199,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xEB63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE0A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE0B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xDDE6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD3F3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD33B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xDB97,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xDB66,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF6E3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCF01,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB41,0x8CC7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD354,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD91C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E30,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E32,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E29,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E2A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E2F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E30,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E32,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0x0E29,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E29,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2A,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2B,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x0FC0,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x1002,0x0E6D,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E52,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E53,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E54,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E55,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E56,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E57,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E59,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E60,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E61,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E62,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E64,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E66,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E67,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E68,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E69,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E70,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E71,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E73,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E74,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E75,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E76,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E77,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E78,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E79,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E80,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB2FF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+static uint16 page033data[]= { /* 3300 (9 weights per char) */
+0x1E52,0x1E6B,0x0E0B,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E52,0x1E7A,0x1E6D,0x1E52,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E52,0x1E81,0x1E6E,0x1E52,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E52,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E53,0x1E67,0x1E81,0x1E59,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E53,0x1E81,0x1E62,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E54,0x1E56,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E55,0x1E5E,0x1E59,0x0E0B,0x1E65,0x0000,0x0000,0x0000,0x0000,
+0x1E55,0x0E0B,0x1E57,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E56,0x1E81,0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E56,0x0E0B,0x1E72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E57,0x1E53,0x1E79,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E57,0x1E78,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E57,0x1E7C,0x1E79,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E57,0x1E7C,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E57,0x1E81,0x1E70,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E57,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E67,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E76,0x1E79,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E7A,0x1E61,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E7C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E7C,0x1E59,0x1E78,0x1E72,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E7C,0x1E73,0x0E0B,0x1E65,0x1E7A,0x0000,0x0000,0x0000,
+0x1E58,0x1E7C,0x1E7D,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000,
+0x1E59,0x1E78,0x1E72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E59,0x1E78,0x1E72,0x1E65,0x1E81,0x0000,0x0000,0x0000,0x0000,
+0x1E59,0x1E7A,0x1E5F,0x1E53,0x1E7C,0x0000,0x0000,0x0000,0x0000,
+0x1E59,0x1E7C,0x0E0B,0x1E69,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5A,0x0E0B,0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5B,0x1E7A,0x1E66,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5B,0x0E0B,0x1E6F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5C,0x1E53,0x1E59,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5C,0x1E81,0x1E62,0x0E0B,0x1E72,0x0000,0x0000,0x0000,0x0000,
+0x1E5D,0x1E79,0x1E81,0x1E59,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5F,0x1E81,0x1E62,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5F,0x1E81,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E61,0x0E0B,0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E64,0x1E5D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E65,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E65,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E66,0x1E6A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6A,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6B,0x1E53,0x1E63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6B,0x0E0B,0x1E5F,0x1E81,0x1E65,0x0000,0x0000,0x0000,0x0000,
+0x1E6B,0x0E0B,0x1E63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6B,0x0E0B,0x1E7B,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6C,0x1E52,0x1E5E,0x1E65,0x1E7A,0x0000,0x0000,0x0000,0x0000,
+0x1E6C,0x1E59,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6C,0x1E5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6C,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6D,0x1E52,0x1E78,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000,
+0x1E6D,0x1E53,0x0E0B,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6D,0x1E63,0x1E5D,0x1E55,0x1E7A,0x0000,0x0000,0x0000,0x0000,
+0x1E6D,0x1E78,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x1E59,0x1E61,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x1E60,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x1E67,0x1E6C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x1E7A,0x1E63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x1E81,0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x0E0B,0x1E5D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x0E0B,0x1E61,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x1E53,0x1E81,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x1E7A,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x1E81,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x0E0B,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E70,0x1E53,0x1E59,0x1E7C,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E70,0x1E53,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E70,0x1E63,0x1E6B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E70,0x1E7A,0x1E59,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E70,0x1E81,0x1E5D,0x1E77,0x1E81,0x0000,0x0000,0x0000,0x0000,
+0x1E71,0x1E59,0x1E7C,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E71,0x1E79,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E71,0x1E79,0x1E6B,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000,
+0x1E73,0x1E57,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E73,0x1E57,0x1E65,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E73,0x0E0B,0x1E65,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E75,0x0E0B,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E75,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E76,0x1E52,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E79,0x1E63,0x1E65,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E79,0x1E78,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7A,0x1E6C,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7A,0x0E0B,0x1E6D,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7B,0x1E72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7B,0x1E81,0x1E65,0x1E5A,0x1E81,0x0000,0x0000,0x0000,0x0000,
+0x1E7D,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E29,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E29,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2A,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2B,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2C,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2D,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2E,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2F,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E30,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E31,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E32,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E29,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2A,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2B,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2C,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2D,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E33,0x101F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E4A,0x0E33,0x0FC0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F82,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0E60,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x101F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xDE73,0xFB40,0xE210,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE62D,0xFB40,0xD48C,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD927,0xFB40,0xEB63,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE60E,0xFB40,0xECBB,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE82A,0xFB40,0xDF0F,0xFB40,0xCF1A,0xFB40,0xF93E,0x0000,
+0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0E33,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0E60,0x0E33,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0EB9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0EB9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x0EB9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1002,0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EB9,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0437,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0437,0x0FEA,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0E33,0x0E6D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0E33,0x0E6D,0x0437,0x0FEA,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0E33,0x0E6D,0x0437,0x0FEA,0x0E2B,0x0000,0x0000,0x0000,
+0x0FA7,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x1109,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x1109,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E33,0x025D,0x0F5B,0x025D,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E4A,0x0FB4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0E60,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0E6D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0437,0x0F21,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0F82,0x025D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x105E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0FA7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0F64,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0F21,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x1002,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0F64,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0F82,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x105A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0EFB,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0F82,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0EE1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x025D,0x0F5B,0x025D,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0FA7,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0FC0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FEA,0x0FC0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FEA,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1051,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1044,0x0437,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E33,0x0437,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E29,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2A,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2B,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2C,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2D,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2E,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2F,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E30,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E31,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E32,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E29,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2A,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2B,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2C,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2D,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2E,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2F,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E30,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E31,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E32,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E29,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2A,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x0E33,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+static uint16 page04Ddata[]= { /* 4D00 (3 weights per char) */
+0xFB80,0xCD00,0x0000, 0xFB80,0xCD01,0x0000, 0xFB80,0xCD02,0x0000,
+0xFB80,0xCD03,0x0000, 0xFB80,0xCD04,0x0000, 0xFB80,0xCD05,0x0000,
+0xFB80,0xCD06,0x0000, 0xFB80,0xCD07,0x0000, 0xFB80,0xCD08,0x0000,
+0xFB80,0xCD09,0x0000, 0xFB80,0xCD0A,0x0000, 0xFB80,0xCD0B,0x0000,
+0xFB80,0xCD0C,0x0000, 0xFB80,0xCD0D,0x0000, 0xFB80,0xCD0E,0x0000,
+0xFB80,0xCD0F,0x0000, 0xFB80,0xCD10,0x0000, 0xFB80,0xCD11,0x0000,
+0xFB80,0xCD12,0x0000, 0xFB80,0xCD13,0x0000, 0xFB80,0xCD14,0x0000,
+0xFB80,0xCD15,0x0000, 0xFB80,0xCD16,0x0000, 0xFB80,0xCD17,0x0000,
+0xFB80,0xCD18,0x0000, 0xFB80,0xCD19,0x0000, 0xFB80,0xCD1A,0x0000,
+0xFB80,0xCD1B,0x0000, 0xFB80,0xCD1C,0x0000, 0xFB80,0xCD1D,0x0000,
+0xFB80,0xCD1E,0x0000, 0xFB80,0xCD1F,0x0000, 0xFB80,0xCD20,0x0000,
+0xFB80,0xCD21,0x0000, 0xFB80,0xCD22,0x0000, 0xFB80,0xCD23,0x0000,
+0xFB80,0xCD24,0x0000, 0xFB80,0xCD25,0x0000, 0xFB80,0xCD26,0x0000,
+0xFB80,0xCD27,0x0000, 0xFB80,0xCD28,0x0000, 0xFB80,0xCD29,0x0000,
+0xFB80,0xCD2A,0x0000, 0xFB80,0xCD2B,0x0000, 0xFB80,0xCD2C,0x0000,
+0xFB80,0xCD2D,0x0000, 0xFB80,0xCD2E,0x0000, 0xFB80,0xCD2F,0x0000,
+0xFB80,0xCD30,0x0000, 0xFB80,0xCD31,0x0000, 0xFB80,0xCD32,0x0000,
+0xFB80,0xCD33,0x0000, 0xFB80,0xCD34,0x0000, 0xFB80,0xCD35,0x0000,
+0xFB80,0xCD36,0x0000, 0xFB80,0xCD37,0x0000, 0xFB80,0xCD38,0x0000,
+0xFB80,0xCD39,0x0000, 0xFB80,0xCD3A,0x0000, 0xFB80,0xCD3B,0x0000,
+0xFB80,0xCD3C,0x0000, 0xFB80,0xCD3D,0x0000, 0xFB80,0xCD3E,0x0000,
+0xFB80,0xCD3F,0x0000, 0xFB80,0xCD40,0x0000, 0xFB80,0xCD41,0x0000,
+0xFB80,0xCD42,0x0000, 0xFB80,0xCD43,0x0000, 0xFB80,0xCD44,0x0000,
+0xFB80,0xCD45,0x0000, 0xFB80,0xCD46,0x0000, 0xFB80,0xCD47,0x0000,
+0xFB80,0xCD48,0x0000, 0xFB80,0xCD49,0x0000, 0xFB80,0xCD4A,0x0000,
+0xFB80,0xCD4B,0x0000, 0xFB80,0xCD4C,0x0000, 0xFB80,0xCD4D,0x0000,
+0xFB80,0xCD4E,0x0000, 0xFB80,0xCD4F,0x0000, 0xFB80,0xCD50,0x0000,
+0xFB80,0xCD51,0x0000, 0xFB80,0xCD52,0x0000, 0xFB80,0xCD53,0x0000,
+0xFB80,0xCD54,0x0000, 0xFB80,0xCD55,0x0000, 0xFB80,0xCD56,0x0000,
+0xFB80,0xCD57,0x0000, 0xFB80,0xCD58,0x0000, 0xFB80,0xCD59,0x0000,
+0xFB80,0xCD5A,0x0000, 0xFB80,0xCD5B,0x0000, 0xFB80,0xCD5C,0x0000,
+0xFB80,0xCD5D,0x0000, 0xFB80,0xCD5E,0x0000, 0xFB80,0xCD5F,0x0000,
+0xFB80,0xCD60,0x0000, 0xFB80,0xCD61,0x0000, 0xFB80,0xCD62,0x0000,
+0xFB80,0xCD63,0x0000, 0xFB80,0xCD64,0x0000, 0xFB80,0xCD65,0x0000,
+0xFB80,0xCD66,0x0000, 0xFB80,0xCD67,0x0000, 0xFB80,0xCD68,0x0000,
+0xFB80,0xCD69,0x0000, 0xFB80,0xCD6A,0x0000, 0xFB80,0xCD6B,0x0000,
+0xFB80,0xCD6C,0x0000, 0xFB80,0xCD6D,0x0000, 0xFB80,0xCD6E,0x0000,
+0xFB80,0xCD6F,0x0000, 0xFB80,0xCD70,0x0000, 0xFB80,0xCD71,0x0000,
+0xFB80,0xCD72,0x0000, 0xFB80,0xCD73,0x0000, 0xFB80,0xCD74,0x0000,
+0xFB80,0xCD75,0x0000, 0xFB80,0xCD76,0x0000, 0xFB80,0xCD77,0x0000,
+0xFB80,0xCD78,0x0000, 0xFB80,0xCD79,0x0000, 0xFB80,0xCD7A,0x0000,
+0xFB80,0xCD7B,0x0000, 0xFB80,0xCD7C,0x0000, 0xFB80,0xCD7D,0x0000,
+0xFB80,0xCD7E,0x0000, 0xFB80,0xCD7F,0x0000, 0xFB80,0xCD80,0x0000,
+0xFB80,0xCD81,0x0000, 0xFB80,0xCD82,0x0000, 0xFB80,0xCD83,0x0000,
+0xFB80,0xCD84,0x0000, 0xFB80,0xCD85,0x0000, 0xFB80,0xCD86,0x0000,
+0xFB80,0xCD87,0x0000, 0xFB80,0xCD88,0x0000, 0xFB80,0xCD89,0x0000,
+0xFB80,0xCD8A,0x0000, 0xFB80,0xCD8B,0x0000, 0xFB80,0xCD8C,0x0000,
+0xFB80,0xCD8D,0x0000, 0xFB80,0xCD8E,0x0000, 0xFB80,0xCD8F,0x0000,
+0xFB80,0xCD90,0x0000, 0xFB80,0xCD91,0x0000, 0xFB80,0xCD92,0x0000,
+0xFB80,0xCD93,0x0000, 0xFB80,0xCD94,0x0000, 0xFB80,0xCD95,0x0000,
+0xFB80,0xCD96,0x0000, 0xFB80,0xCD97,0x0000, 0xFB80,0xCD98,0x0000,
+0xFB80,0xCD99,0x0000, 0xFB80,0xCD9A,0x0000, 0xFB80,0xCD9B,0x0000,
+0xFB80,0xCD9C,0x0000, 0xFB80,0xCD9D,0x0000, 0xFB80,0xCD9E,0x0000,
+0xFB80,0xCD9F,0x0000, 0xFB80,0xCDA0,0x0000, 0xFB80,0xCDA1,0x0000,
+0xFB80,0xCDA2,0x0000, 0xFB80,0xCDA3,0x0000, 0xFB80,0xCDA4,0x0000,
+0xFB80,0xCDA5,0x0000, 0xFB80,0xCDA6,0x0000, 0xFB80,0xCDA7,0x0000,
+0xFB80,0xCDA8,0x0000, 0xFB80,0xCDA9,0x0000, 0xFB80,0xCDAA,0x0000,
+0xFB80,0xCDAB,0x0000, 0xFB80,0xCDAC,0x0000, 0xFB80,0xCDAD,0x0000,
+0xFB80,0xCDAE,0x0000, 0xFB80,0xCDAF,0x0000, 0xFB80,0xCDB0,0x0000,
+0xFB80,0xCDB1,0x0000, 0xFB80,0xCDB2,0x0000, 0xFB80,0xCDB3,0x0000,
+0xFB80,0xCDB4,0x0000, 0xFB80,0xCDB5,0x0000, 0xFBC0,0xCDB6,0x0000,
+0xFBC0,0xCDB7,0x0000, 0xFBC0,0xCDB8,0x0000, 0xFBC0,0xCDB9,0x0000,
+0xFBC0,0xCDBA,0x0000, 0xFBC0,0xCDBB,0x0000, 0xFBC0,0xCDBC,0x0000,
+0xFBC0,0xCDBD,0x0000, 0xFBC0,0xCDBE,0x0000, 0xFBC0,0xCDBF,0x0000,
+0x0B37,0x0000,0x0000, 0x0B38,0x0000,0x0000, 0x0B39,0x0000,0x0000,
+0x0B3A,0x0000,0x0000, 0x0B3B,0x0000,0x0000, 0x0B3C,0x0000,0x0000,
+0x0B3D,0x0000,0x0000, 0x0B3E,0x0000,0x0000, 0x0B3F,0x0000,0x0000,
+0x0B40,0x0000,0x0000, 0x0B41,0x0000,0x0000, 0x0B42,0x0000,0x0000,
+0x0B43,0x0000,0x0000, 0x0B44,0x0000,0x0000, 0x0B45,0x0000,0x0000,
+0x0B46,0x0000,0x0000, 0x0B47,0x0000,0x0000, 0x0B48,0x0000,0x0000,
+0x0B49,0x0000,0x0000, 0x0B4A,0x0000,0x0000, 0x0B4B,0x0000,0x0000,
+0x0B4C,0x0000,0x0000, 0x0B4D,0x0000,0x0000, 0x0B4E,0x0000,0x0000,
+0x0B4F,0x0000,0x0000, 0x0B50,0x0000,0x0000, 0x0B51,0x0000,0x0000,
+0x0B52,0x0000,0x0000, 0x0B53,0x0000,0x0000, 0x0B54,0x0000,0x0000,
+0x0B55,0x0000,0x0000, 0x0B56,0x0000,0x0000, 0x0B57,0x0000,0x0000,
+0x0B58,0x0000,0x0000, 0x0B59,0x0000,0x0000, 0x0B5A,0x0000,0x0000,
+0x0B5B,0x0000,0x0000, 0x0B5C,0x0000,0x0000, 0x0B5D,0x0000,0x0000,
+0x0B5E,0x0000,0x0000, 0x0B5F,0x0000,0x0000, 0x0B60,0x0000,0x0000,
+0x0B61,0x0000,0x0000, 0x0B62,0x0000,0x0000, 0x0B63,0x0000,0x0000,
+0x0B64,0x0000,0x0000, 0x0B65,0x0000,0x0000, 0x0B66,0x0000,0x0000,
+0x0B67,0x0000,0x0000, 0x0B68,0x0000,0x0000, 0x0B69,0x0000,0x0000,
+0x0B6A,0x0000,0x0000, 0x0B6B,0x0000,0x0000, 0x0B6C,0x0000,0x0000,
+0x0B6D,0x0000,0x0000, 0x0B6E,0x0000,0x0000, 0x0B6F,0x0000,0x0000,
+0x0B70,0x0000,0x0000, 0x0B71,0x0000,0x0000, 0x0B72,0x0000,0x0000,
+0x0B73,0x0000,0x0000, 0x0B74,0x0000,0x0000, 0x0B75,0x0000,0x0000,
+0x0B76,0x0000,0x0000 };
+
+static uint16 page0A0data[]= { /* A000 (2 weights per char) */
+0x1EB1,0x0000, 0x1EB2,0x0000, 0x1EB3,0x0000, 0x1EB4,0x0000,
+0x1EB5,0x0000, 0x1EB6,0x0000, 0x1EB7,0x0000, 0x1EB8,0x0000,
+0x1EB9,0x0000, 0x1EBA,0x0000, 0x1EBB,0x0000, 0x1EBC,0x0000,
+0x1EBD,0x0000, 0x1EBE,0x0000, 0x1EBF,0x0000, 0x1EC0,0x0000,
+0x1EC1,0x0000, 0x1EC2,0x0000, 0x1EC3,0x0000, 0x1EC4,0x0000,
+0x1EC5,0x0000, 0x1EC6,0x0000, 0x1EC7,0x0000, 0x1EC8,0x0000,
+0x1EC9,0x0000, 0x1ECA,0x0000, 0x1ECB,0x0000, 0x1ECC,0x0000,
+0x1ECD,0x0000, 0x1ECE,0x0000, 0x1ECF,0x0000, 0x1ED0,0x0000,
+0x1ED1,0x0000, 0x1ED2,0x0000, 0x1ED3,0x0000, 0x1ED4,0x0000,
+0x1ED5,0x0000, 0x1ED6,0x0000, 0x1ED7,0x0000, 0x1ED8,0x0000,
+0x1ED9,0x0000, 0x1EDA,0x0000, 0x1EDB,0x0000, 0x1EDC,0x0000,
+0x1EDD,0x0000, 0x1EDE,0x0000, 0x1EDF,0x0000, 0x1EE0,0x0000,
+0x1EE1,0x0000, 0x1EE2,0x0000, 0x1EE3,0x0000, 0x1EE4,0x0000,
+0x1EE5,0x0000, 0x1EE6,0x0000, 0x1EE7,0x0000, 0x1EE8,0x0000,
+0x1EE9,0x0000, 0x1EEA,0x0000, 0x1EEB,0x0000, 0x1EEC,0x0000,
+0x1EED,0x0000, 0x1EEE,0x0000, 0x1EEF,0x0000, 0x1EF0,0x0000,
+0x1EF1,0x0000, 0x1EF2,0x0000, 0x1EF3,0x0000, 0x1EF4,0x0000,
+0x1EF5,0x0000, 0x1EF6,0x0000, 0x1EF7,0x0000, 0x1EF8,0x0000,
+0x1EF9,0x0000, 0x1EFA,0x0000, 0x1EFB,0x0000, 0x1EFC,0x0000,
+0x1EFD,0x0000, 0x1EFE,0x0000, 0x1EFF,0x0000, 0x1F00,0x0000,
+0x1F01,0x0000, 0x1F02,0x0000, 0x1F03,0x0000, 0x1F04,0x0000,
+0x1F05,0x0000, 0x1F06,0x0000, 0x1F07,0x0000, 0x1F08,0x0000,
+0x1F09,0x0000, 0x1F0A,0x0000, 0x1F0B,0x0000, 0x1F0C,0x0000,
+0x1F0D,0x0000, 0x1F0E,0x0000, 0x1F0F,0x0000, 0x1F10,0x0000,
+0x1F11,0x0000, 0x1F12,0x0000, 0x1F13,0x0000, 0x1F14,0x0000,
+0x1F15,0x0000, 0x1F16,0x0000, 0x1F17,0x0000, 0x1F18,0x0000,
+0x1F19,0x0000, 0x1F1A,0x0000, 0x1F1B,0x0000, 0x1F1C,0x0000,
+0x1F1D,0x0000, 0x1F1E,0x0000, 0x1F1F,0x0000, 0x1F20,0x0000,
+0x1F21,0x0000, 0x1F22,0x0000, 0x1F23,0x0000, 0x1F24,0x0000,
+0x1F25,0x0000, 0x1F26,0x0000, 0x1F27,0x0000, 0x1F28,0x0000,
+0x1F29,0x0000, 0x1F2A,0x0000, 0x1F2B,0x0000, 0x1F2C,0x0000,
+0x1F2D,0x0000, 0x1F2E,0x0000, 0x1F2F,0x0000, 0x1F30,0x0000,
+0x1F31,0x0000, 0x1F32,0x0000, 0x1F33,0x0000, 0x1F34,0x0000,
+0x1F35,0x0000, 0x1F36,0x0000, 0x1F37,0x0000, 0x1F38,0x0000,
+0x1F39,0x0000, 0x1F3A,0x0000, 0x1F3B,0x0000, 0x1F3C,0x0000,
+0x1F3D,0x0000, 0x1F3E,0x0000, 0x1F3F,0x0000, 0x1F40,0x0000,
+0x1F41,0x0000, 0x1F42,0x0000, 0x1F43,0x0000, 0x1F44,0x0000,
+0x1F45,0x0000, 0x1F46,0x0000, 0x1F47,0x0000, 0x1F48,0x0000,
+0x1F49,0x0000, 0x1F4A,0x0000, 0x1F4B,0x0000, 0x1F4C,0x0000,
+0x1F4D,0x0000, 0x1F4E,0x0000, 0x1F4F,0x0000, 0x1F50,0x0000,
+0x1F51,0x0000, 0x1F52,0x0000, 0x1F53,0x0000, 0x1F54,0x0000,
+0x1F55,0x0000, 0x1F56,0x0000, 0x1F57,0x0000, 0x1F58,0x0000,
+0x1F59,0x0000, 0x1F5A,0x0000, 0x1F5B,0x0000, 0x1F5C,0x0000,
+0x1F5D,0x0000, 0x1F5E,0x0000, 0x1F5F,0x0000, 0x1F60,0x0000,
+0x1F61,0x0000, 0x1F62,0x0000, 0x1F63,0x0000, 0x1F64,0x0000,
+0x1F65,0x0000, 0x1F66,0x0000, 0x1F67,0x0000, 0x1F68,0x0000,
+0x1F69,0x0000, 0x1F6A,0x0000, 0x1F6B,0x0000, 0x1F6C,0x0000,
+0x1F6D,0x0000, 0x1F6E,0x0000, 0x1F6F,0x0000, 0x1F70,0x0000,
+0x1F71,0x0000, 0x1F72,0x0000, 0x1F73,0x0000, 0x1F74,0x0000,
+0x1F75,0x0000, 0x1F76,0x0000, 0x1F77,0x0000, 0x1F78,0x0000,
+0x1F79,0x0000, 0x1F7A,0x0000, 0x1F7B,0x0000, 0x1F7C,0x0000,
+0x1F7D,0x0000, 0x1F7E,0x0000, 0x1F7F,0x0000, 0x1F80,0x0000,
+0x1F81,0x0000, 0x1F82,0x0000, 0x1F83,0x0000, 0x1F84,0x0000,
+0x1F85,0x0000, 0x1F86,0x0000, 0x1F87,0x0000, 0x1F88,0x0000,
+0x1F89,0x0000, 0x1F8A,0x0000, 0x1F8B,0x0000, 0x1F8C,0x0000,
+0x1F8D,0x0000, 0x1F8E,0x0000, 0x1F8F,0x0000, 0x1F90,0x0000,
+0x1F91,0x0000, 0x1F92,0x0000, 0x1F93,0x0000, 0x1F94,0x0000,
+0x1F95,0x0000, 0x1F96,0x0000, 0x1F97,0x0000, 0x1F98,0x0000,
+0x1F99,0x0000, 0x1F9A,0x0000, 0x1F9B,0x0000, 0x1F9C,0x0000,
+0x1F9D,0x0000, 0x1F9E,0x0000, 0x1F9F,0x0000, 0x1FA0,0x0000,
+0x1FA1,0x0000, 0x1FA2,0x0000, 0x1FA3,0x0000, 0x1FA4,0x0000,
+0x1FA5,0x0000, 0x1FA6,0x0000, 0x1FA7,0x0000, 0x1FA8,0x0000,
+0x1FA9,0x0000, 0x1FAA,0x0000, 0x1FAB,0x0000, 0x1FAC,0x0000,
+0x1FAD,0x0000, 0x1FAE,0x0000, 0x1FAF,0x0000, 0x1FB0,0x0000
+};
+
+static uint16 page0A1data[]= { /* A100 (2 weights per char) */
+0x1FB1,0x0000, 0x1FB2,0x0000, 0x1FB3,0x0000, 0x1FB4,0x0000,
+0x1FB5,0x0000, 0x1FB6,0x0000, 0x1FB7,0x0000, 0x1FB8,0x0000,
+0x1FB9,0x0000, 0x1FBA,0x0000, 0x1FBB,0x0000, 0x1FBC,0x0000,
+0x1FBD,0x0000, 0x1FBE,0x0000, 0x1FBF,0x0000, 0x1FC0,0x0000,
+0x1FC1,0x0000, 0x1FC2,0x0000, 0x1FC3,0x0000, 0x1FC4,0x0000,
+0x1FC5,0x0000, 0x1FC6,0x0000, 0x1FC7,0x0000, 0x1FC8,0x0000,
+0x1FC9,0x0000, 0x1FCA,0x0000, 0x1FCB,0x0000, 0x1FCC,0x0000,
+0x1FCD,0x0000, 0x1FCE,0x0000, 0x1FCF,0x0000, 0x1FD0,0x0000,
+0x1FD1,0x0000, 0x1FD2,0x0000, 0x1FD3,0x0000, 0x1FD4,0x0000,
+0x1FD5,0x0000, 0x1FD6,0x0000, 0x1FD7,0x0000, 0x1FD8,0x0000,
+0x1FD9,0x0000, 0x1FDA,0x0000, 0x1FDB,0x0000, 0x1FDC,0x0000,
+0x1FDD,0x0000, 0x1FDE,0x0000, 0x1FDF,0x0000, 0x1FE0,0x0000,
+0x1FE1,0x0000, 0x1FE2,0x0000, 0x1FE3,0x0000, 0x1FE4,0x0000,
+0x1FE5,0x0000, 0x1FE6,0x0000, 0x1FE7,0x0000, 0x1FE8,0x0000,
+0x1FE9,0x0000, 0x1FEA,0x0000, 0x1FEB,0x0000, 0x1FEC,0x0000,
+0x1FED,0x0000, 0x1FEE,0x0000, 0x1FEF,0x0000, 0x1FF0,0x0000,
+0x1FF1,0x0000, 0x1FF2,0x0000, 0x1FF3,0x0000, 0x1FF4,0x0000,
+0x1FF5,0x0000, 0x1FF6,0x0000, 0x1FF7,0x0000, 0x1FF8,0x0000,
+0x1FF9,0x0000, 0x1FFA,0x0000, 0x1FFB,0x0000, 0x1FFC,0x0000,
+0x1FFD,0x0000, 0x1FFE,0x0000, 0x1FFF,0x0000, 0x2000,0x0000,
+0x2001,0x0000, 0x2002,0x0000, 0x2003,0x0000, 0x2004,0x0000,
+0x2005,0x0000, 0x2006,0x0000, 0x2007,0x0000, 0x2008,0x0000,
+0x2009,0x0000, 0x200A,0x0000, 0x200B,0x0000, 0x200C,0x0000,
+0x200D,0x0000, 0x200E,0x0000, 0x200F,0x0000, 0x2010,0x0000,
+0x2011,0x0000, 0x2012,0x0000, 0x2013,0x0000, 0x2014,0x0000,
+0x2015,0x0000, 0x2016,0x0000, 0x2017,0x0000, 0x2018,0x0000,
+0x2019,0x0000, 0x201A,0x0000, 0x201B,0x0000, 0x201C,0x0000,
+0x201D,0x0000, 0x201E,0x0000, 0x201F,0x0000, 0x2020,0x0000,
+0x2021,0x0000, 0x2022,0x0000, 0x2023,0x0000, 0x2024,0x0000,
+0x2025,0x0000, 0x2026,0x0000, 0x2027,0x0000, 0x2028,0x0000,
+0x2029,0x0000, 0x202A,0x0000, 0x202B,0x0000, 0x202C,0x0000,
+0x202D,0x0000, 0x202E,0x0000, 0x202F,0x0000, 0x2030,0x0000,
+0x2031,0x0000, 0x2032,0x0000, 0x2033,0x0000, 0x2034,0x0000,
+0x2035,0x0000, 0x2036,0x0000, 0x2037,0x0000, 0x2038,0x0000,
+0x2039,0x0000, 0x203A,0x0000, 0x203B,0x0000, 0x203C,0x0000,
+0x203D,0x0000, 0x203E,0x0000, 0x203F,0x0000, 0x2040,0x0000,
+0x2041,0x0000, 0x2042,0x0000, 0x2043,0x0000, 0x2044,0x0000,
+0x2045,0x0000, 0x2046,0x0000, 0x2047,0x0000, 0x2048,0x0000,
+0x2049,0x0000, 0x204A,0x0000, 0x204B,0x0000, 0x204C,0x0000,
+0x204D,0x0000, 0x204E,0x0000, 0x204F,0x0000, 0x2050,0x0000,
+0x2051,0x0000, 0x2052,0x0000, 0x2053,0x0000, 0x2054,0x0000,
+0x2055,0x0000, 0x2056,0x0000, 0x2057,0x0000, 0x2058,0x0000,
+0x2059,0x0000, 0x205A,0x0000, 0x205B,0x0000, 0x205C,0x0000,
+0x205D,0x0000, 0x205E,0x0000, 0x205F,0x0000, 0x2060,0x0000,
+0x2061,0x0000, 0x2062,0x0000, 0x2063,0x0000, 0x2064,0x0000,
+0x2065,0x0000, 0x2066,0x0000, 0x2067,0x0000, 0x2068,0x0000,
+0x2069,0x0000, 0x206A,0x0000, 0x206B,0x0000, 0x206C,0x0000,
+0x206D,0x0000, 0x206E,0x0000, 0x206F,0x0000, 0x2070,0x0000,
+0x2071,0x0000, 0x2072,0x0000, 0x2073,0x0000, 0x2074,0x0000,
+0x2075,0x0000, 0x2076,0x0000, 0x2077,0x0000, 0x2078,0x0000,
+0x2079,0x0000, 0x207A,0x0000, 0x207B,0x0000, 0x207C,0x0000,
+0x207D,0x0000, 0x207E,0x0000, 0x207F,0x0000, 0x2080,0x0000,
+0x2081,0x0000, 0x2082,0x0000, 0x2083,0x0000, 0x2084,0x0000,
+0x2085,0x0000, 0x2086,0x0000, 0x2087,0x0000, 0x2088,0x0000,
+0x2089,0x0000, 0x208A,0x0000, 0x208B,0x0000, 0x208C,0x0000,
+0x208D,0x0000, 0x208E,0x0000, 0x208F,0x0000, 0x2090,0x0000,
+0x2091,0x0000, 0x2092,0x0000, 0x2093,0x0000, 0x2094,0x0000,
+0x2095,0x0000, 0x2096,0x0000, 0x2097,0x0000, 0x2098,0x0000,
+0x2099,0x0000, 0x209A,0x0000, 0x209B,0x0000, 0x209C,0x0000,
+0x209D,0x0000, 0x209E,0x0000, 0x209F,0x0000, 0x20A0,0x0000,
+0x20A1,0x0000, 0x20A2,0x0000, 0x20A3,0x0000, 0x20A4,0x0000,
+0x20A5,0x0000, 0x20A6,0x0000, 0x20A7,0x0000, 0x20A8,0x0000,
+0x20A9,0x0000, 0x20AA,0x0000, 0x20AB,0x0000, 0x20AC,0x0000,
+0x20AD,0x0000, 0x20AE,0x0000, 0x20AF,0x0000, 0x20B0,0x0000
+};
+
+static uint16 page0A2data[]= { /* A200 (2 weights per char) */
+0x20B1,0x0000, 0x20B2,0x0000, 0x20B3,0x0000, 0x20B4,0x0000,
+0x20B5,0x0000, 0x20B6,0x0000, 0x20B7,0x0000, 0x20B8,0x0000,
+0x20B9,0x0000, 0x20BA,0x0000, 0x20BB,0x0000, 0x20BC,0x0000,
+0x20BD,0x0000, 0x20BE,0x0000, 0x20BF,0x0000, 0x20C0,0x0000,
+0x20C1,0x0000, 0x20C2,0x0000, 0x20C3,0x0000, 0x20C4,0x0000,
+0x20C5,0x0000, 0x20C6,0x0000, 0x20C7,0x0000, 0x20C8,0x0000,
+0x20C9,0x0000, 0x20CA,0x0000, 0x20CB,0x0000, 0x20CC,0x0000,
+0x20CD,0x0000, 0x20CE,0x0000, 0x20CF,0x0000, 0x20D0,0x0000,
+0x20D1,0x0000, 0x20D2,0x0000, 0x20D3,0x0000, 0x20D4,0x0000,
+0x20D5,0x0000, 0x20D6,0x0000, 0x20D7,0x0000, 0x20D8,0x0000,
+0x20D9,0x0000, 0x20DA,0x0000, 0x20DB,0x0000, 0x20DC,0x0000,
+0x20DD,0x0000, 0x20DE,0x0000, 0x20DF,0x0000, 0x20E0,0x0000,
+0x20E1,0x0000, 0x20E2,0x0000, 0x20E3,0x0000, 0x20E4,0x0000,
+0x20E5,0x0000, 0x20E6,0x0000, 0x20E7,0x0000, 0x20E8,0x0000,
+0x20E9,0x0000, 0x20EA,0x0000, 0x20EB,0x0000, 0x20EC,0x0000,
+0x20ED,0x0000, 0x20EE,0x0000, 0x20EF,0x0000, 0x20F0,0x0000,
+0x20F1,0x0000, 0x20F2,0x0000, 0x20F3,0x0000, 0x20F4,0x0000,
+0x20F5,0x0000, 0x20F6,0x0000, 0x20F7,0x0000, 0x20F8,0x0000,
+0x20F9,0x0000, 0x20FA,0x0000, 0x20FB,0x0000, 0x20FC,0x0000,
+0x20FD,0x0000, 0x20FE,0x0000, 0x20FF,0x0000, 0x2100,0x0000,
+0x2101,0x0000, 0x2102,0x0000, 0x2103,0x0000, 0x2104,0x0000,
+0x2105,0x0000, 0x2106,0x0000, 0x2107,0x0000, 0x2108,0x0000,
+0x2109,0x0000, 0x210A,0x0000, 0x210B,0x0000, 0x210C,0x0000,
+0x210D,0x0000, 0x210E,0x0000, 0x210F,0x0000, 0x2110,0x0000,
+0x2111,0x0000, 0x2112,0x0000, 0x2113,0x0000, 0x2114,0x0000,
+0x2115,0x0000, 0x2116,0x0000, 0x2117,0x0000, 0x2118,0x0000,
+0x2119,0x0000, 0x211A,0x0000, 0x211B,0x0000, 0x211C,0x0000,
+0x211D,0x0000, 0x211E,0x0000, 0x211F,0x0000, 0x2120,0x0000,
+0x2121,0x0000, 0x2122,0x0000, 0x2123,0x0000, 0x2124,0x0000,
+0x2125,0x0000, 0x2126,0x0000, 0x2127,0x0000, 0x2128,0x0000,
+0x2129,0x0000, 0x212A,0x0000, 0x212B,0x0000, 0x212C,0x0000,
+0x212D,0x0000, 0x212E,0x0000, 0x212F,0x0000, 0x2130,0x0000,
+0x2131,0x0000, 0x2132,0x0000, 0x2133,0x0000, 0x2134,0x0000,
+0x2135,0x0000, 0x2136,0x0000, 0x2137,0x0000, 0x2138,0x0000,
+0x2139,0x0000, 0x213A,0x0000, 0x213B,0x0000, 0x213C,0x0000,
+0x213D,0x0000, 0x213E,0x0000, 0x213F,0x0000, 0x2140,0x0000,
+0x2141,0x0000, 0x2142,0x0000, 0x2143,0x0000, 0x2144,0x0000,
+0x2145,0x0000, 0x2146,0x0000, 0x2147,0x0000, 0x2148,0x0000,
+0x2149,0x0000, 0x214A,0x0000, 0x214B,0x0000, 0x214C,0x0000,
+0x214D,0x0000, 0x214E,0x0000, 0x214F,0x0000, 0x2150,0x0000,
+0x2151,0x0000, 0x2152,0x0000, 0x2153,0x0000, 0x2154,0x0000,
+0x2155,0x0000, 0x2156,0x0000, 0x2157,0x0000, 0x2158,0x0000,
+0x2159,0x0000, 0x215A,0x0000, 0x215B,0x0000, 0x215C,0x0000,
+0x215D,0x0000, 0x215E,0x0000, 0x215F,0x0000, 0x2160,0x0000,
+0x2161,0x0000, 0x2162,0x0000, 0x2163,0x0000, 0x2164,0x0000,
+0x2165,0x0000, 0x2166,0x0000, 0x2167,0x0000, 0x2168,0x0000,
+0x2169,0x0000, 0x216A,0x0000, 0x216B,0x0000, 0x216C,0x0000,
+0x216D,0x0000, 0x216E,0x0000, 0x216F,0x0000, 0x2170,0x0000,
+0x2171,0x0000, 0x2172,0x0000, 0x2173,0x0000, 0x2174,0x0000,
+0x2175,0x0000, 0x2176,0x0000, 0x2177,0x0000, 0x2178,0x0000,
+0x2179,0x0000, 0x217A,0x0000, 0x217B,0x0000, 0x217C,0x0000,
+0x217D,0x0000, 0x217E,0x0000, 0x217F,0x0000, 0x2180,0x0000,
+0x2181,0x0000, 0x2182,0x0000, 0x2183,0x0000, 0x2184,0x0000,
+0x2185,0x0000, 0x2186,0x0000, 0x2187,0x0000, 0x2188,0x0000,
+0x2189,0x0000, 0x218A,0x0000, 0x218B,0x0000, 0x218C,0x0000,
+0x218D,0x0000, 0x218E,0x0000, 0x218F,0x0000, 0x2190,0x0000,
+0x2191,0x0000, 0x2192,0x0000, 0x2193,0x0000, 0x2194,0x0000,
+0x2195,0x0000, 0x2196,0x0000, 0x2197,0x0000, 0x2198,0x0000,
+0x2199,0x0000, 0x219A,0x0000, 0x219B,0x0000, 0x219C,0x0000,
+0x219D,0x0000, 0x219E,0x0000, 0x219F,0x0000, 0x21A0,0x0000,
+0x21A1,0x0000, 0x21A2,0x0000, 0x21A3,0x0000, 0x21A4,0x0000,
+0x21A5,0x0000, 0x21A6,0x0000, 0x21A7,0x0000, 0x21A8,0x0000,
+0x21A9,0x0000, 0x21AA,0x0000, 0x21AB,0x0000, 0x21AC,0x0000,
+0x21AD,0x0000, 0x21AE,0x0000, 0x21AF,0x0000, 0x21B0,0x0000
+};
+
+static uint16 page0A3data[]= { /* A300 (2 weights per char) */
+0x21B1,0x0000, 0x21B2,0x0000, 0x21B3,0x0000, 0x21B4,0x0000,
+0x21B5,0x0000, 0x21B6,0x0000, 0x21B7,0x0000, 0x21B8,0x0000,
+0x21B9,0x0000, 0x21BA,0x0000, 0x21BB,0x0000, 0x21BC,0x0000,
+0x21BD,0x0000, 0x21BE,0x0000, 0x21BF,0x0000, 0x21C0,0x0000,
+0x21C1,0x0000, 0x21C2,0x0000, 0x21C3,0x0000, 0x21C4,0x0000,
+0x21C5,0x0000, 0x21C6,0x0000, 0x21C7,0x0000, 0x21C8,0x0000,
+0x21C9,0x0000, 0x21CA,0x0000, 0x21CB,0x0000, 0x21CC,0x0000,
+0x21CD,0x0000, 0x21CE,0x0000, 0x21CF,0x0000, 0x21D0,0x0000,
+0x21D1,0x0000, 0x21D2,0x0000, 0x21D3,0x0000, 0x21D4,0x0000,
+0x21D5,0x0000, 0x21D6,0x0000, 0x21D7,0x0000, 0x21D8,0x0000,
+0x21D9,0x0000, 0x21DA,0x0000, 0x21DB,0x0000, 0x21DC,0x0000,
+0x21DD,0x0000, 0x21DE,0x0000, 0x21DF,0x0000, 0x21E0,0x0000,
+0x21E1,0x0000, 0x21E2,0x0000, 0x21E3,0x0000, 0x21E4,0x0000,
+0x21E5,0x0000, 0x21E6,0x0000, 0x21E7,0x0000, 0x21E8,0x0000,
+0x21E9,0x0000, 0x21EA,0x0000, 0x21EB,0x0000, 0x21EC,0x0000,
+0x21ED,0x0000, 0x21EE,0x0000, 0x21EF,0x0000, 0x21F0,0x0000,
+0x21F1,0x0000, 0x21F2,0x0000, 0x21F3,0x0000, 0x21F4,0x0000,
+0x21F5,0x0000, 0x21F6,0x0000, 0x21F7,0x0000, 0x21F8,0x0000,
+0x21F9,0x0000, 0x21FA,0x0000, 0x21FB,0x0000, 0x21FC,0x0000,
+0x21FD,0x0000, 0x21FE,0x0000, 0x21FF,0x0000, 0x2200,0x0000,
+0x2201,0x0000, 0x2202,0x0000, 0x2203,0x0000, 0x2204,0x0000,
+0x2205,0x0000, 0x2206,0x0000, 0x2207,0x0000, 0x2208,0x0000,
+0x2209,0x0000, 0x220A,0x0000, 0x220B,0x0000, 0x220C,0x0000,
+0x220D,0x0000, 0x220E,0x0000, 0x220F,0x0000, 0x2210,0x0000,
+0x2211,0x0000, 0x2212,0x0000, 0x2213,0x0000, 0x2214,0x0000,
+0x2215,0x0000, 0x2216,0x0000, 0x2217,0x0000, 0x2218,0x0000,
+0x2219,0x0000, 0x221A,0x0000, 0x221B,0x0000, 0x221C,0x0000,
+0x221D,0x0000, 0x221E,0x0000, 0x221F,0x0000, 0x2220,0x0000,
+0x2221,0x0000, 0x2222,0x0000, 0x2223,0x0000, 0x2224,0x0000,
+0x2225,0x0000, 0x2226,0x0000, 0x2227,0x0000, 0x2228,0x0000,
+0x2229,0x0000, 0x222A,0x0000, 0x222B,0x0000, 0x222C,0x0000,
+0x222D,0x0000, 0x222E,0x0000, 0x222F,0x0000, 0x2230,0x0000,
+0x2231,0x0000, 0x2232,0x0000, 0x2233,0x0000, 0x2234,0x0000,
+0x2235,0x0000, 0x2236,0x0000, 0x2237,0x0000, 0x2238,0x0000,
+0x2239,0x0000, 0x223A,0x0000, 0x223B,0x0000, 0x223C,0x0000,
+0x223D,0x0000, 0x223E,0x0000, 0x223F,0x0000, 0x2240,0x0000,
+0x2241,0x0000, 0x2242,0x0000, 0x2243,0x0000, 0x2244,0x0000,
+0x2245,0x0000, 0x2246,0x0000, 0x2247,0x0000, 0x2248,0x0000,
+0x2249,0x0000, 0x224A,0x0000, 0x224B,0x0000, 0x224C,0x0000,
+0x224D,0x0000, 0x224E,0x0000, 0x224F,0x0000, 0x2250,0x0000,
+0x2251,0x0000, 0x2252,0x0000, 0x2253,0x0000, 0x2254,0x0000,
+0x2255,0x0000, 0x2256,0x0000, 0x2257,0x0000, 0x2258,0x0000,
+0x2259,0x0000, 0x225A,0x0000, 0x225B,0x0000, 0x225C,0x0000,
+0x225D,0x0000, 0x225E,0x0000, 0x225F,0x0000, 0x2260,0x0000,
+0x2261,0x0000, 0x2262,0x0000, 0x2263,0x0000, 0x2264,0x0000,
+0x2265,0x0000, 0x2266,0x0000, 0x2267,0x0000, 0x2268,0x0000,
+0x2269,0x0000, 0x226A,0x0000, 0x226B,0x0000, 0x226C,0x0000,
+0x226D,0x0000, 0x226E,0x0000, 0x226F,0x0000, 0x2270,0x0000,
+0x2271,0x0000, 0x2272,0x0000, 0x2273,0x0000, 0x2274,0x0000,
+0x2275,0x0000, 0x2276,0x0000, 0x2277,0x0000, 0x2278,0x0000,
+0x2279,0x0000, 0x227A,0x0000, 0x227B,0x0000, 0x227C,0x0000,
+0x227D,0x0000, 0x227E,0x0000, 0x227F,0x0000, 0x2280,0x0000,
+0x2281,0x0000, 0x2282,0x0000, 0x2283,0x0000, 0x2284,0x0000,
+0x2285,0x0000, 0x2286,0x0000, 0x2287,0x0000, 0x2288,0x0000,
+0x2289,0x0000, 0x228A,0x0000, 0x228B,0x0000, 0x228C,0x0000,
+0x228D,0x0000, 0x228E,0x0000, 0x228F,0x0000, 0x2290,0x0000,
+0x2291,0x0000, 0x2292,0x0000, 0x2293,0x0000, 0x2294,0x0000,
+0x2295,0x0000, 0x2296,0x0000, 0x2297,0x0000, 0x2298,0x0000,
+0x2299,0x0000, 0x229A,0x0000, 0x229B,0x0000, 0x229C,0x0000,
+0x229D,0x0000, 0x229E,0x0000, 0x229F,0x0000, 0x22A0,0x0000,
+0x22A1,0x0000, 0x22A2,0x0000, 0x22A3,0x0000, 0x22A4,0x0000,
+0x22A5,0x0000, 0x22A6,0x0000, 0x22A7,0x0000, 0x22A8,0x0000,
+0x22A9,0x0000, 0x22AA,0x0000, 0x22AB,0x0000, 0x22AC,0x0000,
+0x22AD,0x0000, 0x22AE,0x0000, 0x22AF,0x0000, 0x22B0,0x0000
+};
+
+static uint16 page0A4data[]= { /* A400 (3 weights per char) */
+0x22B1,0x0000,0x0000, 0x22B2,0x0000,0x0000, 0x22B3,0x0000,0x0000,
+0x22B4,0x0000,0x0000, 0x22B5,0x0000,0x0000, 0x22B6,0x0000,0x0000,
+0x22B7,0x0000,0x0000, 0x22B8,0x0000,0x0000, 0x22B9,0x0000,0x0000,
+0x22BA,0x0000,0x0000, 0x22BB,0x0000,0x0000, 0x22BC,0x0000,0x0000,
+0x22BD,0x0000,0x0000, 0x22BE,0x0000,0x0000, 0x22BF,0x0000,0x0000,
+0x22C0,0x0000,0x0000, 0x22C1,0x0000,0x0000, 0x22C2,0x0000,0x0000,
+0x22C3,0x0000,0x0000, 0x22C4,0x0000,0x0000, 0x22C5,0x0000,0x0000,
+0x22C6,0x0000,0x0000, 0x22C7,0x0000,0x0000, 0x22C8,0x0000,0x0000,
+0x22C9,0x0000,0x0000, 0x22CA,0x0000,0x0000, 0x22CB,0x0000,0x0000,
+0x22CC,0x0000,0x0000, 0x22CD,0x0000,0x0000, 0x22CE,0x0000,0x0000,
+0x22CF,0x0000,0x0000, 0x22D0,0x0000,0x0000, 0x22D1,0x0000,0x0000,
+0x22D2,0x0000,0x0000, 0x22D3,0x0000,0x0000, 0x22D4,0x0000,0x0000,
+0x22D5,0x0000,0x0000, 0x22D6,0x0000,0x0000, 0x22D7,0x0000,0x0000,
+0x22D8,0x0000,0x0000, 0x22D9,0x0000,0x0000, 0x22DA,0x0000,0x0000,
+0x22DB,0x0000,0x0000, 0x22DC,0x0000,0x0000, 0x22DD,0x0000,0x0000,
+0x22DE,0x0000,0x0000, 0x22DF,0x0000,0x0000, 0x22E0,0x0000,0x0000,
+0x22E1,0x0000,0x0000, 0x22E2,0x0000,0x0000, 0x22E3,0x0000,0x0000,
+0x22E4,0x0000,0x0000, 0x22E5,0x0000,0x0000, 0x22E6,0x0000,0x0000,
+0x22E7,0x0000,0x0000, 0x22E8,0x0000,0x0000, 0x22E9,0x0000,0x0000,
+0x22EA,0x0000,0x0000, 0x22EB,0x0000,0x0000, 0x22EC,0x0000,0x0000,
+0x22ED,0x0000,0x0000, 0x22EE,0x0000,0x0000, 0x22EF,0x0000,0x0000,
+0x22F0,0x0000,0x0000, 0x22F1,0x0000,0x0000, 0x22F2,0x0000,0x0000,
+0x22F3,0x0000,0x0000, 0x22F4,0x0000,0x0000, 0x22F5,0x0000,0x0000,
+0x22F6,0x0000,0x0000, 0x22F7,0x0000,0x0000, 0x22F8,0x0000,0x0000,
+0x22F9,0x0000,0x0000, 0x22FA,0x0000,0x0000, 0x22FB,0x0000,0x0000,
+0x22FC,0x0000,0x0000, 0x22FD,0x0000,0x0000, 0x22FE,0x0000,0x0000,
+0x22FF,0x0000,0x0000, 0x2300,0x0000,0x0000, 0x2301,0x0000,0x0000,
+0x2302,0x0000,0x0000, 0x2303,0x0000,0x0000, 0x2304,0x0000,0x0000,
+0x2305,0x0000,0x0000, 0x2306,0x0000,0x0000, 0x2307,0x0000,0x0000,
+0x2308,0x0000,0x0000, 0x2309,0x0000,0x0000, 0x230A,0x0000,0x0000,
+0x230B,0x0000,0x0000, 0x230C,0x0000,0x0000, 0x230D,0x0000,0x0000,
+0x230E,0x0000,0x0000, 0x230F,0x0000,0x0000, 0x2310,0x0000,0x0000,
+0x2311,0x0000,0x0000, 0x2312,0x0000,0x0000, 0x2313,0x0000,0x0000,
+0x2314,0x0000,0x0000, 0x2315,0x0000,0x0000, 0x2316,0x0000,0x0000,
+0x2317,0x0000,0x0000, 0x2318,0x0000,0x0000, 0x2319,0x0000,0x0000,
+0x231A,0x0000,0x0000, 0x231B,0x0000,0x0000, 0x231C,0x0000,0x0000,
+0x231D,0x0000,0x0000, 0x231E,0x0000,0x0000, 0x231F,0x0000,0x0000,
+0x2320,0x0000,0x0000, 0x2321,0x0000,0x0000, 0x2322,0x0000,0x0000,
+0x2323,0x0000,0x0000, 0x2324,0x0000,0x0000, 0x2325,0x0000,0x0000,
+0x2326,0x0000,0x0000, 0x2327,0x0000,0x0000, 0x2328,0x0000,0x0000,
+0x2329,0x0000,0x0000, 0x232A,0x0000,0x0000, 0x232B,0x0000,0x0000,
+0x232C,0x0000,0x0000, 0x232D,0x0000,0x0000, 0x232E,0x0000,0x0000,
+0x232F,0x0000,0x0000, 0x2330,0x0000,0x0000, 0x2331,0x0000,0x0000,
+0x2332,0x0000,0x0000, 0x2333,0x0000,0x0000, 0x2334,0x0000,0x0000,
+0x2335,0x0000,0x0000, 0x2336,0x0000,0x0000, 0x2337,0x0000,0x0000,
+0x2338,0x0000,0x0000, 0x2339,0x0000,0x0000, 0x233A,0x0000,0x0000,
+0x233B,0x0000,0x0000, 0x233C,0x0000,0x0000, 0x233D,0x0000,0x0000,
+0xFBC1,0xA48D,0x0000, 0xFBC1,0xA48E,0x0000, 0xFBC1,0xA48F,0x0000,
+0x0BCE,0x0000,0x0000, 0x0BCF,0x0000,0x0000, 0x0BD0,0x0000,0x0000,
+0x0BD1,0x0000,0x0000, 0x0BD2,0x0000,0x0000, 0x0BD3,0x0000,0x0000,
+0x0BD4,0x0000,0x0000, 0x0BD5,0x0000,0x0000, 0x0BD6,0x0000,0x0000,
+0x0BD7,0x0000,0x0000, 0x0BD8,0x0000,0x0000, 0x0BD9,0x0000,0x0000,
+0x0BDA,0x0000,0x0000, 0x0BDB,0x0000,0x0000, 0x0BDC,0x0000,0x0000,
+0x0BDD,0x0000,0x0000, 0x0BDE,0x0000,0x0000, 0x0BDF,0x0000,0x0000,
+0x0BE0,0x0000,0x0000, 0x0BE1,0x0000,0x0000, 0x0BE2,0x0000,0x0000,
+0x0BE3,0x0000,0x0000, 0x0BE4,0x0000,0x0000, 0x0BE5,0x0000,0x0000,
+0x0BE6,0x0000,0x0000, 0x0BE7,0x0000,0x0000, 0x0BE8,0x0000,0x0000,
+0x0BE9,0x0000,0x0000, 0x0BEA,0x0000,0x0000, 0x0BEB,0x0000,0x0000,
+0x0BEC,0x0000,0x0000, 0x0BED,0x0000,0x0000, 0x0BEE,0x0000,0x0000,
+0x0BEF,0x0000,0x0000, 0x0BF0,0x0000,0x0000, 0x0BF1,0x0000,0x0000,
+0x0BF2,0x0000,0x0000, 0x0BF3,0x0000,0x0000, 0x0BF4,0x0000,0x0000,
+0x0BF5,0x0000,0x0000, 0x0BF6,0x0000,0x0000, 0x0BF7,0x0000,0x0000,
+0x0BF8,0x0000,0x0000, 0x0BF9,0x0000,0x0000, 0x0BFA,0x0000,0x0000,
+0x0BFB,0x0000,0x0000, 0x0BFC,0x0000,0x0000, 0x0BFD,0x0000,0x0000,
+0x0BFE,0x0000,0x0000, 0x0BFF,0x0000,0x0000, 0x0C00,0x0000,0x0000,
+0x0C01,0x0000,0x0000, 0x0C02,0x0000,0x0000, 0x0C03,0x0000,0x0000,
+0x0C04,0x0000,0x0000, 0xFBC1,0xA4C7,0x0000, 0xFBC1,0xA4C8,0x0000,
+0xFBC1,0xA4C9,0x0000, 0xFBC1,0xA4CA,0x0000, 0xFBC1,0xA4CB,0x0000,
+0xFBC1,0xA4CC,0x0000, 0xFBC1,0xA4CD,0x0000, 0xFBC1,0xA4CE,0x0000,
+0xFBC1,0xA4CF,0x0000, 0xFBC1,0xA4D0,0x0000, 0xFBC1,0xA4D1,0x0000,
+0xFBC1,0xA4D2,0x0000, 0xFBC1,0xA4D3,0x0000, 0xFBC1,0xA4D4,0x0000,
+0xFBC1,0xA4D5,0x0000, 0xFBC1,0xA4D6,0x0000, 0xFBC1,0xA4D7,0x0000,
+0xFBC1,0xA4D8,0x0000, 0xFBC1,0xA4D9,0x0000, 0xFBC1,0xA4DA,0x0000,
+0xFBC1,0xA4DB,0x0000, 0xFBC1,0xA4DC,0x0000, 0xFBC1,0xA4DD,0x0000,
+0xFBC1,0xA4DE,0x0000, 0xFBC1,0xA4DF,0x0000, 0xFBC1,0xA4E0,0x0000,
+0xFBC1,0xA4E1,0x0000, 0xFBC1,0xA4E2,0x0000, 0xFBC1,0xA4E3,0x0000,
+0xFBC1,0xA4E4,0x0000, 0xFBC1,0xA4E5,0x0000, 0xFBC1,0xA4E6,0x0000,
+0xFBC1,0xA4E7,0x0000, 0xFBC1,0xA4E8,0x0000, 0xFBC1,0xA4E9,0x0000,
+0xFBC1,0xA4EA,0x0000, 0xFBC1,0xA4EB,0x0000, 0xFBC1,0xA4EC,0x0000,
+0xFBC1,0xA4ED,0x0000, 0xFBC1,0xA4EE,0x0000, 0xFBC1,0xA4EF,0x0000,
+0xFBC1,0xA4F0,0x0000, 0xFBC1,0xA4F1,0x0000, 0xFBC1,0xA4F2,0x0000,
+0xFBC1,0xA4F3,0x0000, 0xFBC1,0xA4F4,0x0000, 0xFBC1,0xA4F5,0x0000,
+0xFBC1,0xA4F6,0x0000, 0xFBC1,0xA4F7,0x0000, 0xFBC1,0xA4F8,0x0000,
+0xFBC1,0xA4F9,0x0000, 0xFBC1,0xA4FA,0x0000, 0xFBC1,0xA4FB,0x0000,
+0xFBC1,0xA4FC,0x0000, 0xFBC1,0xA4FD,0x0000, 0xFBC1,0xA4FE,0x0000,
+0xFBC1,0xA4FF,0x0000 };
+
+static uint16 page0F9data[]= { /* F900 (3 weights per char) */
+0xFB41,0x8C48,0x0000, 0xFB40,0xE6F4,0x0000, 0xFB41,0x8ECA,0x0000,
+0xFB41,0x8CC8,0x0000, 0xFB40,0xEED1,0x0000, 0xFB40,0xCE32,0x0000,
+0xFB40,0xD3E5,0x0000, 0xFB41,0x9F9C,0x0000, 0xFB41,0x9F9C,0x0000,
+0xFB40,0xD951,0x0000, 0xFB41,0x91D1,0x0000, 0xFB40,0xD587,0x0000,
+0xFB40,0xD948,0x0000, 0xFB40,0xE1F6,0x0000, 0xFB40,0xF669,0x0000,
+0xFB40,0xFF85,0x0000, 0xFB41,0x863F,0x0000, 0xFB41,0x87BA,0x0000,
+0xFB41,0x88F8,0x0000, 0xFB41,0x908F,0x0000, 0xFB40,0xEA02,0x0000,
+0xFB40,0xED1B,0x0000, 0xFB40,0xF0D9,0x0000, 0xFB40,0xF3DE,0x0000,
+0xFB41,0x843D,0x0000, 0xFB41,0x916A,0x0000, 0xFB41,0x99F1,0x0000,
+0xFB40,0xCE82,0x0000, 0xFB40,0xD375,0x0000, 0xFB40,0xEB04,0x0000,
+0xFB40,0xF21B,0x0000, 0xFB41,0x862D,0x0000, 0xFB41,0x9E1E,0x0000,
+0xFB40,0xDD50,0x0000, 0xFB40,0xEFEB,0x0000, 0xFB41,0x85CD,0x0000,
+0xFB41,0x8964,0x0000, 0xFB40,0xE2C9,0x0000, 0xFB41,0x81D8,0x0000,
+0xFB41,0x881F,0x0000, 0xFB40,0xDECA,0x0000, 0xFB40,0xE717,0x0000,
+0xFB40,0xED6A,0x0000, 0xFB40,0xF2FC,0x0000, 0xFB41,0x90CE,0x0000,
+0xFB40,0xCF86,0x0000, 0xFB40,0xD1B7,0x0000, 0xFB40,0xD2DE,0x0000,
+0xFB40,0xE4C4,0x0000, 0xFB40,0xEAD3,0x0000, 0xFB40,0xF210,0x0000,
+0xFB40,0xF6E7,0x0000, 0xFB41,0x8001,0x0000, 0xFB41,0x8606,0x0000,
+0xFB41,0x865C,0x0000, 0xFB41,0x8DEF,0x0000, 0xFB41,0x9732,0x0000,
+0xFB41,0x9B6F,0x0000, 0xFB41,0x9DFA,0x0000, 0xFB40,0xF88C,0x0000,
+0xFB40,0xF97F,0x0000, 0xFB40,0xFDA0,0x0000, 0xFB41,0x83C9,0x0000,
+0xFB41,0x9304,0x0000, 0xFB41,0x9E7F,0x0000, 0xFB41,0x8AD6,0x0000,
+0xFB40,0xD8DF,0x0000, 0xFB40,0xDF04,0x0000, 0xFB40,0xFC60,0x0000,
+0xFB41,0x807E,0x0000, 0xFB40,0xF262,0x0000, 0xFB40,0xF8CA,0x0000,
+0xFB41,0x8CC2,0x0000, 0xFB41,0x96F7,0x0000, 0xFB40,0xD8D8,0x0000,
+0xFB40,0xDC62,0x0000, 0xFB40,0xEA13,0x0000, 0xFB40,0xEDDA,0x0000,
+0xFB40,0xEF0F,0x0000, 0xFB40,0xFD2F,0x0000, 0xFB40,0xFE37,0x0000,
+0xFB41,0x964B,0x0000, 0xFB40,0xD2D2,0x0000, 0xFB41,0x808B,0x0000,
+0xFB40,0xD1DC,0x0000, 0xFB40,0xD1CC,0x0000, 0xFB40,0xFA1C,0x0000,
+0xFB40,0xFDBE,0x0000, 0xFB41,0x83F1,0x0000, 0xFB41,0x9675,0x0000,
+0xFB41,0x8B80,0x0000, 0xFB40,0xE2CF,0x0000, 0xFB40,0xEA02,0x0000,
+0xFB41,0x8AFE,0x0000, 0xFB40,0xCE39,0x0000, 0xFB40,0xDBE7,0x0000,
+0xFB40,0xE012,0x0000, 0xFB40,0xF387,0x0000, 0xFB40,0xF570,0x0000,
+0xFB40,0xD317,0x0000, 0xFB40,0xF8FB,0x0000, 0xFB40,0xCFBF,0x0000,
+0xFB40,0xDFA9,0x0000, 0xFB40,0xCE0D,0x0000, 0xFB40,0xECCC,0x0000,
+0xFB40,0xE578,0x0000, 0xFB40,0xFD22,0x0000, 0xFB40,0xD3C3,0x0000,
+0xFB40,0xD85E,0x0000, 0xFB40,0xF701,0x0000, 0xFB41,0x8449,0x0000,
+0xFB41,0x8AAA,0x0000, 0xFB40,0xEBBA,0x0000, 0xFB41,0x8FB0,0x0000,
+0xFB40,0xEC88,0x0000, 0xFB40,0xE2FE,0x0000, 0xFB41,0x82E5,0x0000,
+0xFB40,0xE3A0,0x0000, 0xFB40,0xF565,0x0000, 0xFB40,0xCEAE,0x0000,
+0xFB40,0xD169,0x0000, 0xFB40,0xD1C9,0x0000, 0xFB40,0xE881,0x0000,
+0xFB40,0xFCE7,0x0000, 0xFB41,0x826F,0x0000, 0xFB41,0x8AD2,0x0000,
+0xFB41,0x91CF,0x0000, 0xFB40,0xD2F5,0x0000, 0xFB40,0xD442,0x0000,
+0xFB40,0xD973,0x0000, 0xFB40,0xDEEC,0x0000, 0xFB40,0xE5C5,0x0000,
+0xFB40,0xEFFE,0x0000, 0xFB40,0xF92A,0x0000, 0xFB41,0x95AD,0x0000,
+0xFB41,0x9A6A,0x0000, 0xFB41,0x9E97,0x0000, 0xFB41,0x9ECE,0x0000,
+0xFB40,0xD29B,0x0000, 0xFB40,0xE6C6,0x0000, 0xFB40,0xEB77,0x0000,
+0xFB41,0x8F62,0x0000, 0xFB40,0xDE74,0x0000, 0xFB40,0xE190,0x0000,
+0xFB40,0xE200,0x0000, 0xFB40,0xE49A,0x0000, 0xFB40,0xEF23,0x0000,
+0xFB40,0xF149,0x0000, 0xFB40,0xF489,0x0000, 0xFB40,0xF9CA,0x0000,
+0xFB40,0xFDF4,0x0000, 0xFB41,0x806F,0x0000, 0xFB41,0x8F26,0x0000,
+0xFB41,0x84EE,0x0000, 0xFB41,0x9023,0x0000, 0xFB41,0x934A,0x0000,
+0xFB40,0xD217,0x0000, 0xFB40,0xD2A3,0x0000, 0xFB40,0xD4BD,0x0000,
+0xFB40,0xF0C8,0x0000, 0xFB41,0x88C2,0x0000, 0xFB41,0x8AAA,0x0000,
+0xFB40,0xDEC9,0x0000, 0xFB40,0xDFF5,0x0000, 0xFB40,0xE37B,0x0000,
+0xFB40,0xEBAE,0x0000, 0xFB40,0xFC3E,0x0000, 0xFB40,0xF375,0x0000,
+0xFB40,0xCEE4,0x0000, 0xFB40,0xD6F9,0x0000, 0xFB40,0xDBE7,0x0000,
+0xFB40,0xDDBA,0x0000, 0xFB40,0xE01C,0x0000, 0xFB40,0xF3B2,0x0000,
+0xFB40,0xF469,0x0000, 0xFB40,0xFF9A,0x0000, 0xFB41,0x8046,0x0000,
+0xFB41,0x9234,0x0000, 0xFB41,0x96F6,0x0000, 0xFB41,0x9748,0x0000,
+0xFB41,0x9818,0x0000, 0xFB40,0xCF8B,0x0000, 0xFB40,0xF9AE,0x0000,
+0xFB41,0x91B4,0x0000, 0xFB41,0x96B8,0x0000, 0xFB40,0xE0E1,0x0000,
+0xFB40,0xCE86,0x0000, 0xFB40,0xD0DA,0x0000, 0xFB40,0xDBEE,0x0000,
+0xFB40,0xDC3F,0x0000, 0xFB40,0xE599,0x0000, 0xFB40,0xEA02,0x0000,
+0xFB40,0xF1CE,0x0000, 0xFB40,0xF642,0x0000, 0xFB41,0x84FC,0x0000,
+0xFB41,0x907C,0x0000, 0xFB41,0x9F8D,0x0000, 0xFB40,0xE688,0x0000,
+0xFB41,0x962E,0x0000, 0xFB40,0xD289,0x0000, 0xFB40,0xE77B,0x0000,
+0xFB40,0xE7F3,0x0000, 0xFB40,0xED41,0x0000, 0xFB40,0xEE9C,0x0000,
+0xFB40,0xF409,0x0000, 0xFB40,0xF559,0x0000, 0xFB40,0xF86B,0x0000,
+0xFB40,0xFD10,0x0000, 0xFB41,0x985E,0x0000, 0xFB40,0xD16D,0x0000,
+0xFB40,0xE22E,0x0000, 0xFB41,0x9678,0x0000, 0xFB40,0xD02B,0x0000,
+0xFB40,0xDD19,0x0000, 0xFB40,0xEDEA,0x0000, 0xFB41,0x8F2A,0x0000,
+0xFB40,0xDF8B,0x0000, 0xFB40,0xE144,0x0000, 0xFB40,0xE817,0x0000,
+0xFB40,0xF387,0x0000, 0xFB41,0x9686,0x0000, 0xFB40,0xD229,0x0000,
+0xFB40,0xD40F,0x0000, 0xFB40,0xDC65,0x0000, 0xFB40,0xE613,0x0000,
+0xFB40,0xE74E,0x0000, 0xFB40,0xE8A8,0x0000, 0xFB40,0xECE5,0x0000,
+0xFB40,0xF406,0x0000, 0xFB40,0xF5E2,0x0000, 0xFB40,0xFF79,0x0000,
+0xFB41,0x88CF,0x0000, 0xFB41,0x88E1,0x0000, 0xFB41,0x91CC,0x0000,
+0xFB41,0x96E2,0x0000, 0xFB40,0xD33F,0x0000, 0xFB40,0xEEBA,0x0000,
+0xFB40,0xD41D,0x0000, 0xFB40,0xF1D0,0x0000, 0xFB40,0xF498,0x0000,
+0xFB41,0x85FA,0x0000, 0xFB41,0x96A3,0x0000, 0xFB41,0x9C57,0x0000,
+0xFB41,0x9E9F,0x0000, 0xFB40,0xE797,0x0000, 0xFB40,0xEDCB,0x0000,
+0xFB41,0x81E8,0x0000, 0xFB40,0xFACB,0x0000, 0xFB40,0xFB20,0x0000,
+0xFB40,0xFC92,0x0000, 0xFB40,0xF2C0,0x0000, 0xFB40,0xF099,0x0000,
+0xFB41,0x8B58,0x0000, 0xFB40,0xCEC0,0x0000, 0xFB41,0x8336,0x0000,
+0xFB40,0xD23A,0x0000 };
+
+static uint16 page0FAdata[]= { /* FA00 (3 weights per char) */
+0xFB40,0xD207,0x0000, 0xFB40,0xDEA6,0x0000, 0xFB40,0xE2D3,0x0000,
+0xFB40,0xFCD6,0x0000, 0xFB40,0xDB85,0x0000, 0xFB40,0xED1E,0x0000,
+0xFB40,0xE6B4,0x0000, 0xFB41,0x8F3B,0x0000, 0xFB41,0x884C,0x0000,
+0xFB41,0x964D,0x0000, 0xFB41,0x898B,0x0000, 0xFB40,0xDED3,0x0000,
+0xFB40,0xD140,0x0000, 0xFB40,0xD5C0,0x0000, 0xFB41,0xFA0E,0x0000,
+0xFB41,0xFA0F,0x0000, 0xFB40,0xD85A,0x0000, 0xFB41,0xFA11,0x0000,
+0xFB40,0xE674,0x0000, 0xFB41,0xFA13,0x0000, 0xFB41,0xFA14,0x0000,
+0xFB40,0xD1DE,0x0000, 0xFB40,0xF32A,0x0000, 0xFB40,0xF6CA,0x0000,
+0xFB40,0xF93C,0x0000, 0xFB40,0xF95E,0x0000, 0xFB40,0xF965,0x0000,
+0xFB40,0xF98F,0x0000, 0xFB41,0x9756,0x0000, 0xFB40,0xFCBE,0x0000,
+0xFB40,0xFFBD,0x0000, 0xFB41,0xFA1F,0x0000, 0xFB41,0x8612,0x0000,
+0xFB41,0xFA21,0x0000, 0xFB41,0x8AF8,0x0000, 0xFB41,0xFA23,0x0000,
+0xFB41,0xFA24,0x0000, 0xFB41,0x9038,0x0000, 0xFB41,0x90FD,0x0000,
+0xFB41,0xFA27,0x0000, 0xFB41,0xFA28,0x0000, 0xFB41,0xFA29,0x0000,
+0xFB41,0x98EF,0x0000, 0xFB41,0x98FC,0x0000, 0xFB41,0x9928,0x0000,
+0xFB41,0x9DB4,0x0000, 0xFBC1,0xFA2E,0x0000, 0xFBC1,0xFA2F,0x0000,
+0xFB40,0xCFAE,0x0000, 0xFB40,0xD0E7,0x0000, 0xFB40,0xD14D,0x0000,
+0xFB40,0xD2C9,0x0000, 0xFB40,0xD2E4,0x0000, 0xFB40,0xD351,0x0000,
+0xFB40,0xD59D,0x0000, 0xFB40,0xD606,0x0000, 0xFB40,0xD668,0x0000,
+0xFB40,0xD840,0x0000, 0xFB40,0xD8A8,0x0000, 0xFB40,0xDC64,0x0000,
+0xFB40,0xDC6E,0x0000, 0xFB40,0xE094,0x0000, 0xFB40,0xE168,0x0000,
+0xFB40,0xE18E,0x0000, 0xFB40,0xE1F2,0x0000, 0xFB40,0xE54F,0x0000,
+0xFB40,0xE5E2,0x0000, 0xFB40,0xE691,0x0000, 0xFB40,0xE885,0x0000,
+0xFB40,0xED77,0x0000, 0xFB40,0xEE1A,0x0000, 0xFB40,0xEF22,0x0000,
+0xFB40,0xF16E,0x0000, 0xFB40,0xF22B,0x0000, 0xFB40,0xF422,0x0000,
+0xFB40,0xF891,0x0000, 0xFB40,0xF93E,0x0000, 0xFB40,0xF949,0x0000,
+0xFB40,0xF948,0x0000, 0xFB40,0xF950,0x0000, 0xFB40,0xF956,0x0000,
+0xFB40,0xF95D,0x0000, 0xFB40,0xF98D,0x0000, 0xFB40,0xF98E,0x0000,
+0xFB40,0xFA40,0x0000, 0xFB40,0xFA81,0x0000, 0xFB40,0xFBC0,0x0000,
+0xFB40,0xFDF4,0x0000, 0xFB40,0xFE09,0x0000, 0xFB40,0xFE41,0x0000,
+0xFB40,0xFF72,0x0000, 0xFB41,0x8005,0x0000, 0xFB41,0x81ED,0x0000,
+0xFB41,0x8279,0x0000, 0xFB41,0x8279,0x0000, 0xFB41,0x8457,0x0000,
+0xFB41,0x8910,0x0000, 0xFB41,0x8996,0x0000, 0xFB41,0x8B01,0x0000,
+0xFB41,0x8B39,0x0000, 0xFB41,0x8CD3,0x0000, 0xFB41,0x8D08,0x0000,
+0xFB41,0x8FB6,0x0000, 0xFB41,0x9038,0x0000, 0xFB41,0x96E3,0x0000,
+0xFB41,0x97FF,0x0000, 0xFB41,0x983B,0x0000, 0xFBC1,0xFA6B,0x0000,
+0xFBC1,0xFA6C,0x0000, 0xFBC1,0xFA6D,0x0000, 0xFBC1,0xFA6E,0x0000,
+0xFBC1,0xFA6F,0x0000, 0xFBC1,0xFA70,0x0000, 0xFBC1,0xFA71,0x0000,
+0xFBC1,0xFA72,0x0000, 0xFBC1,0xFA73,0x0000, 0xFBC1,0xFA74,0x0000,
+0xFBC1,0xFA75,0x0000, 0xFBC1,0xFA76,0x0000, 0xFBC1,0xFA77,0x0000,
+0xFBC1,0xFA78,0x0000, 0xFBC1,0xFA79,0x0000, 0xFBC1,0xFA7A,0x0000,
+0xFBC1,0xFA7B,0x0000, 0xFBC1,0xFA7C,0x0000, 0xFBC1,0xFA7D,0x0000,
+0xFBC1,0xFA7E,0x0000, 0xFBC1,0xFA7F,0x0000, 0xFBC1,0xFA80,0x0000,
+0xFBC1,0xFA81,0x0000, 0xFBC1,0xFA82,0x0000, 0xFBC1,0xFA83,0x0000,
+0xFBC1,0xFA84,0x0000, 0xFBC1,0xFA85,0x0000, 0xFBC1,0xFA86,0x0000,
+0xFBC1,0xFA87,0x0000, 0xFBC1,0xFA88,0x0000, 0xFBC1,0xFA89,0x0000,
+0xFBC1,0xFA8A,0x0000, 0xFBC1,0xFA8B,0x0000, 0xFBC1,0xFA8C,0x0000,
+0xFBC1,0xFA8D,0x0000, 0xFBC1,0xFA8E,0x0000, 0xFBC1,0xFA8F,0x0000,
+0xFBC1,0xFA90,0x0000, 0xFBC1,0xFA91,0x0000, 0xFBC1,0xFA92,0x0000,
+0xFBC1,0xFA93,0x0000, 0xFBC1,0xFA94,0x0000, 0xFBC1,0xFA95,0x0000,
+0xFBC1,0xFA96,0x0000, 0xFBC1,0xFA97,0x0000, 0xFBC1,0xFA98,0x0000,
+0xFBC1,0xFA99,0x0000, 0xFBC1,0xFA9A,0x0000, 0xFBC1,0xFA9B,0x0000,
+0xFBC1,0xFA9C,0x0000, 0xFBC1,0xFA9D,0x0000, 0xFBC1,0xFA9E,0x0000,
+0xFBC1,0xFA9F,0x0000, 0xFBC1,0xFAA0,0x0000, 0xFBC1,0xFAA1,0x0000,
+0xFBC1,0xFAA2,0x0000, 0xFBC1,0xFAA3,0x0000, 0xFBC1,0xFAA4,0x0000,
+0xFBC1,0xFAA5,0x0000, 0xFBC1,0xFAA6,0x0000, 0xFBC1,0xFAA7,0x0000,
+0xFBC1,0xFAA8,0x0000, 0xFBC1,0xFAA9,0x0000, 0xFBC1,0xFAAA,0x0000,
+0xFBC1,0xFAAB,0x0000, 0xFBC1,0xFAAC,0x0000, 0xFBC1,0xFAAD,0x0000,
+0xFBC1,0xFAAE,0x0000, 0xFBC1,0xFAAF,0x0000, 0xFBC1,0xFAB0,0x0000,
+0xFBC1,0xFAB1,0x0000, 0xFBC1,0xFAB2,0x0000, 0xFBC1,0xFAB3,0x0000,
+0xFBC1,0xFAB4,0x0000, 0xFBC1,0xFAB5,0x0000, 0xFBC1,0xFAB6,0x0000,
+0xFBC1,0xFAB7,0x0000, 0xFBC1,0xFAB8,0x0000, 0xFBC1,0xFAB9,0x0000,
+0xFBC1,0xFABA,0x0000, 0xFBC1,0xFABB,0x0000, 0xFBC1,0xFABC,0x0000,
+0xFBC1,0xFABD,0x0000, 0xFBC1,0xFABE,0x0000, 0xFBC1,0xFABF,0x0000,
+0xFBC1,0xFAC0,0x0000, 0xFBC1,0xFAC1,0x0000, 0xFBC1,0xFAC2,0x0000,
+0xFBC1,0xFAC3,0x0000, 0xFBC1,0xFAC4,0x0000, 0xFBC1,0xFAC5,0x0000,
+0xFBC1,0xFAC6,0x0000, 0xFBC1,0xFAC7,0x0000, 0xFBC1,0xFAC8,0x0000,
+0xFBC1,0xFAC9,0x0000, 0xFBC1,0xFACA,0x0000, 0xFBC1,0xFACB,0x0000,
+0xFBC1,0xFACC,0x0000, 0xFBC1,0xFACD,0x0000, 0xFBC1,0xFACE,0x0000,
+0xFBC1,0xFACF,0x0000, 0xFBC1,0xFAD0,0x0000, 0xFBC1,0xFAD1,0x0000,
+0xFBC1,0xFAD2,0x0000, 0xFBC1,0xFAD3,0x0000, 0xFBC1,0xFAD4,0x0000,
+0xFBC1,0xFAD5,0x0000, 0xFBC1,0xFAD6,0x0000, 0xFBC1,0xFAD7,0x0000,
+0xFBC1,0xFAD8,0x0000, 0xFBC1,0xFAD9,0x0000, 0xFBC1,0xFADA,0x0000,
+0xFBC1,0xFADB,0x0000, 0xFBC1,0xFADC,0x0000, 0xFBC1,0xFADD,0x0000,
+0xFBC1,0xFADE,0x0000, 0xFBC1,0xFADF,0x0000, 0xFBC1,0xFAE0,0x0000,
+0xFBC1,0xFAE1,0x0000, 0xFBC1,0xFAE2,0x0000, 0xFBC1,0xFAE3,0x0000,
+0xFBC1,0xFAE4,0x0000, 0xFBC1,0xFAE5,0x0000, 0xFBC1,0xFAE6,0x0000,
+0xFBC1,0xFAE7,0x0000, 0xFBC1,0xFAE8,0x0000, 0xFBC1,0xFAE9,0x0000,
+0xFBC1,0xFAEA,0x0000, 0xFBC1,0xFAEB,0x0000, 0xFBC1,0xFAEC,0x0000,
+0xFBC1,0xFAED,0x0000, 0xFBC1,0xFAEE,0x0000, 0xFBC1,0xFAEF,0x0000,
+0xFBC1,0xFAF0,0x0000, 0xFBC1,0xFAF1,0x0000, 0xFBC1,0xFAF2,0x0000,
+0xFBC1,0xFAF3,0x0000, 0xFBC1,0xFAF4,0x0000, 0xFBC1,0xFAF5,0x0000,
+0xFBC1,0xFAF6,0x0000, 0xFBC1,0xFAF7,0x0000, 0xFBC1,0xFAF8,0x0000,
+0xFBC1,0xFAF9,0x0000, 0xFBC1,0xFAFA,0x0000, 0xFBC1,0xFAFB,0x0000,
+0xFBC1,0xFAFC,0x0000, 0xFBC1,0xFAFD,0x0000, 0xFBC1,0xFAFE,0x0000,
+0xFBC1,0xFAFF,0x0000 };
+
+static uint16 page0FBdata[]= { /* FB00 (4 weights per char) */
+0x0EB9,0x0EB9,0x0000,0x0000, 0x0EB9,0x0EFB,0x0000,0x0000,
+0x0EB9,0x0F2E,0x0000,0x0000, 0x0EB9,0x0EB9,0x0EFB,0x0000,
+0x0EB9,0x0EB9,0x0F2E,0x0000, 0x0FEA,0x1002,0x0000,0x0000,
+0x0FEA,0x1002,0x0000,0x0000, 0xFBC1,0xFB07,0x0000,0x0000,
+0xFBC1,0xFB08,0x0000,0x0000, 0xFBC1,0xFB09,0x0000,0x0000,
+0xFBC1,0xFB0A,0x0000,0x0000, 0xFBC1,0xFB0B,0x0000,0x0000,
+0xFBC1,0xFB0C,0x0000,0x0000, 0xFBC1,0xFB0D,0x0000,0x0000,
+0xFBC1,0xFB0E,0x0000,0x0000, 0xFBC1,0xFB0F,0x0000,0x0000,
+0xFBC1,0xFB10,0x0000,0x0000, 0xFBC1,0xFB11,0x0000,0x0000,
+0xFBC1,0xFB12,0x0000,0x0000, 0x131D,0x131F,0x0000,0x0000,
+0x131D,0x130E,0x0000,0x0000, 0x131D,0x1314,0x0000,0x0000,
+0x1327,0x131F,0x0000,0x0000, 0x131D,0x1316,0x0000,0x0000,
+0xFBC1,0xFB18,0x0000,0x0000, 0xFBC1,0xFB19,0x0000,0x0000,
+0xFBC1,0xFB1A,0x0000,0x0000, 0xFBC1,0xFB1B,0x0000,0x0000,
+0xFBC1,0xFB1C,0x0000,0x0000, 0x133A,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x133A,0x133A,0x0000,0x0000,
+0x1340,0x0000,0x0000,0x0000, 0x1331,0x0000,0x0000,0x0000,
+0x1334,0x0000,0x0000,0x0000, 0x1335,0x0000,0x0000,0x0000,
+0x133B,0x0000,0x0000,0x0000, 0x133C,0x0000,0x0000,0x0000,
+0x133D,0x0000,0x0000,0x0000, 0x1344,0x0000,0x0000,0x0000,
+0x1346,0x0000,0x0000,0x0000, 0x0428,0x0000,0x0000,0x0000,
+0x1345,0x0000,0x0000,0x0000, 0x1345,0x0000,0x0000,0x0000,
+0x1345,0x0000,0x0000,0x0000, 0x1345,0x0000,0x0000,0x0000,
+0x1331,0x0000,0x0000,0x0000, 0x1331,0x0000,0x0000,0x0000,
+0x1331,0x0000,0x0000,0x0000, 0x1332,0x0000,0x0000,0x0000,
+0x1333,0x0000,0x0000,0x0000, 0x1334,0x0000,0x0000,0x0000,
+0x1335,0x0000,0x0000,0x0000, 0x1336,0x0000,0x0000,0x0000,
+0x1337,0x0000,0x0000,0x0000, 0xFBC1,0xFB37,0x0000,0x0000,
+0x1339,0x0000,0x0000,0x0000, 0x133A,0x0000,0x0000,0x0000,
+0x133B,0x0000,0x0000,0x0000, 0x133B,0x0000,0x0000,0x0000,
+0x133C,0x0000,0x0000,0x0000, 0xFBC1,0xFB3D,0x0000,0x0000,
+0x133D,0x0000,0x0000,0x0000, 0xFBC1,0xFB3F,0x0000,0x0000,
+0x133E,0x0000,0x0000,0x0000, 0x133F,0x0000,0x0000,0x0000,
+0xFBC1,0xFB42,0x0000,0x0000, 0x1341,0x0000,0x0000,0x0000,
+0x1341,0x0000,0x0000,0x0000, 0xFBC1,0xFB45,0x0000,0x0000,
+0x1342,0x0000,0x0000,0x0000, 0x1343,0x0000,0x0000,0x0000,
+0x1344,0x0000,0x0000,0x0000, 0x1345,0x0000,0x0000,0x0000,
+0x1346,0x0000,0x0000,0x0000, 0x1336,0x0000,0x0000,0x0000,
+0x1332,0x0000,0x0000,0x0000, 0x133B,0x0000,0x0000,0x0000,
+0x1341,0x0000,0x0000,0x0000, 0x1331,0x133C,0x0000,0x0000,
+0x134B,0x0000,0x0000,0x0000, 0x134B,0x0000,0x0000,0x0000,
+0x1353,0x0000,0x0000,0x0000, 0x1353,0x0000,0x0000,0x0000,
+0x1353,0x0000,0x0000,0x0000, 0x1353,0x0000,0x0000,0x0000,
+0x1354,0x0000,0x0000,0x0000, 0x1354,0x0000,0x0000,0x0000,
+0x1354,0x0000,0x0000,0x0000, 0x1354,0x0000,0x0000,0x0000,
+0x1355,0x0000,0x0000,0x0000, 0x1355,0x0000,0x0000,0x0000,
+0x1355,0x0000,0x0000,0x0000, 0x1355,0x0000,0x0000,0x0000,
+0x135A,0x0000,0x0000,0x0000, 0x135A,0x0000,0x0000,0x0000,
+0x135A,0x0000,0x0000,0x0000, 0x135A,0x0000,0x0000,0x0000,
+0x135D,0x0000,0x0000,0x0000, 0x135D,0x0000,0x0000,0x0000,
+0x135D,0x0000,0x0000,0x0000, 0x135D,0x0000,0x0000,0x0000,
+0x1359,0x0000,0x0000,0x0000, 0x1359,0x0000,0x0000,0x0000,
+0x1359,0x0000,0x0000,0x0000, 0x1359,0x0000,0x0000,0x0000,
+0x1397,0x0000,0x0000,0x0000, 0x1397,0x0000,0x0000,0x0000,
+0x1397,0x0000,0x0000,0x0000, 0x1397,0x0000,0x0000,0x0000,
+0x1399,0x0000,0x0000,0x0000, 0x1399,0x0000,0x0000,0x0000,
+0x1399,0x0000,0x0000,0x0000, 0x1399,0x0000,0x0000,0x0000,
+0x1360,0x0000,0x0000,0x0000, 0x1360,0x0000,0x0000,0x0000,
+0x1360,0x0000,0x0000,0x0000, 0x1360,0x0000,0x0000,0x0000,
+0x135F,0x0000,0x0000,0x0000, 0x135F,0x0000,0x0000,0x0000,
+0x135F,0x0000,0x0000,0x0000, 0x135F,0x0000,0x0000,0x0000,
+0x1361,0x0000,0x0000,0x0000, 0x1361,0x0000,0x0000,0x0000,
+0x1361,0x0000,0x0000,0x0000, 0x1361,0x0000,0x0000,0x0000,
+0x1363,0x0000,0x0000,0x0000, 0x1363,0x0000,0x0000,0x0000,
+0x1363,0x0000,0x0000,0x0000, 0x1363,0x0000,0x0000,0x0000,
+0x1370,0x0000,0x0000,0x0000, 0x1370,0x0000,0x0000,0x0000,
+0x136F,0x0000,0x0000,0x0000, 0x136F,0x0000,0x0000,0x0000,
+0x1371,0x0000,0x0000,0x0000, 0x1371,0x0000,0x0000,0x0000,
+0x136B,0x0000,0x0000,0x0000, 0x136B,0x0000,0x0000,0x0000,
+0x137E,0x0000,0x0000,0x0000, 0x137E,0x0000,0x0000,0x0000,
+0x1377,0x0000,0x0000,0x0000, 0x1377,0x0000,0x0000,0x0000,
+0x139F,0x0000,0x0000,0x0000, 0x139F,0x0000,0x0000,0x0000,
+0x139F,0x0000,0x0000,0x0000, 0x139F,0x0000,0x0000,0x0000,
+0x13A5,0x0000,0x0000,0x0000, 0x13A5,0x0000,0x0000,0x0000,
+0x13A5,0x0000,0x0000,0x0000, 0x13A5,0x0000,0x0000,0x0000,
+0x13A9,0x0000,0x0000,0x0000, 0x13A9,0x0000,0x0000,0x0000,
+0x13A9,0x0000,0x0000,0x0000, 0x13A9,0x0000,0x0000,0x0000,
+0x13A7,0x0000,0x0000,0x0000, 0x13A7,0x0000,0x0000,0x0000,
+0x13A7,0x0000,0x0000,0x0000, 0x13A7,0x0000,0x0000,0x0000,
+0x13B2,0x0000,0x0000,0x0000, 0x13B2,0x0000,0x0000,0x0000,
+0x13B3,0x0000,0x0000,0x0000, 0x13B3,0x0000,0x0000,0x0000,
+0x13B3,0x0000,0x0000,0x0000, 0x13B3,0x0000,0x0000,0x0000,
+0x13BC,0x0000,0x0000,0x0000, 0x13BC,0x0000,0x0000,0x0000,
+0x13B9,0x0000,0x0000,0x0000, 0x13B9,0x0000,0x0000,0x0000,
+0x13B9,0x0000,0x0000,0x0000, 0x13B9,0x0000,0x0000,0x0000,
+0x13B8,0x0000,0x0000,0x0000, 0x13B8,0x0000,0x0000,0x0000,
+0x13B8,0x0000,0x0000,0x0000, 0x13B8,0x0000,0x0000,0x0000,
+0x13CE,0x0000,0x0000,0x0000, 0x13CE,0x0000,0x0000,0x0000,
+0x13CE,0x0000,0x0000,0x0000, 0x13CE,0x0000,0x0000,0x0000,
+0xFBC1,0xFBB2,0x0000,0x0000, 0xFBC1,0xFBB3,0x0000,0x0000,
+0xFBC1,0xFBB4,0x0000,0x0000, 0xFBC1,0xFBB5,0x0000,0x0000,
+0xFBC1,0xFBB6,0x0000,0x0000, 0xFBC1,0xFBB7,0x0000,0x0000,
+0xFBC1,0xFBB8,0x0000,0x0000, 0xFBC1,0xFBB9,0x0000,0x0000,
+0xFBC1,0xFBBA,0x0000,0x0000, 0xFBC1,0xFBBB,0x0000,0x0000,
+0xFBC1,0xFBBC,0x0000,0x0000, 0xFBC1,0xFBBD,0x0000,0x0000,
+0xFBC1,0xFBBE,0x0000,0x0000, 0xFBC1,0xFBBF,0x0000,0x0000,
+0xFBC1,0xFBC0,0x0000,0x0000, 0xFBC1,0xFBC1,0x0000,0x0000,
+0xFBC1,0xFBC2,0x0000,0x0000, 0xFBC1,0xFBC3,0x0000,0x0000,
+0xFBC1,0xFBC4,0x0000,0x0000, 0xFBC1,0xFBC5,0x0000,0x0000,
+0xFBC1,0xFBC6,0x0000,0x0000, 0xFBC1,0xFBC7,0x0000,0x0000,
+0xFBC1,0xFBC8,0x0000,0x0000, 0xFBC1,0xFBC9,0x0000,0x0000,
+0xFBC1,0xFBCA,0x0000,0x0000, 0xFBC1,0xFBCB,0x0000,0x0000,
+0xFBC1,0xFBCC,0x0000,0x0000, 0xFBC1,0xFBCD,0x0000,0x0000,
+0xFBC1,0xFBCE,0x0000,0x0000, 0xFBC1,0xFBCF,0x0000,0x0000,
+0xFBC1,0xFBD0,0x0000,0x0000, 0xFBC1,0xFBD1,0x0000,0x0000,
+0xFBC1,0xFBD2,0x0000,0x0000, 0x13A3,0x0000,0x0000,0x0000,
+0x13A3,0x0000,0x0000,0x0000, 0x13A3,0x0000,0x0000,0x0000,
+0x13A3,0x0000,0x0000,0x0000, 0x13C1,0x0000,0x0000,0x0000,
+0x13C1,0x0000,0x0000,0x0000, 0x13C0,0x0000,0x0000,0x0000,
+0x13C0,0x0000,0x0000,0x0000, 0x13C2,0x0000,0x0000,0x0000,
+0x13C2,0x0000,0x0000,0x0000, 0x13C1,0x1347,0x0000,0x0000,
+0x13C5,0x0000,0x0000,0x0000, 0x13C5,0x0000,0x0000,0x0000,
+0x13BF,0x0000,0x0000,0x0000, 0x13BF,0x0000,0x0000,0x0000,
+0x13C3,0x0000,0x0000,0x0000, 0x13C3,0x0000,0x0000,0x0000,
+0x13CC,0x0000,0x0000,0x0000, 0x13CC,0x0000,0x0000,0x0000,
+0x13CC,0x0000,0x0000,0x0000, 0x13CC,0x0000,0x0000,0x0000,
+0x13C7,0x0000,0x0000,0x0000, 0x13C7,0x0000,0x0000,0x0000,
+0x134F,0x1350,0x0000,0x0000, 0x134F,0x1350,0x0000,0x0000,
+0x134F,0x13BC,0x0000,0x0000, 0x134F,0x13BC,0x0000,0x0000,
+0x134F,0x13BD,0x0000,0x0000, 0x134F,0x13BD,0x0000,0x0000,
+0x134F,0x13C1,0x0000,0x0000, 0x134F,0x13C1,0x0000,0x0000,
+0x134F,0x13C0,0x0000,0x0000, 0x134F,0x13C0,0x0000,0x0000,
+0x134F,0x13C2,0x0000,0x0000, 0x134F,0x13C2,0x0000,0x0000,
+0x134F,0x13CC,0x0000,0x0000, 0x134F,0x13CC,0x0000,0x0000,
+0x134F,0x13CC,0x0000,0x0000, 0x134F,0x13C7,0x0000,0x0000,
+0x134F,0x13C7,0x0000,0x0000, 0x134F,0x13C7,0x0000,0x0000,
+0x13C9,0x0000,0x0000,0x0000, 0x13C9,0x0000,0x0000,0x0000,
+0x13C9,0x0000,0x0000,0x0000, 0x13C9,0x0000,0x0000,0x0000
+};
+
+static uint16 page0FCdata[]= { /* FC00 (3 weights per char) */
+0x134F,0x135E,0x0000, 0x134F,0x1364,0x0000, 0x134F,0x13B0,0x0000,
+0x134F,0x13C7,0x0000, 0x134F,0x13C8,0x0000, 0x1352,0x135E,0x0000,
+0x1352,0x1364,0x0000, 0x1352,0x1365,0x0000, 0x1352,0x13B0,0x0000,
+0x1352,0x13C7,0x0000, 0x1352,0x13C8,0x0000, 0x1357,0x135E,0x0000,
+0x1357,0x1364,0x0000, 0x1357,0x1365,0x0000, 0x1357,0x13B0,0x0000,
+0x1357,0x13C7,0x0000, 0x1357,0x13C8,0x0000, 0x1358,0x135E,0x0000,
+0x1358,0x13B0,0x0000, 0x1358,0x13C7,0x0000, 0x1358,0x13C8,0x0000,
+0x135E,0x1364,0x0000, 0x135E,0x13B0,0x0000, 0x1364,0x135E,0x0000,
+0x1364,0x13B0,0x0000, 0x1365,0x135E,0x0000, 0x1365,0x1364,0x0000,
+0x1365,0x13B0,0x0000, 0x1381,0x135E,0x0000, 0x1381,0x1364,0x0000,
+0x1381,0x1365,0x0000, 0x1381,0x13B0,0x0000, 0x1387,0x1364,0x0000,
+0x1387,0x13B0,0x0000, 0x1388,0x135E,0x0000, 0x1388,0x1364,0x0000,
+0x1388,0x1365,0x0000, 0x1388,0x13B0,0x0000, 0x138C,0x1364,0x0000,
+0x138C,0x13B0,0x0000, 0x138D,0x13B0,0x0000, 0x138F,0x135E,0x0000,
+0x138F,0x13B0,0x0000, 0x1390,0x135E,0x0000, 0x1390,0x13B0,0x0000,
+0x1393,0x135E,0x0000, 0x1393,0x1364,0x0000, 0x1393,0x1365,0x0000,
+0x1393,0x13B0,0x0000, 0x1393,0x13C7,0x0000, 0x1393,0x13C8,0x0000,
+0x139B,0x1364,0x0000, 0x139B,0x13B0,0x0000, 0x139B,0x13C7,0x0000,
+0x139B,0x13C8,0x0000, 0x139E,0x1350,0x0000, 0x139E,0x135E,0x0000,
+0x139E,0x1364,0x0000, 0x139E,0x1365,0x0000, 0x139E,0x13AB,0x0000,
+0x139E,0x13B0,0x0000, 0x139E,0x13C7,0x0000, 0x139E,0x13C8,0x0000,
+0x13AB,0x135E,0x0000, 0x13AB,0x1364,0x0000, 0x13AB,0x1365,0x0000,
+0x13AB,0x13B0,0x0000, 0x13AB,0x13C7,0x0000, 0x13AB,0x13C8,0x0000,
+0x13B0,0x135E,0x0000, 0x13B0,0x1364,0x0000, 0x13B0,0x1365,0x0000,
+0x13B0,0x13B0,0x0000, 0x13B0,0x13C7,0x0000, 0x13B0,0x13C8,0x0000,
+0x13B1,0x135E,0x0000, 0x13B1,0x1364,0x0000, 0x13B1,0x1365,0x0000,
+0x13B1,0x13B0,0x0000, 0x13B1,0x13C7,0x0000, 0x13B1,0x13C8,0x0000,
+0x13B7,0x135E,0x0000, 0x13B7,0x13B0,0x0000, 0x13B7,0x13C7,0x0000,
+0x13B7,0x13C8,0x0000, 0x13C8,0x135E,0x0000, 0x13C8,0x1364,0x0000,
+0x13C8,0x1365,0x0000, 0x13C8,0x13B0,0x0000, 0x13C8,0x13C7,0x0000,
+0x13C8,0x13C8,0x0000, 0x136A,0x0000,0x0000, 0x1375,0x0000,0x0000,
+0x13C7,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x134F,0x1375,0x0000, 0x134F,0x1376,0x0000,
+0x134F,0x13B0,0x0000, 0x134F,0x13B1,0x0000, 0x134F,0x13C7,0x0000,
+0x134F,0x13C8,0x0000, 0x1352,0x1375,0x0000, 0x1352,0x1376,0x0000,
+0x1352,0x13B0,0x0000, 0x1352,0x13B1,0x0000, 0x1352,0x13C7,0x0000,
+0x1352,0x13C8,0x0000, 0x1357,0x1375,0x0000, 0x1357,0x1376,0x0000,
+0x1357,0x13B0,0x0000, 0x1357,0x13B1,0x0000, 0x1357,0x13C7,0x0000,
+0x1357,0x13C8,0x0000, 0x1358,0x1375,0x0000, 0x1358,0x1376,0x0000,
+0x1358,0x13B0,0x0000, 0x1358,0x13B1,0x0000, 0x1358,0x13C7,0x0000,
+0x1358,0x13C8,0x0000, 0x1393,0x13C7,0x0000, 0x1393,0x13C8,0x0000,
+0x139B,0x13C7,0x0000, 0x139B,0x13C8,0x0000, 0x139E,0x1350,0x0000,
+0x139E,0x13AB,0x0000, 0x139E,0x13B0,0x0000, 0x139E,0x13C7,0x0000,
+0x139E,0x13C8,0x0000, 0x13AB,0x13B0,0x0000, 0x13AB,0x13C7,0x0000,
+0x13AB,0x13C8,0x0000, 0x13B0,0x1350,0x0000, 0x13B0,0x13B0,0x0000,
+0x13B1,0x1375,0x0000, 0x13B1,0x1376,0x0000, 0x13B1,0x13B0,0x0000,
+0x13B1,0x13B1,0x0000, 0x13B1,0x13C7,0x0000, 0x13B1,0x13C8,0x0000,
+0x13C7,0x0000,0x0000, 0x13C8,0x1375,0x0000, 0x13C8,0x1376,0x0000,
+0x13C8,0x13B0,0x0000, 0x13C8,0x13B1,0x0000, 0x13C8,0x13C7,0x0000,
+0x13C8,0x13C8,0x0000, 0x134F,0x135E,0x0000, 0x134F,0x1364,0x0000,
+0x134F,0x1365,0x0000, 0x134F,0x13B0,0x0000, 0x134F,0x13B7,0x0000,
+0x1352,0x135E,0x0000, 0x1352,0x1364,0x0000, 0x1352,0x1365,0x0000,
+0x1352,0x13B0,0x0000, 0x1352,0x13B7,0x0000, 0x1357,0x135E,0x0000,
+0x1357,0x1364,0x0000, 0x1357,0x1365,0x0000, 0x1357,0x13B0,0x0000,
+0x1357,0x13B7,0x0000, 0x1358,0x13B0,0x0000, 0x135E,0x1364,0x0000,
+0x135E,0x13B0,0x0000, 0x1364,0x135E,0x0000, 0x1364,0x13B0,0x0000,
+0x1365,0x135E,0x0000, 0x1365,0x13B0,0x0000, 0x1381,0x135E,0x0000,
+0x1381,0x1364,0x0000, 0x1381,0x1365,0x0000, 0x1381,0x13B0,0x0000,
+0x1387,0x1364,0x0000, 0x1387,0x1365,0x0000, 0x1387,0x13B0,0x0000,
+0x1388,0x135E,0x0000, 0x1388,0x1364,0x0000, 0x1388,0x1365,0x0000,
+0x1388,0x13B0,0x0000, 0x138C,0x1364,0x0000, 0x138D,0x13B0,0x0000,
+0x138F,0x135E,0x0000, 0x138F,0x13B0,0x0000, 0x1390,0x135E,0x0000,
+0x1390,0x13B0,0x0000, 0x1393,0x135E,0x0000, 0x1393,0x1364,0x0000,
+0x1393,0x1365,0x0000, 0x1393,0x13B0,0x0000, 0x139B,0x1364,0x0000,
+0x139B,0x13B0,0x0000, 0x139E,0x135E,0x0000, 0x139E,0x1364,0x0000,
+0x139E,0x1365,0x0000, 0x139E,0x13AB,0x0000, 0x139E,0x13B0,0x0000,
+0x13AB,0x135E,0x0000, 0x13AB,0x1364,0x0000, 0x13AB,0x1365,0x0000,
+0x13AB,0x13B0,0x0000, 0x13AB,0x13B7,0x0000, 0x13B0,0x135E,0x0000,
+0x13B0,0x1364,0x0000, 0x13B0,0x1365,0x0000, 0x13B0,0x13B0,0x0000,
+0x13B1,0x135E,0x0000, 0x13B1,0x1364,0x0000, 0x13B1,0x1365,0x0000,
+0x13B1,0x13B0,0x0000, 0x13B1,0x13B7,0x0000, 0x13B7,0x135E,0x0000,
+0x13B7,0x13B0,0x0000, 0x13B7,0x0000,0x0000, 0x13C8,0x135E,0x0000,
+0x13C8,0x1364,0x0000, 0x13C8,0x1365,0x0000, 0x13C8,0x13B0,0x0000,
+0x13C8,0x13B7,0x0000, 0x134F,0x13B0,0x0000, 0x134F,0x13B7,0x0000,
+0x1352,0x13B0,0x0000, 0x1352,0x13B7,0x0000, 0x1357,0x13B0,0x0000,
+0x1357,0x13B7,0x0000, 0x1358,0x13B0,0x0000, 0x1358,0x13B7,0x0000,
+0x1381,0x13B0,0x0000, 0x1381,0x13B7,0x0000, 0x1382,0x13B0,0x0000,
+0x1382,0x13B7,0x0000, 0x139E,0x13AB,0x0000, 0x139E,0x13B0,0x0000,
+0x13AB,0x13B0,0x0000, 0x13B1,0x13B0,0x0000, 0x13B1,0x13B7,0x0000,
+0x13C8,0x13B0,0x0000, 0x13C8,0x13B7,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x138C,0x13C7,0x0000,
+0x138C,0x13C8,0x0000, 0x138F,0x13C7,0x0000, 0x138F,0x13C8,0x0000,
+0x1390,0x13C7,0x0000, 0x1390,0x13C8,0x0000, 0x1381,0x13C7,0x0000,
+0x1381,0x13C8,0x0000, 0x1382,0x13C7,0x0000, 0x1382,0x13C8,0x0000,
+0x1364,0x13C7,0x0000 };
+
+static uint16 page0FDdata[]= { /* FD00 (9 weights per char) */
+0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1365,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1390,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1390,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1365,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13B7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138D,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1350,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1350,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x02C0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x02C1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD40,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD41,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD42,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD43,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD44,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD45,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD46,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD47,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD48,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD49,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD4B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD4C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD4D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD4E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD4F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x1364,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x1364,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x13B0,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x13B0,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1364,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1364,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1364,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x135E,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13B0,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x1364,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x1364,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1390,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1390,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1390,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1393,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1393,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139B,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139B,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x135E,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x135E,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1364,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x135E,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1365,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD90,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD91,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x135E,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B7,0x13B0,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B7,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13C8,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13C8,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1352,0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x1365,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1365,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13C8,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13C8,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13C8,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139B,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139B,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139E,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x135E,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139E,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x135E,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1364,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1393,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1352,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139E,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDC8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDC9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDCA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDCB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDCC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDCD,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDCE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDCF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDDA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDDB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDDC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDDD,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDDE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDDF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDEB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDEC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDED,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDEE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDEF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13AB,0x13CE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139B,0x13AB,0x13CE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1350,0x13AB,0x13AB,0x13B7,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1350,0x139E,0x1352,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1364,0x13B0,0x1369,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13AB,0x138F,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1375,0x1381,0x13BD,0x13AB,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13AB,0x13C8,0x13B7,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13BD,0x1381,0x13AB,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13AB,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDFA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13AB,0x0209,0x135E,0x13AB,0x1350,0x13AB,0x13B7,0x0000,
+0x1375,0x13C9,0x1350,0x13AB,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x034F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDFE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDFF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+static uint16 page0FEdata[]= { /* FE00 (3 weights per char) */
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC1,0xFE10,0x0000, 0xFBC1,0xFE11,0x0000,
+0xFBC1,0xFE12,0x0000, 0xFBC1,0xFE13,0x0000, 0xFBC1,0xFE14,0x0000,
+0xFBC1,0xFE15,0x0000, 0xFBC1,0xFE16,0x0000, 0xFBC1,0xFE17,0x0000,
+0xFBC1,0xFE18,0x0000, 0xFBC1,0xFE19,0x0000, 0xFBC1,0xFE1A,0x0000,
+0xFBC1,0xFE1B,0x0000, 0xFBC1,0xFE1C,0x0000, 0xFBC1,0xFE1D,0x0000,
+0xFBC1,0xFE1E,0x0000, 0xFBC1,0xFE1F,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC1,0xFE24,0x0000, 0xFBC1,0xFE25,0x0000, 0xFBC1,0xFE26,0x0000,
+0xFBC1,0xFE27,0x0000, 0xFBC1,0xFE28,0x0000, 0xFBC1,0xFE29,0x0000,
+0xFBC1,0xFE2A,0x0000, 0xFBC1,0xFE2B,0x0000, 0xFBC1,0xFE2C,0x0000,
+0xFBC1,0xFE2D,0x0000, 0xFBC1,0xFE2E,0x0000, 0xFBC1,0xFE2F,0x0000,
+0x025D,0x025D,0x0000, 0x0228,0x0000,0x0000, 0x0227,0x0000,0x0000,
+0x021B,0x0000,0x0000, 0x021B,0x0000,0x0000, 0x0288,0x0000,0x0000,
+0x0289,0x0000,0x0000, 0x028C,0x0000,0x0000, 0x028D,0x0000,0x0000,
+0x02B8,0x0000,0x0000, 0x02B9,0x0000,0x0000, 0x02B6,0x0000,0x0000,
+0x02B7,0x0000,0x0000, 0x02B0,0x0000,0x0000, 0x02B1,0x0000,0x0000,
+0x02AE,0x0000,0x0000, 0x02AF,0x0000,0x0000, 0x02B2,0x0000,0x0000,
+0x02B3,0x0000,0x0000, 0x02B4,0x0000,0x0000, 0x02B5,0x0000,0x0000,
+0x0238,0x0000,0x0000, 0x0239,0x0000,0x0000, 0x028A,0x0000,0x0000,
+0x028B,0x0000,0x0000, 0x0211,0x0000,0x0000, 0x0211,0x0000,0x0000,
+0x0211,0x0000,0x0000, 0x0211,0x0000,0x0000, 0x021B,0x0000,0x0000,
+0x021B,0x0000,0x0000, 0x021B,0x0000,0x0000, 0x022F,0x0000,0x0000,
+0x0237,0x0000,0x0000, 0x025D,0x0000,0x0000, 0xFBC1,0xFE53,0x0000,
+0x023A,0x0000,0x0000, 0x023D,0x0000,0x0000, 0x0255,0x0000,0x0000,
+0x0251,0x0000,0x0000, 0x0228,0x0000,0x0000, 0x0288,0x0000,0x0000,
+0x0289,0x0000,0x0000, 0x028C,0x0000,0x0000, 0x028D,0x0000,0x0000,
+0x02B8,0x0000,0x0000, 0x02B9,0x0000,0x0000, 0x02D2,0x0000,0x0000,
+0x02CF,0x0000,0x0000, 0x02C8,0x0000,0x0000, 0x0428,0x0000,0x0000,
+0x0221,0x0000,0x0000, 0x042C,0x0000,0x0000, 0x042E,0x0000,0x0000,
+0x042D,0x0000,0x0000, 0xFBC1,0xFE67,0x0000, 0x02CE,0x0000,0x0000,
+0x0E0F,0x0000,0x0000, 0x02D3,0x0000,0x0000, 0x02C7,0x0000,0x0000,
+0xFBC1,0xFE6C,0x0000, 0xFBC1,0xFE6D,0x0000, 0xFBC1,0xFE6E,0x0000,
+0xFBC1,0xFE6F,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC1,0xFE75,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x1347,0x0000,0x0000,
+0x1348,0x0000,0x0000, 0x1348,0x0000,0x0000, 0x1349,0x0000,0x0000,
+0x1349,0x0000,0x0000, 0x134C,0x0000,0x0000, 0x134C,0x0000,0x0000,
+0x134D,0x0000,0x0000, 0x134D,0x0000,0x0000, 0x134F,0x0000,0x0000,
+0x134F,0x0000,0x0000, 0x134F,0x0000,0x0000, 0x134F,0x0000,0x0000,
+0x1350,0x0000,0x0000, 0x1350,0x0000,0x0000, 0x1352,0x0000,0x0000,
+0x1352,0x0000,0x0000, 0x1352,0x0000,0x0000, 0x1352,0x0000,0x0000,
+0x1356,0x0000,0x0000, 0x1356,0x0000,0x0000, 0x1357,0x0000,0x0000,
+0x1357,0x0000,0x0000, 0x1357,0x0000,0x0000, 0x1357,0x0000,0x0000,
+0x1358,0x0000,0x0000, 0x1358,0x0000,0x0000, 0x1358,0x0000,0x0000,
+0x1358,0x0000,0x0000, 0x135E,0x0000,0x0000, 0x135E,0x0000,0x0000,
+0x135E,0x0000,0x0000, 0x135E,0x0000,0x0000, 0x1364,0x0000,0x0000,
+0x1364,0x0000,0x0000, 0x1364,0x0000,0x0000, 0x1364,0x0000,0x0000,
+0x1365,0x0000,0x0000, 0x1365,0x0000,0x0000, 0x1365,0x0000,0x0000,
+0x1365,0x0000,0x0000, 0x1369,0x0000,0x0000, 0x1369,0x0000,0x0000,
+0x136A,0x0000,0x0000, 0x136A,0x0000,0x0000, 0x1375,0x0000,0x0000,
+0x1375,0x0000,0x0000, 0x1376,0x0000,0x0000, 0x1376,0x0000,0x0000,
+0x1381,0x0000,0x0000, 0x1381,0x0000,0x0000, 0x1381,0x0000,0x0000,
+0x1381,0x0000,0x0000, 0x1382,0x0000,0x0000, 0x1382,0x0000,0x0000,
+0x1382,0x0000,0x0000, 0x1382,0x0000,0x0000, 0x1387,0x0000,0x0000,
+0x1387,0x0000,0x0000, 0x1387,0x0000,0x0000, 0x1387,0x0000,0x0000,
+0x1388,0x0000,0x0000, 0x1388,0x0000,0x0000, 0x1388,0x0000,0x0000,
+0x1388,0x0000,0x0000, 0x138C,0x0000,0x0000, 0x138C,0x0000,0x0000,
+0x138C,0x0000,0x0000, 0x138C,0x0000,0x0000, 0x138D,0x0000,0x0000,
+0x138D,0x0000,0x0000, 0x138D,0x0000,0x0000, 0x138D,0x0000,0x0000,
+0x138F,0x0000,0x0000, 0x138F,0x0000,0x0000, 0x138F,0x0000,0x0000,
+0x138F,0x0000,0x0000, 0x1390,0x0000,0x0000, 0x1390,0x0000,0x0000,
+0x1390,0x0000,0x0000, 0x1390,0x0000,0x0000, 0x1393,0x0000,0x0000,
+0x1393,0x0000,0x0000, 0x1393,0x0000,0x0000, 0x1393,0x0000,0x0000,
+0x139B,0x0000,0x0000, 0x139B,0x0000,0x0000, 0x139B,0x0000,0x0000,
+0x139B,0x0000,0x0000, 0x139E,0x0000,0x0000, 0x139E,0x0000,0x0000,
+0x139E,0x0000,0x0000, 0x139E,0x0000,0x0000, 0x13AB,0x0000,0x0000,
+0x13AB,0x0000,0x0000, 0x13AB,0x0000,0x0000, 0x13AB,0x0000,0x0000,
+0x13B0,0x0000,0x0000, 0x13B0,0x0000,0x0000, 0x13B0,0x0000,0x0000,
+0x13B0,0x0000,0x0000, 0x13B1,0x0000,0x0000, 0x13B1,0x0000,0x0000,
+0x13B1,0x0000,0x0000, 0x13B1,0x0000,0x0000, 0x13B7,0x0000,0x0000,
+0x13B7,0x0000,0x0000, 0x13B7,0x0000,0x0000, 0x13B7,0x0000,0x0000,
+0x13BD,0x0000,0x0000, 0x13BD,0x0000,0x0000, 0x13C7,0x0000,0x0000,
+0x13C7,0x0000,0x0000, 0x13C8,0x0000,0x0000, 0x13C8,0x0000,0x0000,
+0x13C8,0x0000,0x0000, 0x13C8,0x0000,0x0000, 0x13AB,0x1348,0x0000,
+0x13AB,0x1348,0x0000, 0x13AB,0x1349,0x0000, 0x13AB,0x1349,0x0000,
+0x13AB,0x134D,0x0000, 0x13AB,0x134D,0x0000, 0x13AB,0x1350,0x0000,
+0x13AB,0x1350,0x0000, 0xFBC1,0xFEFD,0x0000, 0xFBC1,0xFEFE,0x0000,
+0x0000,0x0000,0x0000 };
+
+static uint16 page0FFdata[]= { /* FF00 (3 weights per char) */
+0xFBC1,0xFF00,0x0000, 0x0251,0x0000,0x0000, 0x027E,0x0000,0x0000,
+0x02D2,0x0000,0x0000, 0x0E0F,0x0000,0x0000, 0x02D3,0x0000,0x0000,
+0x02CF,0x0000,0x0000, 0x0277,0x0000,0x0000, 0x0288,0x0000,0x0000,
+0x0289,0x0000,0x0000, 0x02C8,0x0000,0x0000, 0x0428,0x0000,0x0000,
+0x022F,0x0000,0x0000, 0x0221,0x0000,0x0000, 0x025D,0x0000,0x0000,
+0x02CC,0x0000,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000,
+0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000,
+0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000,
+0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0x023D,0x0000,0x0000,
+0x023A,0x0000,0x0000, 0x042C,0x0000,0x0000, 0x042D,0x0000,0x0000,
+0x042E,0x0000,0x0000, 0x0255,0x0000,0x0000, 0x02C7,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E60,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0EB9,0x0000,0x0000,
+0x0EC1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0F10,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F2E,0x0000,0x0000,
+0x0F5B,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0FA7,0x0000,0x0000, 0x0FB4,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x1044,0x0000,0x0000, 0x1051,0x0000,0x0000, 0x105A,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x028A,0x0000,0x0000,
+0x02CE,0x0000,0x0000, 0x028B,0x0000,0x0000, 0x020F,0x0000,0x0000,
+0x021B,0x0000,0x0000, 0x020C,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E4A,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E6D,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0EB9,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0F10,0x0000,0x0000,
+0x0F21,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F5B,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0FA7,0x0000,0x0000,
+0x0FB4,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FEA,0x0000,0x0000,
+0x1002,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x1044,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x105A,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x106A,0x0000,0x0000, 0x028C,0x0000,0x0000, 0x0430,0x0000,0x0000,
+0x028D,0x0000,0x0000, 0x0433,0x0000,0x0000, 0x029A,0x0000,0x0000,
+0x029B,0x0000,0x0000, 0x0266,0x0000,0x0000, 0x02B2,0x0000,0x0000,
+0x02B3,0x0000,0x0000, 0x0237,0x0000,0x0000, 0x022E,0x0000,0x0000,
+0x1E80,0x0000,0x0000, 0x1E52,0x0000,0x0000, 0x1E53,0x0000,0x0000,
+0x1E54,0x0000,0x0000, 0x1E55,0x0000,0x0000, 0x1E56,0x0000,0x0000,
+0x1E75,0x0000,0x0000, 0x1E76,0x0000,0x0000, 0x1E77,0x0000,0x0000,
+0x1E63,0x0000,0x0000, 0x0E0B,0x0000,0x0000, 0x1E52,0x0000,0x0000,
+0x1E53,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E55,0x0000,0x0000,
+0x1E56,0x0000,0x0000, 0x1E57,0x0000,0x0000, 0x1E58,0x0000,0x0000,
+0x1E59,0x0000,0x0000, 0x1E5A,0x0000,0x0000, 0x1E5B,0x0000,0x0000,
+0x1E5C,0x0000,0x0000, 0x1E5D,0x0000,0x0000, 0x1E5E,0x0000,0x0000,
+0x1E5F,0x0000,0x0000, 0x1E60,0x0000,0x0000, 0x1E61,0x0000,0x0000,
+0x1E62,0x0000,0x0000, 0x1E63,0x0000,0x0000, 0x1E64,0x0000,0x0000,
+0x1E65,0x0000,0x0000, 0x1E66,0x0000,0x0000, 0x1E67,0x0000,0x0000,
+0x1E68,0x0000,0x0000, 0x1E69,0x0000,0x0000, 0x1E6A,0x0000,0x0000,
+0x1E6B,0x0000,0x0000, 0x1E6C,0x0000,0x0000, 0x1E6D,0x0000,0x0000,
+0x1E6E,0x0000,0x0000, 0x1E6F,0x0000,0x0000, 0x1E70,0x0000,0x0000,
+0x1E71,0x0000,0x0000, 0x1E72,0x0000,0x0000, 0x1E73,0x0000,0x0000,
+0x1E74,0x0000,0x0000, 0x1E75,0x0000,0x0000, 0x1E76,0x0000,0x0000,
+0x1E77,0x0000,0x0000, 0x1E78,0x0000,0x0000, 0x1E79,0x0000,0x0000,
+0x1E7A,0x0000,0x0000, 0x1E7B,0x0000,0x0000, 0x1E7C,0x0000,0x0000,
+0x1E7D,0x0000,0x0000, 0x1E81,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x1DBD,0x0000,0x0000, 0x1D62,0x0000,0x0000,
+0x1D63,0x0000,0x0000, 0x1E02,0x0000,0x0000, 0x1D64,0x0000,0x0000,
+0x1E04,0x0000,0x0000, 0x1E05,0x0000,0x0000, 0x1D65,0x0000,0x0000,
+0x1D66,0x0000,0x0000, 0x1D67,0x0000,0x0000, 0x1E08,0x0000,0x0000,
+0x1E09,0x0000,0x0000, 0x1E0A,0x0000,0x0000, 0x1E0B,0x0000,0x0000,
+0x1E0C,0x0000,0x0000, 0x1E0D,0x0000,0x0000, 0x1D7C,0x0000,0x0000,
+0x1D68,0x0000,0x0000, 0x1D69,0x0000,0x0000, 0x1D6A,0x0000,0x0000,
+0x1D83,0x0000,0x0000, 0x1D6B,0x0000,0x0000, 0x1D6C,0x0000,0x0000,
+0x1D6D,0x0000,0x0000, 0x1D6E,0x0000,0x0000, 0x1D6F,0x0000,0x0000,
+0x1D70,0x0000,0x0000, 0x1D71,0x0000,0x0000, 0x1D72,0x0000,0x0000,
+0x1D73,0x0000,0x0000, 0x1D74,0x0000,0x0000, 0xFBC1,0xFFBF,0x0000,
+0xFBC1,0xFFC0,0x0000, 0xFBC1,0xFFC1,0x0000, 0x1DBE,0x0000,0x0000,
+0x1DBF,0x0000,0x0000, 0x1DC0,0x0000,0x0000, 0x1DC1,0x0000,0x0000,
+0x1DC2,0x0000,0x0000, 0x1DC3,0x0000,0x0000, 0xFBC1,0xFFC8,0x0000,
+0xFBC1,0xFFC9,0x0000, 0x1DC4,0x0000,0x0000, 0x1DC5,0x0000,0x0000,
+0x1DC6,0x0000,0x0000, 0x1DC7,0x0000,0x0000, 0x1DC8,0x0000,0x0000,
+0x1DC9,0x0000,0x0000, 0xFBC1,0xFFD0,0x0000, 0xFBC1,0xFFD1,0x0000,
+0x1DCA,0x0000,0x0000, 0x1DCB,0x0000,0x0000, 0x1DCC,0x0000,0x0000,
+0x1DCD,0x0000,0x0000, 0x1DCE,0x0000,0x0000, 0x1DCF,0x0000,0x0000,
+0xFBC1,0xFFD8,0x0000, 0xFBC1,0xFFD9,0x0000, 0x1DD0,0x0000,0x0000,
+0x1DD1,0x0000,0x0000, 0x1DD2,0x0000,0x0000, 0xFBC1,0xFFDD,0x0000,
+0xFBC1,0xFFDE,0x0000, 0xFBC1,0xFFDF,0x0000, 0x0E0E,0x0000,0x0000,
+0x0E10,0x0000,0x0000, 0x042F,0x0000,0x0000, 0x0210,0x0000,0x0000,
+0x0431,0x0000,0x0000, 0x0E11,0x0000,0x0000, 0x0E20,0x0000,0x0000,
+0xFBC1,0xFFE7,0x0000, 0x05FE,0x0000,0x0000, 0x03AE,0x0000,0x0000,
+0x03B0,0x0000,0x0000, 0x03AF,0x0000,0x0000, 0x03B1,0x0000,0x0000,
+0x069C,0x0000,0x0000, 0x06C7,0x0000,0x0000, 0xFBC1,0xFFEF,0x0000,
+0xFBC1,0xFFF0,0x0000, 0xFBC1,0xFFF1,0x0000, 0xFBC1,0xFFF2,0x0000,
+0xFBC1,0xFFF3,0x0000, 0xFBC1,0xFFF4,0x0000, 0xFBC1,0xFFF5,0x0000,
+0xFBC1,0xFFF6,0x0000, 0xFBC1,0xFFF7,0x0000, 0xFBC1,0xFFF8,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0DC5,0x0000,0x0000, 0x0DC6,0x0000,0x0000, 0xFBC1,0xFFFE,0x0000,
+0xFBC1,0xFFFF,0x0000 };
+
+static uchar uca_length[256]={
+4,3,3,4,3,3,3,3,0,3,3,3,3,3,3,3,
+3,3,3,3,3,2,3,3,3,3,0,0,0,3,3,3,
+5,5,4,3,5,2,3,3,2,2,5,3,0,0,3,3,
+3,3,8,9,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2,2,2,2,3,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,3,3,4,3,9,3,3
+};
+
+static uint16 *uca_weight[256]={
+page000data,page001data,page002data,page003data,
+page004data,page005data,page006data,page007data,
+NULL       ,page009data,page00Adata,page00Bdata,
+page00Cdata,page00Ddata,page00Edata,page00Fdata,
+page010data,page011data,page012data,page013data,
+page014data,page015data,page016data,page017data,
+page018data,page019data,NULL       ,NULL       ,
+NULL       ,page01Ddata,page01Edata,page01Fdata,
+page020data,page021data,page022data,page023data,
+page024data,page025data,page026data,page027data,
+page028data,page029data,page02Adata,page02Bdata,
+NULL       ,NULL       ,page02Edata,page02Fdata,
+page030data,page031data,page032data,page033data,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,page04Ddata,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+page0A0data,page0A1data,page0A2data,page0A3data,
+page0A4data,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,NULL       ,NULL       ,NULL       ,
+NULL       ,page0F9data,page0FAdata,page0FBdata,
+page0FCdata,page0FDdata,page0FEdata,page0FFdata
+};
+
+/*
+  Some sources treat LETTER A WITH DIARESIS (00E4,00C4)
+  secondary greater than LETTER AE (00E6,00C6).
+  http://www.evertype.com/alphabets/icelandic.pdf
+  http://developer.mimer.com/collations/charts/icelandic.htm
+
+  Other sources do not provide any special rules
+  for LETTER A WITH DIARESIS:
+  http://www.omniglot.com/writing/icelandic.htm
+  http://en.wikipedia.org/wiki/Icelandic_alphabet
+  http://oss.software.ibm.com/icu/charts/collation/is.html
+
+  Let's go the first way.
+*/
+
+static const char icelandic[]=
+    "& A < \\u00E1 <<< \\u00C1 "
+    "& D < \\u00F0 <<< \\u00D0 "
+    "& E < \\u00E9 <<< \\u00C9 "
+    "& I < \\u00ED <<< \\u00CD "
+    "& O < \\u00F3 <<< \\u00D3 "
+    "& U < \\u00FA <<< \\u00DA "
+    "& Y < \\u00FD <<< \\u00DD "
+    "& Z < \\u00FE <<< \\u00DE "
+        "< \\u00E6 <<< \\u00C6 << \\u00E4 <<< \\u00C4 "
+        "< \\u00F6 <<< \\u00D6 << \\u00F8 <<< \\u00D8 "
+        "< \\u00E5 <<< \\u00C5 ";
+
+/*
+  Some sources treat I and Y primary different.
+  Other sources treat I and Y the same on primary level.
+  We'll go the first way.
+*/
+
+static const char latvian[]=
+    "& C < \\u010D <<< \\u010C "
+    "& G < \\u0123 <<< \\u0122 "
+    "& I < \\u0079 <<< \\u0059 "
+    "& K < \\u0137 <<< \\u0136 "
+    "& L < \\u013C <<< \\u013B "
+    "& N < \\u0146 <<< \\u0145 "
+    "& R < \\u0157 <<< \\u0156 "
+    "& S < \\u0161 <<< \\u0160 "
+    "& Z < \\u017E <<< \\u017D ";
+
+
+static const char romanian[]=
+    "& A < \\u0103 <<< \\u0102 < \\u00E2 <<< \\u00C2 "
+    "& I < \\u00EE <<< \\u00CE "
+    "& S < \\u0219 <<< \\u0218 << \\u015F <<< \\u015E "
+    "& T < \\u021B <<< \\u021A << \\u0163 <<< \\u0162 ";
+
+static const char slovenian[]=
+    "& C < \\u010D <<< \\u010C "
+    "& S < \\u0161 <<< \\u0160 "
+    "& Z < \\u017E <<< \\u017D ";
+    
+
+static const char polish[]=
+    "& A < \\u0105 <<< \\u0104 "
+    "& C < \\u0107 <<< \\u0106 "
+    "& E < \\u0119 <<< \\u0118 "
+    "& L < \\u0142 <<< \\u0141 "
+    "& N < \\u0144 <<< \\u0143 "
+    "& O < \\u00F3 <<< \\u00D3 "
+    "& S < \\u015B <<< \\u015A "
+    "& Z < \\u017A <<< \\u0179 < \\u017C <<< \\u017B";
+
+static const char estonian[]=
+    "& S < \\u0161 <<< \\u0160 "
+       " < \\u007A <<< \\u005A "
+       " < \\u017E <<< \\u017D "
+    "& W < \\u00F5 <<< \\u00D5 "
+        "< \\u00E4 <<< \\u00C4 "
+        "< \\u00F6 <<< \\u00D6 "
+        "< \\u00FC <<< \\u00DC ";
+
+static const char spanish[]= "& N < \\u00F1 <<< \\u00D1 ";
+
+/*
+  Some sources treat V and W as similar on primary level.
+  We'll treat V and W as different on primary level.
+*/
+    
+static const char swedish[]=
+    "& Y <<\\u00FC <<< \\u00DC "
+    "& Z < \\u00E5 <<< \\u00C5 "
+        "< \\u00E4 <<< \\u00C4 << \\u00E6 <<< \\u00C6 "
+        "< \\u00F6 <<< \\u00D6 << \\u00F8 <<< \\u00D8 ";
+
+static const char turkish[]=
+    "& C < \\u00E7 <<< \\u00C7 "
+    "& G < \\u011F <<< \\u011E "
+    "& H < \\u0131 <<< \\u0049 "
+    "& O < \\u00F6 <<< \\u00D6 "
+    "& S < \\u015F <<< \\u015E "
+    "& U < \\u00FC <<< \\u00DC ";
+    
+
+static const char czech[]=
+    "& C < \\u010D <<< \\u010C "
+    "& H <      ch <<<      Ch <<< CH"
+    "& R < \\u0159 <<< \\u0158"
+    "& S < \\u0161 <<< \\u0160"
+    "& Z < \\u017E <<< \\u017D";
+
+static const char danish[]=  /* Also good for Norwegian */
+    "& Y << \\u00FC <<< \\u00DC << \\u0171 <<< \\u0170"
+    "& Z  < \\u00E6 <<< \\u00C6 << \\u00E4 <<< \\u00C4"
+        " < \\u00F8 <<< \\u00D8 << \\u00F6 <<< \\u00D6 << \\u0151 <<< \\u0150"
+        " < \\u00E5 <<< \\u00C5 << aa <<<  Aa <<< AA";
+
+static const char lithuanian[]=
+    "& C << ch <<< Ch <<< CH< \\u010D <<< \\u010C"
+    "& E << \\u0119 <<< \\u0118 << \\u0117 <<< \\u0116"
+    "& I << y <<< Y"
+    "& S  < \\u0161 <<< \\u0160"
+    "& Z  < \\u017E <<< \\u017D";
+
+static const char slovak[]=
+    "& A < \\u00E4 <<< \\u00C4"
+    "& C < \\u010D <<< \\u010C"
+    "& H < ch <<< Ch <<< CH"
+    "& O < \\u00F4 <<< \\u00D4"
+    "& S < \\u0161 <<< \\u0160"
+    "& Z < \\u017E <<< \\u017D";
+
+static const char spanish2[]=  /* Also good for Asturian and Galician */
+    "&C <  ch <<< Ch <<< CH"
+    "&L <  ll <<< Ll <<< LL"
+    "&N < \\u00F1 <<< \\u00D1";
+
+static const char roman[]= /* i.e. Classical Latin */
+    "& I << j <<< J "
+    "& V << u <<< U ";
+
+/*
+  Persian collation support was provided by 
+  Jody McIntyre <mysql@modernduck.com>
+  
+  To: internals@lists.mysql.com
+  Subject: Persian UTF8 collation support
+  Date: 17.08.2004
+  
+  Contraction is not implemented.  Some implementations do perform
+  contraction but others do not, and it is able to sort all my test
+  strings correctly.
+  
+  Jody.
+*/
+static const char persian[]=
+    "& \\u066D < \\u064E < \\uFE76 < \\uFE77 < \\u0650 < \\uFE7A < \\uFE7B"
+             " < \\u064F < \\uFE78 < \\uFE79 < \\u064B < \\uFE70 < \\uFE71"
+             " < \\u064D < \\uFE74 < \\u064C < \\uFE72"
+    "& \\uFE7F < \\u0653 < \\u0654 < \\u0655 < \\u0670"
+    "& \\u0669 < \\u0622 < \\u0627 < \\u0671 < \\u0621 < \\u0623 < \\u0625"
+             " < \\u0624 < \\u0626"
+    "& \\u0642 < \\u06A9 < \\u0643"
+    "& \\u0648 < \\u0647 < \\u0629 < \\u06C0 < \\u06CC < \\u0649 < \\u064A"
+    "& \\uFE80 < \\uFE81 < \\uFE82 < \\uFE8D < \\uFE8E < \\uFB50 < \\uFB51"
+             " < \\uFE80 < \\uFE83 < \\uFE84 < \\uFE87 < \\uFE88 < \\uFE85"
+             " < \\uFE86 < \\u0689 < \\u068A"
+    "& \\uFEAE < \\uFDFC"
+    "& \\uFED8 < \\uFB8E < \\uFB8F < \\uFB90 < \\uFB91 < \\uFED9 < \\uFEDA"
+             " < \\uFEDB < \\uFEDC"
+    "& \\uFEEE < \\uFEE9 < \\uFEEA < \\uFEEB < \\uFEEC < \\uFE93 < \\uFE94"
+             " < \\uFBA4 < \\uFBA5 < \\uFBFC < \\uFBFD < \\uFBFE < \\uFBFF"
+             " < \\uFEEF < \\uFEF0 < \\uFEF1 < \\uFEF2 < \\uFEF3 < \\uFEF4"
+             " < \\uFEF5 < \\uFEF6 < \\uFEF7 < \\uFEF8 < \\uFEF9 < \\uFEFA"
+             " < \\uFEFB < \\uFEFC";
+
+/*
+  Esperanto tailoring.
+  Contributed by Bertilo Wennergren <bertilow at gmail dot com>
+  September 1, 2005
+*/
+static const char esperanto[]=
+    "& C < \\u0109 <<< \\u0108"
+    "& G < \\u011D <<< \\u011C"
+    "& H < \\u0125 <<< \\u0124"
+    "& J < \\u0135 <<< \\u0134"
+    "& S < \\u015d <<< \\u015c"
+    "& U < \\u016d <<< \\u016c";
+
+/*
+  A simplified version of Hungarian, without consonant contractions.
+*/
+static const char hungarian[]=
+    "&O < \\u00F6 <<< \\u00D6 << \\u0151 <<< \\u0150"
+    "&U < \\u00FC <<< \\u00DC << \\u0171 <<< \\u0170";
+
+
+/*
+  Unicode Collation Algorithm:
+  Collation element (weight) scanner, 
+  for consequent scan of collations
+  weights from a string.
+*/
+typedef struct my_uca_scanner_st
+{
+  const uint16 *wbeg;  /* Beginning of the current weight string */
+  const uchar  *sbeg;  /* Beginning of the input string          */
+  const uchar  *send;  /* End of the input string                */
+  uchar *uca_length;
+  uint16 **uca_weight;
+  uint16 *contractions;
+  uint16 implicit[2];
+  int page;
+  int code;
+  CHARSET_INFO *cs;
+} my_uca_scanner;
+
+/*
+  Charset dependent scanner part, to optimize
+  some character sets.
+*/
+typedef struct my_uca_scanner_handler_st 
+{
+  void (*init)(my_uca_scanner *scanner, CHARSET_INFO *cs,
+               const uchar *str, uint length);
+  int (*next)(my_uca_scanner *scanner);
+} my_uca_scanner_handler;
+
+static uint16 nochar[]= {0};
+
+
+//#ifdef HAVE_CHARSET_ucs2
+#if 0
+/*
+  Initialize collation weight scanner
+
+  SYNOPSIS:
+    my_uca_scanner_init()
+    scanner    Pointer to an initialized scanner structure
+    cs         Character set + collation information
+    str                Beginning of the string
+    length     Length of the string.
+    
+  NOTES:
+    Optimized for UCS2
+
+  RETURN
+    N/A
+*/
+
+static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner,
+                                       uchar *sort_order, uint16 **sort_order_big, uint16 *contractions,
+                                     const uchar *str, uint length)
+{
+  /* Note, no needs to initialize scanner->wbeg */
+  scanner->sbeg= str;
+  scanner->send= str + length - 2;
+  scanner->wbeg= nochar; 
+  scanner->uca_length= sort_order;
+  scanner->uca_weight= sort_order_big;
+  scanner->contractions= contractions;
+}
+
+
+/*
+  Read next collation element (weight), i.e. converts
+  a stream of characters into a stream of their weights.
+  
+  SYNOPSIS:
+    my_uca_scanner_next()
+    scanner    Address of a previously initialized scanner strucuture
+    
+  NOTES:
+    Optimized for UCS2
+    
+    Checks if the current character's weight string has been fully scanned,
+    if no, then returns the next weight for this character,
+    else scans the next character and returns its first weight.
+
+    Each character can have number weights from 0 to 8.
+    
+    Some characters do not have weights at all, 0 weights. 
+    It means they are ignored during comparison.
+    
+    Examples:
+    1. 0x0001 START OF HEADING, has no weights, ignored, does
+       not produce any weights.
+    2. 0x0061 LATIN SMALL LETTER A, has one weight.
+       0x0E33 will be returned
+    3. 0x00DF LATIN SMALL LETTER SHARP S, aka SZ ligature,
+       has two weights. It will return 0x0FEA twice for two
+       consequent calls.
+    4. 0x247D PATENTHESIZED NUMBER TEN, has four weights,
+       this function will return these numbers in four 
+       consequent calls: 0x0288, 0x0E2A, 0x0E29, 0x0289
+    5. A string consisting of the above characters:
+       0x0001 0x0061 0x00DF 0x247D
+       will return the following weights, one weight per call:
+       0x0E33 0x0FEA 0x0FEA 0x0288, 0x0E2A, 0x0E29, 0x0289
+    
+  RETURN
+    Next weight, a number between 0x0000 and 0xFFFF
+    Or -1 on error (END-OF-STRING or ILLEGAL MULTIBYTE SEQUENCE)
+*/
+
+static int my_uca_scanner_next_ucs2(my_uca_scanner *scanner)
+{
+  
+  /* 
+    Check if the weights for the previous character have been
+    already fully scanned. If yes, then get the next character and 
+    initialize wbeg and wlength to its weight string.
+  */
+  
+  if (scanner->wbeg[0])
+    return *scanner->wbeg++;
+  
+  do 
+  {
+    uint16 **ucaw= scanner->uca_weight;
+    uchar *ucal= scanner->uca_length;
+    
+    if (scanner->sbeg > scanner->send)
+      return -1;
+    
+    scanner->page= (unsigned char)scanner->sbeg[0];
+    scanner->code= (unsigned char)scanner->sbeg[1];
+    scanner->sbeg+= 2;
+    
+    if (scanner->contractions && (scanner->sbeg <= scanner->send))
+    {
+      int cweight;
+      
+      if (!scanner->page && !scanner->sbeg[0] &&
+          (scanner->sbeg[1] > 0x40) && (scanner->sbeg[1] < 0x80) &&
+          (scanner->code > 0x40) && (scanner->code < 0x80) &&
+          (cweight= scanner->contractions[(scanner->code-0x40)*0x40+scanner->sbeg[1]-0x40]))
+        {
+          scanner->implicit[0]= 0;
+          scanner->wbeg= scanner->implicit;
+          scanner->sbeg+=2;
+          return cweight;
+        }
+    }
+    
+    if (!ucaw[scanner->page])
+      goto implicit;
+    scanner->wbeg= ucaw[scanner->page] + scanner->code * ucal[scanner->page];
+  } while (!scanner->wbeg[0]);
+  
+  return *scanner->wbeg++;
+  
+implicit:
+  
+  scanner->code= (scanner->page << 8) + scanner->code;
+  scanner->implicit[0]= (scanner->code & 0x7FFF) | 0x8000;
+  scanner->implicit[1]= 0;
+  scanner->wbeg= scanner->implicit;
+  
+  scanner->page= scanner->page >> 7;
+  
+  if (scanner->code >= 0x3400 && scanner->code <= 0x4DB5)
+    scanner->page+= 0xFB80;
+  else if (scanner->code >= 0x4E00 && scanner->code <= 0x9FA5)
+    scanner->page+= 0xFB40;
+  else
+    scanner->page+= 0xFBC0;
+  
+  return scanner->page;
+}
+
+static my_uca_scanner_handler my_ucs2_uca_scanner_handler=
+{
+  my_uca_scanner_init_ucs2,
+  my_uca_scanner_next_ucs2
+};
+
+#endif
+
+
+/*
+  The same two functions for any character set
+*/
+static void my_uca_scanner_init_any(my_uca_scanner *scanner,
+                                   CHARSET_INFO *cs __attribute__((unused)),
+                                   const uchar *str, uint length)
+{
+  /* Note, no needs to initialize scanner->wbeg */
+  scanner->sbeg= str;
+  scanner->send= str + length;
+  scanner->wbeg= nochar; 
+  scanner->uca_length= cs->sort_order;
+  scanner->uca_weight= cs->sort_order_big;
+  scanner->contractions= cs->contractions;
+  scanner->cs= cs;
+}
+
+static int my_uca_scanner_next_any(my_uca_scanner *scanner)
+{
+  
+  /* 
+    Check if the weights for the previous character have been
+    already fully scanned. If yes, then get the next character and 
+    initialize wbeg and wlength to its weight string.
+  */
+  
+  if (scanner->wbeg[0])
+    return *scanner->wbeg++;
+  
+  do 
+  {
+    uint16 **ucaw= scanner->uca_weight;
+    uchar *ucal= scanner->uca_length;
+    my_wc_t wc;
+    int mblen;
+    
+    if (((mblen= scanner->cs->cset->mb_wc(scanner->cs, &wc, 
+                                          scanner->sbeg,
+                                          scanner->send)) <= 0))
+      return -1;
+    
+    scanner->page= wc >> 8;
+    scanner->code= wc & 0xFF;
+    scanner->sbeg+= mblen;
+    
+    if (scanner->contractions && !scanner->page &&
+        (scanner->code > 0x40) && (scanner->code < 0x80))
+    {
+      uint page1, code1, cweight;
+      
+      if (((mblen= scanner->cs->cset->mb_wc(scanner->cs, &wc,
+                                            scanner->sbeg, 
+                                            scanner->send)) >=0) &&
+           (!(page1= (wc >> 8))) &&
+           ((code1= (wc & 0xFF)) > 0x40) &&
+           (code1 < 0x80) && 
+           (cweight= scanner->contractions[(scanner->code-0x40)*0x40 + code1-0x40]))
+      {
+        scanner->implicit[0]= 0;
+        scanner->wbeg= scanner->implicit;
+        scanner->sbeg+= mblen;
+        return cweight;
+      }
+    }
+    
+    if (!ucaw[scanner->page])
+      goto implicit;
+    scanner->wbeg= ucaw[scanner->page] + scanner->code * ucal[scanner->page];
+  } while (!scanner->wbeg[0]);
+  
+  return *scanner->wbeg++;
+  
+implicit:
+  
+  scanner->code= (scanner->page << 8) + scanner->code;
+  scanner->implicit[0]= (scanner->code & 0x7FFF) | 0x8000;
+  scanner->implicit[1]= 0;
+  scanner->wbeg= scanner->implicit;
+  
+  scanner->page= scanner->page >> 7;
+  
+  if (scanner->code >= 0x3400 && scanner->code <= 0x4DB5)
+    scanner->page+= 0xFB80;
+  else if (scanner->code >= 0x4E00 && scanner->code <= 0x9FA5)
+    scanner->page+= 0xFB40;
+  else
+    scanner->page+= 0xFBC0;
+  
+  return scanner->page;
+}
+
+
+static my_uca_scanner_handler my_any_uca_scanner_handler=
+{
+  my_uca_scanner_init_any,
+  my_uca_scanner_next_any
+};
+
+/*
+  Compares two strings according to the collation
+
+  SYNOPSIS:
+    my_strnncoll_uca()
+    cs         Character set information
+    s          First string
+    slen       First string length
+    t          Second string
+    tlen       Seconf string length
+  
+  NOTES:
+    Initializes two weight scanners and gets weights
+    corresponding to two strings in a loop. If weights are not
+    the same at some step then returns their difference.
+    
+    In the while() comparison these situations are possible:
+    1. (s_res>0) and (t_res>0) and (s_res == t_res)
+       Weights are the same so far, continue comparison
+    2. (s_res>0) and (t_res>0) and (s_res!=t_res)
+       A difference has been found, return.
+    3. (s_res>0) and (t_res<0)
+       We have reached the end of the second string, or found
+       an illegal multibyte sequence in the second string.
+       Return a positive number, i.e. the first string is bigger.
+    4. (s_res<0) and (t_res>0)   
+       We have reached the end of the first string, or found
+       an illegal multibyte sequence in the first string.
+       Return a negative number, i.e. the second string is bigger.
+    5. (s_res<0) and (t_res<0)
+       Both scanners returned -1. It means we have riched
+       the end-of-string of illegal-sequence in both strings
+       at the same time. Return 0, strings are equal.
+    
+  RETURN
+    Difference between two strings, according to the collation:
+    0               - means strings are equal
+    negative number - means the first string is smaller
+    positive number - means the first string is bigger
+*/
+
+static int my_strnncoll_uca(CHARSET_INFO *cs, 
+                            my_uca_scanner_handler *scanner_handler,
+                           const uchar *s, uint slen,
+                            const uchar *t, uint tlen,
+                            my_bool t_is_prefix)
+{
+  my_uca_scanner sscanner;
+  my_uca_scanner tscanner;
+  int s_res;
+  int t_res;
+  
+  scanner_handler->init(&sscanner, cs, s, slen);
+  scanner_handler->init(&tscanner, cs, t, tlen);
+  
+  do
+  {
+    s_res= scanner_handler->next(&sscanner);
+    t_res= scanner_handler->next(&tscanner);
+  } while ( s_res == t_res && s_res >0);
+  
+  return  (t_is_prefix && t_res < 0) ? 0 : (s_res - t_res);
+}
+
+#if 0
+/*
+  Compares two strings according to the collation,
+  ignoring trailing spaces.
+
+  SYNOPSIS:
+    my_strnncollsp_uca()
+    cs         Character set information
+    s          First string
+    slen       First string length
+    t          Second string
+    tlen       Seconf string length
+    diff_if_only_endspace_difference
+                       Set to 1 if the strings should be regarded as different
+                        if they only difference in end space
+  
+  NOTES:
+    Works exactly the same with my_strnncoll_uca(),
+    but ignores trailing spaces.
+
+    In the while() comparison these situations are possible:
+    1. (s_res>0) and (t_res>0) and (s_res == t_res)
+       Weights are the same so far, continue comparison
+    2. (s_res>0) and (t_res>0) and (s_res!=t_res)
+       A difference has been found, return.
+    3. (s_res>0) and (t_res<0)
+       We have reached the end of the second string, or found
+       an illegal multibyte sequence in the second string.
+       Compare the first string to an infinite array of
+       space characters until difference is found, or until
+       the end of the first string.
+    4. (s_res<0) and (t_res>0)   
+       We have reached the end of the first string, or found
+       an illegal multibyte sequence in the first string.
+       Compare the second string to an infinite array of
+       space characters until difference is found or until
+       the end of the second steing.
+    5. (s_res<0) and (t_res<0)
+       Both scanners returned -1. It means we have riched
+       the end-of-string of illegal-sequence in both strings
+       at the same time. Return 0, strings are equal.
+  
+  RETURN
+    Difference between two strings, according to the collation:
+    0               - means strings are equal
+    negative number - means the first string is smaller
+    positive number - means the first string is bigger
+*/
+
+static int my_strnncollsp_uca(CHARSET_INFO *cs, 
+                              my_uca_scanner_handler *scanner_handler,
+                              const uchar *s, uint slen,
+                              const uchar *t, uint tlen,
+                              my_bool diff_if_only_endspace_difference)
+{
+  my_uca_scanner sscanner, tscanner;
+  int s_res, t_res;
+  
+#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
+  diff_if_only_endspace_difference= 0;
+#endif
+
+  scanner_handler->init(&sscanner, cs, s, slen);
+  scanner_handler->init(&tscanner, cs, t, tlen);
+  
+  do
+  {
+    s_res= scanner_handler->next(&sscanner);
+    t_res= scanner_handler->next(&tscanner);
+  } while ( s_res == t_res && s_res >0);
+
+  if (s_res > 0 && t_res < 0)
+  { 
+    /* Calculate weight for SPACE character */
+    t_res= cs->sort_order_big[0][0x20 * cs->sort_order[0]];
+      
+    /* compare the first string to spaces */
+    do
+    {
+      if (s_res != t_res)
+        return (s_res - t_res);
+      s_res= scanner_handler->next(&sscanner);
+    } while (s_res > 0);
+    return diff_if_only_endspace_difference ? 1 : 0;
+  }
+    
+  if (s_res < 0 && t_res > 0)
+  {
+    /* Calculate weight for SPACE character */
+    s_res= cs->sort_order_big[0][0x20 * cs->sort_order[0]];
+      
+    /* compare the second string to spaces */
+    do
+    {
+      if (s_res != t_res)
+        return (s_res - t_res);
+      t_res= scanner_handler->next(&tscanner);
+    } while (t_res > 0);
+    return diff_if_only_endspace_difference ? -1 : 0;
+  }
+  
+  return ( s_res - t_res );
+}
+
+/*
+  Calculates hash value for the given string,
+  according to the collation, and ignoring trailing spaces.
+  
+  SYNOPSIS:
+    my_hash_sort_uca()
+    cs         Character set information
+    s          String
+    slen       String's length
+    n1         First hash parameter
+    n2         Second hash parameter
+  
+  NOTES:
+    Scans consequently weights and updates
+    hash parameters n1 and n2. In a case insensitive collation,
+    upper and lower case of the same letter will return the same
+    weight sequence, and thus will produce the same hash values
+    in n1 and n2.
+  
+  RETURN
+    N/A
+*/
+
+static void my_hash_sort_uca(CHARSET_INFO *cs,
+                             my_uca_scanner_handler *scanner_handler,
+                            const uchar *s, uint slen,
+                            ulong *n1, ulong *n2)
+{
+  int   s_res;
+  my_uca_scanner scanner;
+  
+  slen= cs->cset->lengthsp(cs, (char*) s, slen);
+  scanner_handler->init(&scanner, cs, s, slen);
+  
+  while ((s_res= scanner_handler->next(&scanner)) >0)
+  {
+    n1[0]^= (((n1[0] & 63)+n2[0])*(s_res >> 8))+ (n1[0] << 8);
+    n2[0]+=3;
+    n1[0]^= (((n1[0] & 63)+n2[0])*(s_res & 0xFF))+ (n1[0] << 8);
+    n2[0]+=3;
+  }
+}
+
+
+/*
+  For the given string creates its "binary image", suitable
+  to be used in binary comparison, i.e. in memcmp(). 
+  
+  SYNOPSIS:
+    my_strnxfrm_uca()
+    cs         Character set information
+    dst                Where to write the image
+    dstlen     Space available for the image, in bytes
+    src                The source string
+    srclen     Length of the source string, in bytes
+  
+  NOTES:
+    In a loop, scans weights from the source string and writes
+    them into the binary image. In a case insensitive collation,
+    upper and lower cases of the same letter will produce the
+    same image subsequences. When we have reached the end-of-string
+    or found an illegal multibyte sequence, the loop stops.
+
+    It is impossible to restore the original string using its
+    binary image. 
+    
+    Binary images are used for bulk comparison purposes,
+    e.g. in ORDER BY, when it is more efficient to create
+    a binary image and use it instead of weight scanner
+    for the original strings for every comparison.
+  
+  RETURN
+    Number of bytes that have been written into the binary image.
+*/
+
+static int my_strnxfrm_uca(CHARSET_INFO *cs, 
+                           my_uca_scanner_handler *scanner_handler,
+                           uchar *dst, uint dstlen,
+                           const uchar *src, uint srclen)
+{
+  uchar *de = dst + (dstlen & (uint) ~1); /* add even length for easier code */
+  int   s_res;
+  my_uca_scanner scanner;
+  scanner_handler->init(&scanner, cs, src, srclen);
+  
+  while (dst < de && (s_res= scanner_handler->next(&scanner)) >0)
+  {
+    dst[0]= s_res >> 8;
+    dst[1]= s_res & 0xFF;
+    dst+= 2;
+  }
+  s_res= cs->sort_order_big[0][0x20 * cs->sort_order[0]];
+  while (dst < de)
+  {
+    dst[0]= s_res >> 8;
+    dst[1]= s_res & 0xFF;
+    dst+= 2;
+  }
+  if (dstlen & 1) /* if odd number then fill the last char */
+    *dst= '\0';
+  
+  return dstlen;
+}
+
+
+
+/*
+  This function compares if two characters are the same.
+  The sign +1 or -1 does not matter. The only
+  important thing is that the result is 0 or not 0.
+  This fact allows us to use memcmp() safely, on both
+  little-endian and big-endian machines.
+*/
+static int my_uca_charcmp(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2)
+{
+  size_t page1= wc1 >> MY_UCA_PSHIFT;
+  size_t page2= wc2 >> MY_UCA_PSHIFT;
+  uchar *ucal= cs->sort_order;
+  uint16 **ucaw= cs->sort_order_big;
+  size_t length1= ucal[page1];
+  size_t length2= ucal[page2];
+  uint16 *weight1= ucaw[page1] + (wc1 & MY_UCA_CMASK) * ucal[page1];
+  uint16 *weight2= ucaw[page2] + (wc2 & MY_UCA_CMASK) * ucal[page2];
+  
+  if (!weight1 || !weight2)
+    return wc1 != wc2;
+  
+  if (length1 > length2)
+    return memcmp((const void*)weight1, (const void*)weight2, length2*2) ?
+           1: weight1[length2];
+  
+  if (length1 < length2)
+    return memcmp((const void*)weight1, (const void*)weight2, length1*2) ?
+           1 : weight2[length1];
+  
+  return memcmp((const void*)weight1, (const void*)weight2, length1*2);
+}
+
+/*
+** Compare string against string with wildcard
+**     0 if matched
+**     -1 if not matched with wildcard
+**      1 if matched with wildcard
+*/
+
+static
+int my_wildcmp_uca(CHARSET_INFO *cs,
+                  const char *str,const char *str_end,
+                  const char *wildstr,const char *wildend,
+                  int escape, int w_one, int w_many)
+{
+  int result= -1;                      /* Not found, using wildcards */
+  my_wc_t s_wc, w_wc;
+  int scan;
+  int (*mb_wc)(struct charset_info_st *cs, my_wc_t *wc,
+               const unsigned char *s,const unsigned char *e);
+  mb_wc= cs->cset->mb_wc;
+  
+  while (wildstr != wildend)
+  {
+    while (1)
+    {
+      my_bool escaped= 0;
+      if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+                      (const uchar*)wildend)) <= 0)
+       return 1;
+
+      if (w_wc == (my_wc_t)w_many)
+      {
+        result= 1;                             /* Found an anchor char */
+        break;
+      }
+
+      wildstr+= scan;
+      if (w_wc ==  (my_wc_t)escape)
+      {
+        if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+                       (const uchar*)wildend)) <= 0)
+          return 1;
+        wildstr+= scan;
+        escaped= 1;
+      }
+      
+      if ((scan= mb_wc(cs, &s_wc, (const uchar*)str,
+                      (const uchar*)str_end)) <= 0)
+        return 1;
+      str+= scan;
+      
+      if (!escaped && w_wc == (my_wc_t)w_one)
+      {
+        result= 1;                             /* Found an anchor char */
+      }
+      else
+      {
+        if (my_uca_charcmp(cs,s_wc,w_wc))
+          return 1;
+      }
+      if (wildstr == wildend)
+       return (str != str_end);                /* Match if both are at end */
+    }
+    
+    
+    if (w_wc == (my_wc_t)w_many)
+    {                                          /* Found w_many */
+    
+      /* Remove any '%' and '_' from the wild search string */
+      for ( ; wildstr != wildend ; )
+      {
+        if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+                        (const uchar*)wildend)) <= 0)
+          return 1;
+        
+       if (w_wc == (my_wc_t)w_many)
+       {
+         wildstr+= scan;
+         continue;
+       } 
+       
+       if (w_wc == (my_wc_t)w_one)
+       {
+         wildstr+= scan;
+         if ((scan= mb_wc(cs, &s_wc, (const uchar*)str,
+                          (const uchar*)str_end)) <= 0)
+            return 1;
+          str+= scan;
+         continue;
+       }
+       break;                                  /* Not a wild character */
+      }
+      
+      if (wildstr == wildend)
+       return 0;                               /* Ok if w_many is last */
+      
+      if (str == str_end)
+       return -1;
+      
+      if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+                      (const uchar*)wildend)) <= 0)
+        return 1;
+      
+      if (w_wc ==  (my_wc_t)escape)
+      {
+        wildstr+= scan;
+        if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+                        (const uchar*)wildend)) <= 0)
+          return 1;
+      }
+      
+      while (1)
+      {
+        /* Skip until the first character from wildstr is found */
+        while (str != str_end)
+        {
+          if ((scan= mb_wc(cs, &s_wc, (const uchar*)str,
+                          (const uchar*)str_end)) <= 0)
+            return 1;
+          
+          if (!my_uca_charcmp(cs,s_wc,w_wc))
+            break;
+          str+= scan;
+        }
+        if (str == str_end)
+          return -1;
+        
+        result= my_wildcmp_uca(cs, str, str_end, wildstr, wildend,
+                              escape, w_one, w_many);
+        
+        if (result <= 0)
+          return result;
+        
+        str+= scan;
+      } 
+    }
+  }
+  return (str != str_end ? 1 : 0);
+}
+#endif
+
+/*
+  Collation language is implemented according to
+  subset of ICU Collation Customization (tailorings):
+  http://oss.software.ibm.com/icu/userguide/Collate_Customization.html
+  
+  Collation language elements:
+  Delimiters:
+    space   - skipped
+  
+  <char> :=  A-Z | a-z | \uXXXX
+  
+  Shift command:
+    <shift>  := &       - reset at this letter. 
+  
+  Diff command:
+    <d1> :=  <     - Identifies a primary difference.
+    <d2> :=  <<    - Identifies a secondary difference.
+    <d3> := <<<    - Idenfifies a tertiary difference.
+  
+  
+  Collation rules:
+    <ruleset> :=  <rule>  { <ruleset> }
+    
+    <rule> :=   <d1>    <string>
+              | <d2>    <string>
+              | <d3>    <string>
+              | <shift> <char>
+    
+    <string> := <char> [ <string> ]
+
+  An example, Polish collation:
+  
+    &A < \u0105 <<< \u0104
+    &C < \u0107 <<< \u0106
+    &E < \u0119 <<< \u0118
+    &L < \u0142 <<< \u0141
+    &N < \u0144 <<< \u0143
+    &O < \u00F3 <<< \u00D3
+    &S < \u015B <<< \u015A
+    &Z < \u017A <<< \u017B    
+*/
+
+
+typedef enum my_coll_lexem_num_en
+{
+  MY_COLL_LEXEM_EOF    = 0,
+  MY_COLL_LEXEM_DIFF   = 1, 
+  MY_COLL_LEXEM_SHIFT  = 4,
+  MY_COLL_LEXEM_CHAR   = 5,
+  MY_COLL_LEXEM_ERROR  = 6
+} my_coll_lexem_num;
+
+
+typedef struct my_coll_lexem_st
+{
+  const char *beg;
+  const char *end;
+  const char *prev;
+  int   diff;
+  int   code;
+} MY_COLL_LEXEM;
+
+
+/*
+  Initialize collation rule lexical anilizer
+  
+  SYNOPSIS
+    my_coll_lexem_init
+    lexem                Lex analizer to init
+    str                  Const string to parse
+    strend               End of the string
+  USAGE
+  
+  RETURN VALUES
+    N/A
+*/
+
+static void my_coll_lexem_init(MY_COLL_LEXEM *lexem,
+                               const char *str, const char *strend)
+{
+  lexem->beg= str;
+  lexem->prev= str;
+  lexem->end= strend;
+  lexem->diff= 0;
+  lexem->code= 0;
+}
+
+
+/*
+  Print collation customization expression parse error, with context.
+  
+  SYNOPSIS
+    my_coll_lexem_print_error
+    lexem                Lex analizer to take context from
+    errstr               sting to write error to
+    errsize              errstr size
+    txt                  error message
+  USAGE
+  
+  RETURN VALUES
+    N/A
+*/
+
+#if 0
+static void my_coll_lexem_print_error(MY_COLL_LEXEM *lexem,
+                                      char *errstr, size_t errsize,
+                                      const char *txt)
+{
+  char tail[30];
+  size_t len= lexem->end - lexem->prev;
+  strmake (tail, lexem->prev, (uint) min(len, sizeof(tail)-1));
+  errstr[errsize-1]= '\0';
+  my_snprintf(errstr,errsize-1,"%s at '%s'", txt, tail);
+}
+#endif
+
+/*
+  Convert a hex digit into its numeric value
+  
+  SYNOPSIS
+    ch2x
+    ch                   hex digit to convert
+  USAGE
+  
+  RETURN VALUES
+    an integer value in the range 0..15
+    -1 on error
+*/
+
+static int ch2x(int ch)
+{
+  if (ch >= '0' && ch <= '9')
+    return ch - '0';
+  
+  if (ch >= 'a' && ch <= 'f')
+    return 10 + ch - 'a';
+  
+  if (ch >= 'A' && ch <= 'F')
+    return 10 + ch - 'A';
+  
+  return -1;
+}
+
+
+/*
+  Collation language lexical parser:
+  Scans the next lexem.
+  
+  SYNOPSIS
+    my_coll_lexem_next
+    lexem                Lex analizer, previously initialized by 
+                         my_coll_lexem_init.
+  USAGE
+    Call this function in a loop
+    
+  RETURN VALUES
+    Lexem number: eof, diff, shift, char or error.
+*/
+
+static my_coll_lexem_num my_coll_lexem_next(MY_COLL_LEXEM *lexem)
+{
+  const char *beg;
+  my_coll_lexem_num rc;
+  
+  for (beg= lexem->beg ; beg < lexem->end ; beg++)
+  {
+    if (*beg == ' ' || *beg == '\t' || *beg == '\r' || *beg == '\n')
+      continue;
+    
+    if (*beg == '&')
+    {
+      beg++;
+      rc= MY_COLL_LEXEM_SHIFT;
+      goto ex;
+    }
+    
+    if (beg[0] == '<')
+    {
+      for (beg++, lexem->diff= 1;
+           (beg < lexem->end) && 
+           (*beg == '<') && (lexem->diff<3);
+           beg++, lexem->diff++);
+      rc= MY_COLL_LEXEM_DIFF;
+      goto ex;
+    }
+    
+    if ((*beg >= 'a' && *beg <= 'z') || (*beg >= 'A' && *beg <= 'Z'))
+    {
+      lexem->code= *beg++;
+      rc= MY_COLL_LEXEM_CHAR;
+      goto ex;
+    }
+    
+    if ((*beg == '\\') && (beg+2 < lexem->end) && (beg[1] == 'u'))
+    {
+      int ch;
+      
+      beg+= 2;
+      lexem->code= 0;
+      while ((beg < lexem->end) && ((ch= ch2x(beg[0])) >= 0))
+      { 
+        lexem->code= (lexem->code << 4) + ch;
+        beg++;
+      }
+      rc= MY_COLL_LEXEM_CHAR;
+      goto ex;
+    }
+    
+    rc= MY_COLL_LEXEM_ERROR;
+    goto ex;
+  }
+  rc= MY_COLL_LEXEM_EOF;
+  
+ex:
+  lexem->prev= lexem->beg;
+  lexem->beg= beg;
+  return rc;  
+}
+
+
+/*
+  Collation rule item
+*/
+
+typedef struct my_coll_rule_item_st
+{
+  uint base;     /* Base character                             */
+  uint curr[2];  /* Current character                          */
+  int diff[3];   /* Primary, Secondary and Tertiary difference */
+} MY_COLL_RULE;
+
+
+/*
+  Collation language syntax parser.
+  Uses lexical parser.
+  
+  SYNOPSIS
+    my_coll_rule_parse
+    rule                 Collation rule list to load to.
+    str                  A string containin collation language expression.
+    strend               End of the string.
+  USAGE
+    
+  RETURN VALUES
+    A positive number means the number of rules loaded.
+   -1 means ERROR, e.g. too many items, syntax error, etc.
+*/
+
+static int my_coll_rule_parse(MY_COLL_RULE *rule, size_t mitems,
+                              const char *str, const char *strend,
+                              char *errstr, size_t errsize)
+{
+  MY_COLL_LEXEM lexem;
+  my_coll_lexem_num lexnum;
+  my_coll_lexem_num prevlexnum= MY_COLL_LEXEM_ERROR;
+  MY_COLL_RULE item; 
+  int state= 0;
+  size_t nitems= 0;
+  
+  /* Init all variables */
+  errstr[0]= '\0';
+  bzero(&item, sizeof(item));
+  my_coll_lexem_init(&lexem, str, strend);
+  
+  while ((lexnum= my_coll_lexem_next(&lexem)))
+  {
+    if (lexnum == MY_COLL_LEXEM_ERROR)
+    {
+      //my_coll_lexem_print_error(&lexem,errstr,errsize-1,"Unknown character");
+      return -1;
+    }
+    
+    switch (state) {
+    case 0:
+      if (lexnum != MY_COLL_LEXEM_SHIFT)
+      {
+        //my_coll_lexem_print_error(&lexem,errstr,errsize-1,"& expected");
+        return -1;
+      }
+      prevlexnum= lexnum;
+      state= 2;
+      continue;
+      
+    case 1:
+      if (lexnum != MY_COLL_LEXEM_SHIFT && lexnum != MY_COLL_LEXEM_DIFF)
+      {
+        //my_coll_lexem_print_error(&lexem,errstr,errsize-1,"& or < expected");
+        return -1;
+      }
+      prevlexnum= lexnum;
+      state= 2;
+      continue;
+      
+    case 2:
+      if (lexnum != MY_COLL_LEXEM_CHAR)
+      {
+        //my_coll_lexem_print_error(&lexem,errstr,errsize-1,"character expected");
+        return -1;
+      }
+      
+      if (prevlexnum == MY_COLL_LEXEM_SHIFT)
+      {
+        item.base= lexem.code;
+        item.diff[0]= 0;
+        item.diff[1]= 0;
+        item.diff[2]= 0;
+      }
+      else if (prevlexnum == MY_COLL_LEXEM_DIFF)
+      {
+        MY_COLL_LEXEM savlex;
+        savlex= lexem;
+        item.curr[0]= lexem.code;
+        if ((lexnum= my_coll_lexem_next(&lexem)) == MY_COLL_LEXEM_CHAR)
+        {
+          item.curr[1]= lexem.code;
+        }
+        else
+        {
+          item.curr[1]= 0;
+          lexem=savlex;   /* Restore previous parser state */
+        }
+        if (lexem.diff == 3)
+        {
+          item.diff[2]++;
+        }
+        else if (lexem.diff == 2)
+        {
+          item.diff[1]++;
+          item.diff[2]= 0;
+        }
+        else if (lexem.diff == 1)
+        {
+          item.diff[0]++;
+          item.diff[1]= 0;
+          item.diff[2]= 0;
+        }
+        if (nitems >= mitems)
+        {
+          //my_coll_lexem_print_error(&lexem,errstr,errsize-1,"Too many rules");
+          return -1;
+        }
+        rule[nitems++]= item;
+      }
+      else
+      {
+        //my_coll_lexem_print_error(&lexem,errstr,errsize-1,"Should never happen");
+        return -1;
+      }
+      state= 1;
+      continue;
+    }
+  }
+  return (int) nitems;
+}
+
+#define MY_MAX_COLL_RULE 128
+
+/*
+  This function copies an UCS2 collation from
+  the default Unicode Collation Algorithm (UCA)
+  weights applying tailorings, i.e. a set of
+  alternative weights for some characters. 
+  
+  The default UCA weights are stored in uca_weight/uca_length.
+  They consist of 256 pages, 256 character each.
+  
+  If a page is not overwritten by tailoring rules,
+  it is copies as is from UCA as is.
+  
+  If a page contains some overwritten characters, it is
+  allocated. Untouched characters are copied from the
+  default weights.
+*/
+
+static my_bool create_tailoring(CHARSET_INFO *cs, void *(*alloc)(uint))
+{
+  MY_COLL_RULE rule[MY_MAX_COLL_RULE];
+  char errstr[128];
+  uchar   *newlengths;
+  uint16 **newweights;
+  const uchar *deflengths= uca_length;
+  uint16     **defweights= uca_weight;
+  int rc, i;
+  int ncontractions= 0;
+  
+  if (!cs->tailoring)
+    return 1;
+  
+  /* Parse ICU Collation Customization expression */
+  if ((rc= my_coll_rule_parse(rule, MY_MAX_COLL_RULE,
+                              cs->tailoring,
+                              cs->tailoring + strlen(cs->tailoring),
+                              errstr, sizeof(errstr))) < 0)
+  {
+    /* 
+      TODO: add error message reporting.
+      printf("Error: %d '%s'\n", rc, errstr);
+    */
+    return 1;
+  }
+  
+  if (!(newweights= (uint16**) (*alloc)(256*sizeof(uint16*))))
+    return 1;
+  bzero(newweights, 256*sizeof(uint16*));
+  
+  if (!(newlengths= (uchar*) (*alloc)(256)))
+    return 1;
+  
+  memcpy(newlengths, deflengths, 256);
+  
+  /*
+    Calculate maximum lenghts for the pages
+    which will be overwritten.
+  */
+  for (i=0; i < rc; i++)
+  {
+    if (!rule[i].curr[1]) /* If not a contraction */
+    {
+      uint pageb= (rule[i].base >> 8) & 0xFF;
+      uint pagec= (rule[i].curr[0] >> 8) & 0xFF;
+    
+      if (newlengths[pagec] < deflengths[pageb])
+        newlengths[pagec]= deflengths[pageb];
+    }
+    else
+      ncontractions++;
+  }
+  
+  for (i=0; i < rc;  i++)
+  {
+    uint pageb= (rule[i].base >> 8) & 0xFF;
+    uint pagec= (rule[i].curr[0] >> 8) & 0xFF;
+    uint chb, chc;
+    
+    if (rule[i].curr[1]) /* Skip contraction */
+      continue;
+    
+    if (!newweights[pagec])
+    {
+      /* Alloc new page and copy the default UCA weights */
+      uint size= 256*newlengths[pagec]*sizeof(uint16);
+      
+      if (!(newweights[pagec]= (uint16*) (*alloc)(size)))
+        return 1;
+      bzero((void*) newweights[pagec], size);
+      
+      for (chc=0 ; chc < 256; chc++)
+      {
+        memcpy(newweights[pagec] + chc*newlengths[pagec],
+               defweights[pagec] + chc*deflengths[pagec],
+               deflengths[pagec]*sizeof(uint16));
+      }
+    }
+    
+    /* 
+      Aply the alternative rule:
+      shift to the base character and primary difference.
+    */
+    chc= rule[i].curr[0] & 0xFF;
+    chb= rule[i].base & 0xFF;
+    memcpy(newweights[pagec] + chc*newlengths[pagec],
+           defweights[pageb] + chb*deflengths[pageb],
+           deflengths[pageb]*sizeof(uint16));
+    /* Apply primary difference */
+    newweights[pagec][chc*newlengths[pagec]]+= rule[i].diff[0];
+  }
+  
+  /* Copy non-overwritten pages from the default UCA weights */
+  for (i= 0; i < 256 ; i++)
+  {
+    if (!newweights[i])
+      newweights[i]= defweights[i];
+  }
+  
+  cs->sort_order= newlengths;
+  cs->sort_order_big= newweights;
+  cs->contractions= NULL;
+  
+  /* Now process contractions */
+  if (ncontractions)
+  {
+    uint size= 0x40*0x40*sizeof(uint16); /* 8K, for basic latin letter only */
+    if (!(cs->contractions= (uint16*) (*alloc)(size)))
+        return 1;
+    bzero((void*)cs->contractions, size);
+    for (i=0; i < rc; i++)
+    {
+      if (rule[i].curr[1])
+      {
+        uint pageb= (rule[i].base >> 8) & 0xFF;
+        uint chb= rule[i].base & 0xFF;
+        uint16 *offsb= defweights[pageb] + chb*deflengths[pageb];
+        uint offsc;
+        
+        if (offsb[1] || 
+            rule[i].curr[0] < 0x40 || rule[i].curr[0] > 0x7f ||
+            rule[i].curr[1] < 0x40 || rule[i].curr[1] > 0x7f)
+        {
+          /* 
+           TODO: add error reporting;
+           We support only basic latin letters contractions at this point.
+           Also, We don't support contractions with weight longer than one.
+           Otherwise, we'd need much more memory.
+          */
+          return 1;
+        }
+        offsc= (rule[i].curr[0]-0x40)*0x40+(rule[i].curr[1]-0x40);
+        
+        /* Copy base weight applying primary difference */
+        cs->contractions[offsc]= offsb[0] + rule[i].diff[0];
+      }
+    }
+  }
+  return 0;
+}
+
+
+/*
+  Universal CHARSET_INFO compatible wrappers
+  for the above internal functions.
+  Should work for any character set.
+*/
+
+static my_bool my_coll_init_uca(CHARSET_INFO *cs, void *(*alloc)(uint))
+{
+  //cs->pad_char= ' ';
+  return create_tailoring(cs, alloc);
+}
+
+static int my_strnncoll_any_uca(CHARSET_INFO *cs,
+                                const uchar *s, uint slen,
+                                const uchar *t, uint tlen,
+                                my_bool t_is_prefix)
+{
+  return my_strnncoll_uca(cs, &my_any_uca_scanner_handler,
+                          s, slen, t, tlen, t_is_prefix);
+}
+
+#if 0
+static int my_strnncollsp_any_uca(CHARSET_INFO *cs,
+                                  const uchar *s, uint slen,
+                                  const uchar *t, uint tlen,
+                                  my_bool diff_if_only_endspace_difference)
+{
+  return my_strnncollsp_uca(cs, &my_any_uca_scanner_handler,
+                            s, slen, t, tlen,
+                            diff_if_only_endspace_difference);
+}   
+
+static void my_hash_sort_any_uca(CHARSET_INFO *cs,
+                                 const uchar *s, uint slen,
+                                 ulong *n1, ulong *n2)
+{
+  my_hash_sort_uca(cs, &my_any_uca_scanner_handler, s, slen, n1, n2); 
+}
+
+static int my_strnxfrm_any_uca(CHARSET_INFO *cs, 
+                               uchar *dst, uint dstlen,
+                               const uchar *src, uint srclen)
+{
+  return my_strnxfrm_uca(cs, &my_any_uca_scanner_handler,
+                         dst, dstlen, src, srclen);
+}
+#endif
+
+//#ifdef HAVE_CHARSET_ucs2
+#if 0
+/*
+  UCS2 optimized CHARSET_INFO compatible wrappers.
+*/
+static int my_strnncoll_ucs2_uca(CHARSET_INFO *cs,
+                                 const uchar *s, uint slen,
+                                 const uchar *t, uint tlen,
+                                 my_bool t_is_prefix)
+{
+  return my_strnncoll_uca(cs, &my_ucs2_uca_scanner_handler,
+                          s, slen, t, tlen, t_is_prefix);
+}
+
+static int my_strnncollsp_ucs2_uca(CHARSET_INFO *cs,
+                                   const uchar *s, uint slen,
+                                   const uchar *t, uint tlen,
+                                   my_bool diff_if_only_endspace_difference)
+{
+  return my_strnncollsp_uca(cs, &my_ucs2_uca_scanner_handler,
+                            s, slen, t, tlen,
+                            diff_if_only_endspace_difference);
+}   
+
+static void my_hash_sort_ucs2_uca(CHARSET_INFO *cs,
+                                  const uchar *s, uint slen,
+                                  ulong *n1, ulong *n2)
+{
+  my_hash_sort_uca(cs, &my_ucs2_uca_scanner_handler, s, slen, n1, n2); 
+}
+
+static int my_strnxfrm_ucs2_uca(CHARSET_INFO *cs, 
+                                uchar *dst, uint dstlen,
+                                const uchar *src, uint srclen)
+{
+  return my_strnxfrm_uca(cs, &my_ucs2_uca_scanner_handler,
+                         dst, dstlen, src, srclen);
+}
+
+MY_COLLATION_HANDLER my_collation_ucs2_uca_handler =
+{
+    my_coll_init_uca,  /* init */
+    my_strnncoll_ucs2_uca,
+    my_strnncollsp_ucs2_uca,
+    my_strnxfrm_ucs2_uca,
+    my_strnxfrmlen_simple,
+    my_like_range_ucs2,
+    my_wildcmp_uca,
+    NULL,
+    my_instr_mb,
+    my_hash_sort_ucs2_uca,
+    my_propagate_complex
+};
+
+CHARSET_INFO my_charset_ucs2_general_uca=
+{
+    128,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_unicode_ci", /* name         */
+    "",                        /* comment      */
+    "",                        /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    uca_length,                /* sort_order   */
+    NULL,              /* contractions */
+    uca_weight,                /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+CHARSET_INFO my_charset_ucs2_icelandic_uca_ci=
+{
+    129,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_icelandic_ci",/* name         */
+    "",                        /* comment      */
+    icelandic,         /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+CHARSET_INFO my_charset_ucs2_latvian_uca_ci=
+{
+    130,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_latvian_ci", /* name         */
+    "",                        /* comment      */
+    latvian,           /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+CHARSET_INFO my_charset_ucs2_romanian_uca_ci=
+{
+    131,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_romanian_ci",        /* name         */
+    "",                        /* comment      */
+    romanian,          /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+CHARSET_INFO my_charset_ucs2_slovenian_uca_ci=
+{
+    132,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_slovenian_ci",/* name         */
+    "",                        /* comment      */
+    slovenian,         /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+CHARSET_INFO my_charset_ucs2_polish_uca_ci=
+{
+    133,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_polish_ci",  /* name         */
+    "",                        /* comment      */
+    polish,            /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+CHARSET_INFO my_charset_ucs2_estonian_uca_ci=
+{
+    134,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_estonian_ci",        /* name         */
+    "",                        /* comment      */
+    estonian,          /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+CHARSET_INFO my_charset_ucs2_spanish_uca_ci=
+{
+    135,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_spanish_ci", /* name         */
+    "",                        /* comment      */
+    spanish,           /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+CHARSET_INFO my_charset_ucs2_swedish_uca_ci=
+{
+    136,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_swedish_ci", /* name         */
+    "",                        /* comment      */
+    swedish,           /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+CHARSET_INFO my_charset_ucs2_turkish_uca_ci=
+{
+    137,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_turkish_ci", /* name         */
+    "",                        /* comment      */
+    turkish,           /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_turkish, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+CHARSET_INFO my_charset_ucs2_czech_uca_ci=
+{
+    138,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_czech_ci",   /* name         */
+    "",                        /* comment      */
+    czech,             /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+
+CHARSET_INFO my_charset_ucs2_danish_uca_ci=
+{
+    139,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_danish_ci",  /* name         */
+    "",                        /* comment      */
+    danish,            /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci=
+{
+    140,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_lithuanian_ci",/* name         */
+    "",                        /* comment      */
+    lithuanian,                /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+CHARSET_INFO my_charset_ucs2_slovak_uca_ci=
+{
+    141,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_slovak_ci",  /* name         */
+    "",                        /* comment      */
+    slovak,            /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+CHARSET_INFO my_charset_ucs2_spanish2_uca_ci=
+{
+    142,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_spanish2_ci",        /* name         */
+    "",                        /* comment      */
+    spanish2,          /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+
+CHARSET_INFO my_charset_ucs2_roman_uca_ci=
+{
+    143,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_roman_ci",   /* name         */
+    "",                        /* comment      */
+    roman,             /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+
+CHARSET_INFO my_charset_ucs2_persian_uca_ci=
+{
+    144,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_persian_ci", /* name         */
+    "",                        /* comment      */
+    persian,           /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+
+CHARSET_INFO my_charset_ucs2_esperanto_uca_ci=
+{
+    145,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_esperanto_ci",/* name         */
+    "",                        /* comment      */
+    esperanto,         /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+
+CHARSET_INFO my_charset_ucs2_hungarian_uca_ci=
+{
+    146,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    "ucs2",            /* cs name    */
+    "ucs2_hungarian_ci",/* name         */
+    "",                        /* comment      */
+    hungarian,         /* tailoring    */
+    NULL,              /* ctype        */
+    NULL,              /* to_lower     */
+    NULL,              /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    8,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    2,                 /* mbminlen     */
+    2,                 /* mbmaxlen     */
+    9,                 /* min_sort_char */
+    0xFFFF,            /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_ucs2_handler,
+    &my_collation_ucs2_uca_handler
+};
+
+
+#endif
+
+
+#ifdef HAVE_CHARSET_utf8
+static MY_COLLATION_HANDLER my_collation_any_uca_handler =
+{
+    my_coll_init_uca,  /* init */
+    my_strnncoll_any_uca
+    //my_strnncollsp_any_uca,
+    //my_strnxfrm_any_uca,
+    //my_strnxfrmlen_simple,
+    //my_like_range_mb,
+    //my_wildcmp_uca,
+    //NULL,
+    //my_instr_mb,
+    //my_hash_sort_any_uca,
+    //my_propagate_complex
+};
+
+#if 0
+/* 
+  We consider bytes with code more than 127 as a letter.
+  This garantees that word boundaries work fine with regular
+  expressions. Note, there is no need to mark byte 255  as a
+  letter, it is illegal byte in UTF8.
+*/
+static uchar ctype_utf8[] = {
+    0,
+   32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32,
+   32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+   72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+  132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16,
+   16,129,129,129,129,129,129,  1,  1,  1,  1,  1,  1,  1,  1,  1,
+    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 16, 16, 16, 16, 16,
+   16,130,130,130,130,130,130,  2,  2,  2,  2,  2,  2,  2,  2,  2,
+    2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2, 16, 16, 16, 16, 32,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  0
+};
+#endif
+
+namespace stardict_collation {
+
+extern MY_CHARSET_HANDLER my_charset_utf8_handler;
+
+CHARSET_INFO my_charset_utf8_general_uca_ci=
+{
+    //192,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_unicode_ci",       /* name         */
+    //"",                      /* comment      */
+    "",                        /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    uca_length,                /* sort_order   */
+    NULL,              /* contractions */
+    uca_weight,                /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+
+CHARSET_INFO my_charset_utf8_icelandic_uca_ci=
+{
+    //193,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_icelandic_ci",/* name         */
+    //"",                      /* comment      */
+    icelandic,         /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_latvian_uca_ci=
+{
+    //194,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_latvian_ci",       /* name         */
+    //"",                      /* comment      */
+    latvian,           /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_romanian_uca_ci=
+{
+    //195,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_romanian_ci",      /* name         */
+    //"",                      /* comment      */
+    romanian,          /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_slovenian_uca_ci=
+{
+    //196,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_slovenian_ci",/* name         */
+    //"",                      /* comment      */
+    slovenian,         /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_polish_uca_ci=
+{
+    //197,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_polish_ci",        /* name         */
+    //"",                      /* comment      */
+    polish,            /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_estonian_uca_ci=
+{
+    //198,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_estonian_ci",      /* name         */
+    //"",                      /* comment      */
+    estonian,          /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_spanish_uca_ci=
+{
+    //199,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_spanish_ci",       /* name         */
+    //"",                      /* comment      */
+    spanish,           /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_swedish_uca_ci=
+{
+    //200,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_swedish_ci",       /* name         */
+    //"",                      /* comment      */
+    swedish,           /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_turkish_uca_ci=
+{
+    //201,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_turkish_ci",       /* name         */
+    //"",                      /* comment      */
+    turkish,           /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    //my_unicase_turkish, /* caseinfo     */
+    my_unicase_default,
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //2,                  /* caseup_multiply  */
+    //2,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_czech_uca_ci=
+{
+    //202,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_czech_ci", /* name         */
+    //"",                      /* comment      */
+    czech,             /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+
+CHARSET_INFO my_charset_utf8_danish_uca_ci=
+{
+    //203,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_danish_ci",        /* name         */
+    //"",                      /* comment      */
+    danish,            /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_lithuanian_uca_ci=
+{
+    //204,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_lithuanian_ci",/* name         */
+    //"",                      /* comment      */
+    lithuanian,                /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_slovak_uca_ci=
+{
+    //205,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_slovak_ci",        /* name         */
+    //"",                      /* comment      */
+    slovak,            /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_spanish2_uca_ci=
+{
+    //206,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_spanish2_ci",      /* name         */
+    //"",                      /* comment      */
+    spanish2,          /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_roman_uca_ci=
+{
+    //207,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_roman_ci", /* name         */
+    //"",                      /* comment      */
+    roman,             /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_persian_uca_ci=
+{
+    //208,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_persian_ci",       /* name         */
+    //"",                      /* comment      */
+    persian,           /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_esperanto_uca_ci=
+{
+    //209,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_esperanto_ci",/* name         */
+    //"",                      /* comment      */
+    esperanto,         /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+CHARSET_INFO my_charset_utf8_hungarian_uca_ci=
+{
+    //210,0,0,         /* number       */
+    //MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE,
+    //"utf8",          /* cs name    */
+    //"utf8_hungarian_ci",/* name         */
+    //"",                      /* comment      */
+    hungarian,         /* tailoring    */
+    //ctype_utf8,              /* ctype        */
+    //NULL,            /* to_lower     */
+    //NULL,            /* to_upper     */
+    NULL,              /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    //NULL,            /* tab_to_uni   */
+    //NULL,            /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,            /* state_map    */
+    //NULL,            /* ident_map    */
+    //8,                       /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                       /* mbminlen     */
+    //3,                       /* mbmaxlen     */
+    //9,                       /* min_sort_char */
+    //0xFFFF,          /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_any_uca_handler
+};
+
+}; //namespace
+
+#endif /* HAVE_CHARSET_utf8 */
+
+#endif /* HAVE_UCA_COLLATIONS */
diff --git a/src/lib/ctype-utf8.cpp b/src/lib/ctype-utf8.cpp
new file mode 100644 (file)
index 0000000..4e12b4f
--- /dev/null
@@ -0,0 +1,4166 @@
+/* Copyright (C) 2000 MySQL AB
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with this library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+   MA 02111-1307, USA */
+
+/* UTF8 according RFC 2279 */
+/* Written by Alexander Barkov <bar@udm.net> */
+
+/* Modified by Hu Zheng <huzheng_001@163.com> for StarDict. 2006.6.13 */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "my_global.h"
+#include "m_string.h"
+#include "m_ctype.h"
+//#include <errno.h>
+
+using namespace stardict_collation;
+
+//#ifndef EILSEQ
+//#define EILSEQ ENOENT
+//#endif
+
+#ifndef HAVE_CHARSET_utf8
+#define HAVE_CHARSET_utf8
+#endif
+
+#ifdef HAVE_CHARSET_utf8
+#define HAVE_UNIDATA
+#endif
+
+#ifdef HAVE_CHARSET_ucs2
+#define HAVE_UNIDATA
+#endif
+
+#ifdef HAVE_UNIDATA
+
+//#include "my_uctype.h"
+
+static MY_UNICASE_INFO plane00[]={
+  {0x0000,0x0000,0x0000},  {0x0001,0x0001,0x0001},
+  {0x0002,0x0002,0x0002},  {0x0003,0x0003,0x0003},
+  {0x0004,0x0004,0x0004},  {0x0005,0x0005,0x0005},
+  {0x0006,0x0006,0x0006},  {0x0007,0x0007,0x0007},
+  {0x0008,0x0008,0x0008},  {0x0009,0x0009,0x0009},
+  {0x000A,0x000A,0x000A},  {0x000B,0x000B,0x000B},
+  {0x000C,0x000C,0x000C},  {0x000D,0x000D,0x000D},
+  {0x000E,0x000E,0x000E},  {0x000F,0x000F,0x000F},
+  {0x0010,0x0010,0x0010},  {0x0011,0x0011,0x0011},
+  {0x0012,0x0012,0x0012},  {0x0013,0x0013,0x0013},
+  {0x0014,0x0014,0x0014},  {0x0015,0x0015,0x0015},
+  {0x0016,0x0016,0x0016},  {0x0017,0x0017,0x0017},
+  {0x0018,0x0018,0x0018},  {0x0019,0x0019,0x0019},
+  {0x001A,0x001A,0x001A},  {0x001B,0x001B,0x001B},
+  {0x001C,0x001C,0x001C},  {0x001D,0x001D,0x001D},
+  {0x001E,0x001E,0x001E},  {0x001F,0x001F,0x001F},
+  {0x0020,0x0020,0x0020},  {0x0021,0x0021,0x0021},
+  {0x0022,0x0022,0x0022},  {0x0023,0x0023,0x0023},
+  {0x0024,0x0024,0x0024},  {0x0025,0x0025,0x0025},
+  {0x0026,0x0026,0x0026},  {0x0027,0x0027,0x0027},
+  {0x0028,0x0028,0x0028},  {0x0029,0x0029,0x0029},
+  {0x002A,0x002A,0x002A},  {0x002B,0x002B,0x002B},
+  {0x002C,0x002C,0x002C},  {0x002D,0x002D,0x002D},
+  {0x002E,0x002E,0x002E},  {0x002F,0x002F,0x002F},
+  {0x0030,0x0030,0x0030},  {0x0031,0x0031,0x0031},
+  {0x0032,0x0032,0x0032},  {0x0033,0x0033,0x0033},
+  {0x0034,0x0034,0x0034},  {0x0035,0x0035,0x0035},
+  {0x0036,0x0036,0x0036},  {0x0037,0x0037,0x0037},
+  {0x0038,0x0038,0x0038},  {0x0039,0x0039,0x0039},
+  {0x003A,0x003A,0x003A},  {0x003B,0x003B,0x003B},
+  {0x003C,0x003C,0x003C},  {0x003D,0x003D,0x003D},
+  {0x003E,0x003E,0x003E},  {0x003F,0x003F,0x003F},
+  {0x0040,0x0040,0x0040},  {0x0041,0x0061,0x0041},
+  {0x0042,0x0062,0x0042},  {0x0043,0x0063,0x0043},
+  {0x0044,0x0064,0x0044},  {0x0045,0x0065,0x0045},
+  {0x0046,0x0066,0x0046},  {0x0047,0x0067,0x0047},
+  {0x0048,0x0068,0x0048},  {0x0049,0x0069,0x0049},
+  {0x004A,0x006A,0x004A},  {0x004B,0x006B,0x004B},
+  {0x004C,0x006C,0x004C},  {0x004D,0x006D,0x004D},
+  {0x004E,0x006E,0x004E},  {0x004F,0x006F,0x004F},
+  {0x0050,0x0070,0x0050},  {0x0051,0x0071,0x0051},
+  {0x0052,0x0072,0x0052},  {0x0053,0x0073,0x0053},
+  {0x0054,0x0074,0x0054},  {0x0055,0x0075,0x0055},
+  {0x0056,0x0076,0x0056},  {0x0057,0x0077,0x0057},
+  {0x0058,0x0078,0x0058},  {0x0059,0x0079,0x0059},
+  {0x005A,0x007A,0x005A},  {0x005B,0x005B,0x005B},
+  {0x005C,0x005C,0x005C},  {0x005D,0x005D,0x005D},
+  {0x005E,0x005E,0x005E},  {0x005F,0x005F,0x005F},
+  {0x0060,0x0060,0x0060},  {0x0041,0x0061,0x0041},
+  {0x0042,0x0062,0x0042},  {0x0043,0x0063,0x0043},
+  {0x0044,0x0064,0x0044},  {0x0045,0x0065,0x0045},
+  {0x0046,0x0066,0x0046},  {0x0047,0x0067,0x0047},
+  {0x0048,0x0068,0x0048},  {0x0049,0x0069,0x0049},
+  {0x004A,0x006A,0x004A},  {0x004B,0x006B,0x004B},
+  {0x004C,0x006C,0x004C},  {0x004D,0x006D,0x004D},
+  {0x004E,0x006E,0x004E},  {0x004F,0x006F,0x004F},
+  {0x0050,0x0070,0x0050},  {0x0051,0x0071,0x0051},
+  {0x0052,0x0072,0x0052},  {0x0053,0x0073,0x0053},
+  {0x0054,0x0074,0x0054},  {0x0055,0x0075,0x0055},
+  {0x0056,0x0076,0x0056},  {0x0057,0x0077,0x0057},
+  {0x0058,0x0078,0x0058},  {0x0059,0x0079,0x0059},
+  {0x005A,0x007A,0x005A},  {0x007B,0x007B,0x007B},
+  {0x007C,0x007C,0x007C},  {0x007D,0x007D,0x007D},
+  {0x007E,0x007E,0x007E},  {0x007F,0x007F,0x007F},
+  {0x0080,0x0080,0x0080},  {0x0081,0x0081,0x0081},
+  {0x0082,0x0082,0x0082},  {0x0083,0x0083,0x0083},
+  {0x0084,0x0084,0x0084},  {0x0085,0x0085,0x0085},
+  {0x0086,0x0086,0x0086},  {0x0087,0x0087,0x0087},
+  {0x0088,0x0088,0x0088},  {0x0089,0x0089,0x0089},
+  {0x008A,0x008A,0x008A},  {0x008B,0x008B,0x008B},
+  {0x008C,0x008C,0x008C},  {0x008D,0x008D,0x008D},
+  {0x008E,0x008E,0x008E},  {0x008F,0x008F,0x008F},
+  {0x0090,0x0090,0x0090},  {0x0091,0x0091,0x0091},
+  {0x0092,0x0092,0x0092},  {0x0093,0x0093,0x0093},
+  {0x0094,0x0094,0x0094},  {0x0095,0x0095,0x0095},
+  {0x0096,0x0096,0x0096},  {0x0097,0x0097,0x0097},
+  {0x0098,0x0098,0x0098},  {0x0099,0x0099,0x0099},
+  {0x009A,0x009A,0x009A},  {0x009B,0x009B,0x009B},
+  {0x009C,0x009C,0x009C},  {0x009D,0x009D,0x009D},
+  {0x009E,0x009E,0x009E},  {0x009F,0x009F,0x009F},
+  {0x00A0,0x00A0,0x00A0},  {0x00A1,0x00A1,0x00A1},
+  {0x00A2,0x00A2,0x00A2},  {0x00A3,0x00A3,0x00A3},
+  {0x00A4,0x00A4,0x00A4},  {0x00A5,0x00A5,0x00A5},
+  {0x00A6,0x00A6,0x00A6},  {0x00A7,0x00A7,0x00A7},
+  {0x00A8,0x00A8,0x00A8},  {0x00A9,0x00A9,0x00A9},
+  {0x00AA,0x00AA,0x00AA},  {0x00AB,0x00AB,0x00AB},
+  {0x00AC,0x00AC,0x00AC},  {0x00AD,0x00AD,0x00AD},
+  {0x00AE,0x00AE,0x00AE},  {0x00AF,0x00AF,0x00AF},
+  {0x00B0,0x00B0,0x00B0},  {0x00B1,0x00B1,0x00B1},
+  {0x00B2,0x00B2,0x00B2},  {0x00B3,0x00B3,0x00B3},
+  {0x00B4,0x00B4,0x00B4},  {0x039C,0x00B5,0x039C},
+  {0x00B6,0x00B6,0x00B6},  {0x00B7,0x00B7,0x00B7},
+  {0x00B8,0x00B8,0x00B8},  {0x00B9,0x00B9,0x00B9},
+  {0x00BA,0x00BA,0x00BA},  {0x00BB,0x00BB,0x00BB},
+  {0x00BC,0x00BC,0x00BC},  {0x00BD,0x00BD,0x00BD},
+  {0x00BE,0x00BE,0x00BE},  {0x00BF,0x00BF,0x00BF},
+  {0x00C0,0x00E0,0x0041},  {0x00C1,0x00E1,0x0041},
+  {0x00C2,0x00E2,0x0041},  {0x00C3,0x00E3,0x0041},
+  {0x00C4,0x00E4,0x0041},  {0x00C5,0x00E5,0x0041},
+  {0x00C6,0x00E6,0x00C6},  {0x00C7,0x00E7,0x0043},
+  {0x00C8,0x00E8,0x0045},  {0x00C9,0x00E9,0x0045},
+  {0x00CA,0x00EA,0x0045},  {0x00CB,0x00EB,0x0045},
+  {0x00CC,0x00EC,0x0049},  {0x00CD,0x00ED,0x0049},
+  {0x00CE,0x00EE,0x0049},  {0x00CF,0x00EF,0x0049},
+  {0x00D0,0x00F0,0x00D0},  {0x00D1,0x00F1,0x004E},
+  {0x00D2,0x00F2,0x004F},  {0x00D3,0x00F3,0x004F},
+  {0x00D4,0x00F4,0x004F},  {0x00D5,0x00F5,0x004F},
+  {0x00D6,0x00F6,0x004F},  {0x00D7,0x00D7,0x00D7},
+  {0x00D8,0x00F8,0x00D8},  {0x00D9,0x00F9,0x0055},
+  {0x00DA,0x00FA,0x0055},  {0x00DB,0x00FB,0x0055},
+  {0x00DC,0x00FC,0x0055},  {0x00DD,0x00FD,0x0059},
+  {0x00DE,0x00FE,0x00DE},  {0x00DF,0x00DF,0x00DF},
+  {0x00C0,0x00E0,0x0041},  {0x00C1,0x00E1,0x0041},
+  {0x00C2,0x00E2,0x0041},  {0x00C3,0x00E3,0x0041},
+  {0x00C4,0x00E4,0x0041},  {0x00C5,0x00E5,0x0041},
+  {0x00C6,0x00E6,0x00C6},  {0x00C7,0x00E7,0x0043},
+  {0x00C8,0x00E8,0x0045},  {0x00C9,0x00E9,0x0045},
+  {0x00CA,0x00EA,0x0045},  {0x00CB,0x00EB,0x0045},
+  {0x00CC,0x00EC,0x0049},  {0x00CD,0x00ED,0x0049},
+  {0x00CE,0x00EE,0x0049},  {0x00CF,0x00EF,0x0049},
+  {0x00D0,0x00F0,0x00D0},  {0x00D1,0x00F1,0x004E},
+  {0x00D2,0x00F2,0x004F},  {0x00D3,0x00F3,0x004F},
+  {0x00D4,0x00F4,0x004F},  {0x00D5,0x00F5,0x004F},
+  {0x00D6,0x00F6,0x004F},  {0x00F7,0x00F7,0x00F7},
+  {0x00D8,0x00F8,0x00D8},  {0x00D9,0x00F9,0x0055},
+  {0x00DA,0x00FA,0x0055},  {0x00DB,0x00FB,0x0055},
+  {0x00DC,0x00FC,0x0055},  {0x00DD,0x00FD,0x0059},
+  {0x00DE,0x00FE,0x00DE},  {0x0178,0x00FF,0x0059}
+};
+
+
+
+static MY_UNICASE_INFO plane01[]={
+  {0x0100,0x0101,0x0041},  {0x0100,0x0101,0x0041},
+  {0x0102,0x0103,0x0041},  {0x0102,0x0103,0x0041},
+  {0x0104,0x0105,0x0041},  {0x0104,0x0105,0x0041},
+  {0x0106,0x0107,0x0043},  {0x0106,0x0107,0x0043},
+  {0x0108,0x0109,0x0043},  {0x0108,0x0109,0x0043},
+  {0x010A,0x010B,0x0043},  {0x010A,0x010B,0x0043},
+  {0x010C,0x010D,0x0043},  {0x010C,0x010D,0x0043},
+  {0x010E,0x010F,0x0044},  {0x010E,0x010F,0x0044},
+  {0x0110,0x0111,0x0110},  {0x0110,0x0111,0x0110},
+  {0x0112,0x0113,0x0045},  {0x0112,0x0113,0x0045},
+  {0x0114,0x0115,0x0045},  {0x0114,0x0115,0x0045},
+  {0x0116,0x0117,0x0045},  {0x0116,0x0117,0x0045},
+  {0x0118,0x0119,0x0045},  {0x0118,0x0119,0x0045},
+  {0x011A,0x011B,0x0045},  {0x011A,0x011B,0x0045},
+  {0x011C,0x011D,0x0047},  {0x011C,0x011D,0x0047},
+  {0x011E,0x011F,0x0047},  {0x011E,0x011F,0x0047},
+  {0x0120,0x0121,0x0047},  {0x0120,0x0121,0x0047},
+  {0x0122,0x0123,0x0047},  {0x0122,0x0123,0x0047},
+  {0x0124,0x0125,0x0048},  {0x0124,0x0125,0x0048},
+  {0x0126,0x0127,0x0126},  {0x0126,0x0127,0x0126},
+  {0x0128,0x0129,0x0049},  {0x0128,0x0129,0x0049},
+  {0x012A,0x012B,0x0049},  {0x012A,0x012B,0x0049},
+  {0x012C,0x012D,0x0049},  {0x012C,0x012D,0x0049},
+  {0x012E,0x012F,0x0049},  {0x012E,0x012F,0x0049},
+  {0x0130,0x0069,0x0049},  {0x0049,0x0131,0x0049},
+  {0x0132,0x0133,0x0132},  {0x0132,0x0133,0x0132},
+  {0x0134,0x0135,0x004A},  {0x0134,0x0135,0x004A},
+  {0x0136,0x0137,0x004B},  {0x0136,0x0137,0x004B},
+  {0x0138,0x0138,0x0138},  {0x0139,0x013A,0x004C},
+  {0x0139,0x013A,0x004C},  {0x013B,0x013C,0x004C},
+  {0x013B,0x013C,0x004C},  {0x013D,0x013E,0x004C},
+  {0x013D,0x013E,0x004C},  {0x013F,0x0140,0x013F},
+  {0x013F,0x0140,0x013F},  {0x0141,0x0142,0x0141},
+  {0x0141,0x0142,0x0141},  {0x0143,0x0144,0x004E},
+  {0x0143,0x0144,0x004E},  {0x0145,0x0146,0x004E},
+  {0x0145,0x0146,0x004E},  {0x0147,0x0148,0x004E},
+  {0x0147,0x0148,0x004E},  {0x0149,0x0149,0x0149},
+  {0x014A,0x014B,0x014A},  {0x014A,0x014B,0x014A},
+  {0x014C,0x014D,0x004F},  {0x014C,0x014D,0x004F},
+  {0x014E,0x014F,0x004F},  {0x014E,0x014F,0x004F},
+  {0x0150,0x0151,0x004F},  {0x0150,0x0151,0x004F},
+  {0x0152,0x0153,0x0152},  {0x0152,0x0153,0x0152},
+  {0x0154,0x0155,0x0052},  {0x0154,0x0155,0x0052},
+  {0x0156,0x0157,0x0052},  {0x0156,0x0157,0x0052},
+  {0x0158,0x0159,0x0052},  {0x0158,0x0159,0x0052},
+  {0x015A,0x015B,0x0053},  {0x015A,0x015B,0x0053},
+  {0x015C,0x015D,0x0053},  {0x015C,0x015D,0x0053},
+  {0x015E,0x015F,0x0053},  {0x015E,0x015F,0x0053},
+  {0x0160,0x0161,0x0053},  {0x0160,0x0161,0x0053},
+  {0x0162,0x0163,0x0054},  {0x0162,0x0163,0x0054},
+  {0x0164,0x0165,0x0054},  {0x0164,0x0165,0x0054},
+  {0x0166,0x0167,0x0166},  {0x0166,0x0167,0x0166},
+  {0x0168,0x0169,0x0055},  {0x0168,0x0169,0x0055},
+  {0x016A,0x016B,0x0055},  {0x016A,0x016B,0x0055},
+  {0x016C,0x016D,0x0055},  {0x016C,0x016D,0x0055},
+  {0x016E,0x016F,0x0055},  {0x016E,0x016F,0x0055},
+  {0x0170,0x0171,0x0055},  {0x0170,0x0171,0x0055},
+  {0x0172,0x0173,0x0055},  {0x0172,0x0173,0x0055},
+  {0x0174,0x0175,0x0057},  {0x0174,0x0175,0x0057},
+  {0x0176,0x0177,0x0059},  {0x0176,0x0177,0x0059},
+  {0x0178,0x00FF,0x0059},  {0x0179,0x017A,0x005A},
+  {0x0179,0x017A,0x005A},  {0x017B,0x017C,0x005A},
+  {0x017B,0x017C,0x005A},  {0x017D,0x017E,0x005A},
+  {0x017D,0x017E,0x005A},  {0x0053,0x017F,0x0053},
+  {0x0180,0x0180,0x0180},  {0x0181,0x0253,0x0181},
+  {0x0182,0x0183,0x0182},  {0x0182,0x0183,0x0182},
+  {0x0184,0x0185,0x0184},  {0x0184,0x0185,0x0184},
+  {0x0186,0x0254,0x0186},  {0x0187,0x0188,0x0187},
+  {0x0187,0x0188,0x0187},  {0x0189,0x0256,0x0189},
+  {0x018A,0x0257,0x018A},  {0x018B,0x018C,0x018B},
+  {0x018B,0x018C,0x018B},  {0x018D,0x018D,0x018D},
+  {0x018E,0x01DD,0x018E},  {0x018F,0x0259,0x018F},
+  {0x0190,0x025B,0x0190},  {0x0191,0x0192,0x0191},
+  {0x0191,0x0192,0x0191},  {0x0193,0x0260,0x0193},
+  {0x0194,0x0263,0x0194},  {0x01F6,0x0195,0x01F6},
+  {0x0196,0x0269,0x0196},  {0x0197,0x0268,0x0197},
+  {0x0198,0x0199,0x0198},  {0x0198,0x0199,0x0198},
+  {0x019A,0x019A,0x019A},  {0x019B,0x019B,0x019B},
+  {0x019C,0x026F,0x019C},  {0x019D,0x0272,0x019D},
+  {0x019E,0x019E,0x019E},  {0x019F,0x0275,0x019F},
+  {0x01A0,0x01A1,0x004F},  {0x01A0,0x01A1,0x004F},
+  {0x01A2,0x01A3,0x01A2},  {0x01A2,0x01A3,0x01A2},
+  {0x01A4,0x01A5,0x01A4},  {0x01A4,0x01A5,0x01A4},
+  {0x01A6,0x0280,0x01A6},  {0x01A7,0x01A8,0x01A7},
+  {0x01A7,0x01A8,0x01A7},  {0x01A9,0x0283,0x01A9},
+  {0x01AA,0x01AA,0x01AA},  {0x01AB,0x01AB,0x01AB},
+  {0x01AC,0x01AD,0x01AC},  {0x01AC,0x01AD,0x01AC},
+  {0x01AE,0x0288,0x01AE},  {0x01AF,0x01B0,0x0055},
+  {0x01AF,0x01B0,0x0055},  {0x01B1,0x028A,0x01B1},
+  {0x01B2,0x028B,0x01B2},  {0x01B3,0x01B4,0x01B3},
+  {0x01B3,0x01B4,0x01B3},  {0x01B5,0x01B6,0x01B5},
+  {0x01B5,0x01B6,0x01B5},  {0x01B7,0x0292,0x01B7},
+  {0x01B8,0x01B9,0x01B8},  {0x01B8,0x01B9,0x01B8},
+  {0x01BA,0x01BA,0x01BA},  {0x01BB,0x01BB,0x01BB},
+  {0x01BC,0x01BD,0x01BC},  {0x01BC,0x01BD,0x01BC},
+  {0x01BE,0x01BE,0x01BE},  {0x01F7,0x01BF,0x01F7},
+  {0x01C0,0x01C0,0x01C0},  {0x01C1,0x01C1,0x01C1},
+  {0x01C2,0x01C2,0x01C2},  {0x01C3,0x01C3,0x01C3},
+  {0x01C4,0x01C6,0x01C4},  {0x01C4,0x01C6,0x01C4},
+  {0x01C4,0x01C6,0x01C4},  {0x01C7,0x01C9,0x01C7},
+  {0x01C7,0x01C9,0x01C7},  {0x01C7,0x01C9,0x01C7},
+  {0x01CA,0x01CC,0x01CA},  {0x01CA,0x01CC,0x01CA},
+  {0x01CA,0x01CC,0x01CA},  {0x01CD,0x01CE,0x0041},
+  {0x01CD,0x01CE,0x0041},  {0x01CF,0x01D0,0x0049},
+  {0x01CF,0x01D0,0x0049},  {0x01D1,0x01D2,0x004F},
+  {0x01D1,0x01D2,0x004F},  {0x01D3,0x01D4,0x0055},
+  {0x01D3,0x01D4,0x0055},  {0x01D5,0x01D6,0x0055},
+  {0x01D5,0x01D6,0x0055},  {0x01D7,0x01D8,0x0055},
+  {0x01D7,0x01D8,0x0055},  {0x01D9,0x01DA,0x0055},
+  {0x01D9,0x01DA,0x0055},  {0x01DB,0x01DC,0x0055},
+  {0x01DB,0x01DC,0x0055},  {0x018E,0x01DD,0x018E},
+  {0x01DE,0x01DF,0x0041},  {0x01DE,0x01DF,0x0041},
+  {0x01E0,0x01E1,0x0041},  {0x01E0,0x01E1,0x0041},
+  {0x01E2,0x01E3,0x00C6},  {0x01E2,0x01E3,0x00C6},
+  {0x01E4,0x01E5,0x01E4},  {0x01E4,0x01E5,0x01E4},
+  {0x01E6,0x01E7,0x0047},  {0x01E6,0x01E7,0x0047},
+  {0x01E8,0x01E9,0x004B},  {0x01E8,0x01E9,0x004B},
+  {0x01EA,0x01EB,0x004F},  {0x01EA,0x01EB,0x004F},
+  {0x01EC,0x01ED,0x004F},  {0x01EC,0x01ED,0x004F},
+  {0x01EE,0x01EF,0x01B7},  {0x01EE,0x01EF,0x01B7},
+  {0x01F0,0x01F0,0x004A},  {0x01F1,0x01F3,0x01F1},
+  {0x01F1,0x01F3,0x01F1},  {0x01F1,0x01F3,0x01F1},
+  {0x01F4,0x01F5,0x0047},  {0x01F4,0x01F5,0x0047},
+  {0x01F6,0x0195,0x01F6},  {0x01F7,0x01BF,0x01F7},
+  {0x01F8,0x01F9,0x004E},  {0x01F8,0x01F9,0x004E},
+  {0x01FA,0x01FB,0x0041},  {0x01FA,0x01FB,0x0041},
+  {0x01FC,0x01FD,0x00C6},  {0x01FC,0x01FD,0x00C6},
+  {0x01FE,0x01FF,0x00D8},  {0x01FE,0x01FF,0x00D8}
+};
+
+static MY_UNICASE_INFO plane02[]={
+  {0x0200,0x0201,0x0041},  {0x0200,0x0201,0x0041},
+  {0x0202,0x0203,0x0041},  {0x0202,0x0203,0x0041},
+  {0x0204,0x0205,0x0045},  {0x0204,0x0205,0x0045},
+  {0x0206,0x0207,0x0045},  {0x0206,0x0207,0x0045},
+  {0x0208,0x0209,0x0049},  {0x0208,0x0209,0x0049},
+  {0x020A,0x020B,0x0049},  {0x020A,0x020B,0x0049},
+  {0x020C,0x020D,0x004F},  {0x020C,0x020D,0x004F},
+  {0x020E,0x020F,0x004F},  {0x020E,0x020F,0x004F},
+  {0x0210,0x0211,0x0052},  {0x0210,0x0211,0x0052},
+  {0x0212,0x0213,0x0052},  {0x0212,0x0213,0x0052},
+  {0x0214,0x0215,0x0055},  {0x0214,0x0215,0x0055},
+  {0x0216,0x0217,0x0055},  {0x0216,0x0217,0x0055},
+  {0x0218,0x0219,0x0053},  {0x0218,0x0219,0x0053},
+  {0x021A,0x021B,0x0054},  {0x021A,0x021B,0x0054},
+  {0x021C,0x021D,0x021C},  {0x021C,0x021D,0x021C},
+  {0x021E,0x021F,0x0048},  {0x021E,0x021F,0x0048},
+  {0x0220,0x0220,0x0220},  {0x0221,0x0221,0x0221},
+  {0x0222,0x0223,0x0222},  {0x0222,0x0223,0x0222},
+  {0x0224,0x0225,0x0224},  {0x0224,0x0225,0x0224},
+  {0x0226,0x0227,0x0041},  {0x0226,0x0227,0x0041},
+  {0x0228,0x0229,0x0045},  {0x0228,0x0229,0x0045},
+  {0x022A,0x022B,0x004F},  {0x022A,0x022B,0x004F},
+  {0x022C,0x022D,0x004F},  {0x022C,0x022D,0x004F},
+  {0x022E,0x022F,0x004F},  {0x022E,0x022F,0x004F},
+  {0x0230,0x0231,0x004F},  {0x0230,0x0231,0x004F},
+  {0x0232,0x0233,0x0059},  {0x0232,0x0233,0x0059},
+  {0x0234,0x0234,0x0234},  {0x0235,0x0235,0x0235},
+  {0x0236,0x0236,0x0236},  {0x0237,0x0237,0x0237},
+  {0x0238,0x0238,0x0238},  {0x0239,0x0239,0x0239},
+  {0x023A,0x023A,0x023A},  {0x023B,0x023B,0x023B},
+  {0x023C,0x023C,0x023C},  {0x023D,0x023D,0x023D},
+  {0x023E,0x023E,0x023E},  {0x023F,0x023F,0x023F},
+  {0x0240,0x0240,0x0240},  {0x0241,0x0241,0x0241},
+  {0x0242,0x0242,0x0242},  {0x0243,0x0243,0x0243},
+  {0x0244,0x0244,0x0244},  {0x0245,0x0245,0x0245},
+  {0x0246,0x0246,0x0246},  {0x0247,0x0247,0x0247},
+  {0x0248,0x0248,0x0248},  {0x0249,0x0249,0x0249},
+  {0x024A,0x024A,0x024A},  {0x024B,0x024B,0x024B},
+  {0x024C,0x024C,0x024C},  {0x024D,0x024D,0x024D},
+  {0x024E,0x024E,0x024E},  {0x024F,0x024F,0x024F},
+  {0x0250,0x0250,0x0250},  {0x0251,0x0251,0x0251},
+  {0x0252,0x0252,0x0252},  {0x0181,0x0253,0x0181},
+  {0x0186,0x0254,0x0186},  {0x0255,0x0255,0x0255},
+  {0x0189,0x0256,0x0189},  {0x018A,0x0257,0x018A},
+  {0x0258,0x0258,0x0258},  {0x018F,0x0259,0x018F},
+  {0x025A,0x025A,0x025A},  {0x0190,0x025B,0x0190},
+  {0x025C,0x025C,0x025C},  {0x025D,0x025D,0x025D},
+  {0x025E,0x025E,0x025E},  {0x025F,0x025F,0x025F},
+  {0x0193,0x0260,0x0193},  {0x0261,0x0261,0x0261},
+  {0x0262,0x0262,0x0262},  {0x0194,0x0263,0x0194},
+  {0x0264,0x0264,0x0264},  {0x0265,0x0265,0x0265},
+  {0x0266,0x0266,0x0266},  {0x0267,0x0267,0x0267},
+  {0x0197,0x0268,0x0197},  {0x0196,0x0269,0x0196},
+  {0x026A,0x026A,0x026A},  {0x026B,0x026B,0x026B},
+  {0x026C,0x026C,0x026C},  {0x026D,0x026D,0x026D},
+  {0x026E,0x026E,0x026E},  {0x019C,0x026F,0x019C},
+  {0x0270,0x0270,0x0270},  {0x0271,0x0271,0x0271},
+  {0x019D,0x0272,0x019D},  {0x0273,0x0273,0x0273},
+  {0x0274,0x0274,0x0274},  {0x019F,0x0275,0x019F},
+  {0x0276,0x0276,0x0276},  {0x0277,0x0277,0x0277},
+  {0x0278,0x0278,0x0278},  {0x0279,0x0279,0x0279},
+  {0x027A,0x027A,0x027A},  {0x027B,0x027B,0x027B},
+  {0x027C,0x027C,0x027C},  {0x027D,0x027D,0x027D},
+  {0x027E,0x027E,0x027E},  {0x027F,0x027F,0x027F},
+  {0x01A6,0x0280,0x01A6},  {0x0281,0x0281,0x0281},
+  {0x0282,0x0282,0x0282},  {0x01A9,0x0283,0x01A9},
+  {0x0284,0x0284,0x0284},  {0x0285,0x0285,0x0285},
+  {0x0286,0x0286,0x0286},  {0x0287,0x0287,0x0287},
+  {0x01AE,0x0288,0x01AE},  {0x0289,0x0289,0x0289},
+  {0x01B1,0x028A,0x01B1},  {0x01B2,0x028B,0x01B2},
+  {0x028C,0x028C,0x028C},  {0x028D,0x028D,0x028D},
+  {0x028E,0x028E,0x028E},  {0x028F,0x028F,0x028F},
+  {0x0290,0x0290,0x0290},  {0x0291,0x0291,0x0291},
+  {0x01B7,0x0292,0x01B7},  {0x0293,0x0293,0x0293},
+  {0x0294,0x0294,0x0294},  {0x0295,0x0295,0x0295},
+  {0x0296,0x0296,0x0296},  {0x0297,0x0297,0x0297},
+  {0x0298,0x0298,0x0298},  {0x0299,0x0299,0x0299},
+  {0x029A,0x029A,0x029A},  {0x029B,0x029B,0x029B},
+  {0x029C,0x029C,0x029C},  {0x029D,0x029D,0x029D},
+  {0x029E,0x029E,0x029E},  {0x029F,0x029F,0x029F},
+  {0x02A0,0x02A0,0x02A0},  {0x02A1,0x02A1,0x02A1},
+  {0x02A2,0x02A2,0x02A2},  {0x02A3,0x02A3,0x02A3},
+  {0x02A4,0x02A4,0x02A4},  {0x02A5,0x02A5,0x02A5},
+  {0x02A6,0x02A6,0x02A6},  {0x02A7,0x02A7,0x02A7},
+  {0x02A8,0x02A8,0x02A8},  {0x02A9,0x02A9,0x02A9},
+  {0x02AA,0x02AA,0x02AA},  {0x02AB,0x02AB,0x02AB},
+  {0x02AC,0x02AC,0x02AC},  {0x02AD,0x02AD,0x02AD},
+  {0x02AE,0x02AE,0x02AE},  {0x02AF,0x02AF,0x02AF},
+  {0x02B0,0x02B0,0x02B0},  {0x02B1,0x02B1,0x02B1},
+  {0x02B2,0x02B2,0x02B2},  {0x02B3,0x02B3,0x02B3},
+  {0x02B4,0x02B4,0x02B4},  {0x02B5,0x02B5,0x02B5},
+  {0x02B6,0x02B6,0x02B6},  {0x02B7,0x02B7,0x02B7},
+  {0x02B8,0x02B8,0x02B8},  {0x02B9,0x02B9,0x02B9},
+  {0x02BA,0x02BA,0x02BA},  {0x02BB,0x02BB,0x02BB},
+  {0x02BC,0x02BC,0x02BC},  {0x02BD,0x02BD,0x02BD},
+  {0x02BE,0x02BE,0x02BE},  {0x02BF,0x02BF,0x02BF},
+  {0x02C0,0x02C0,0x02C0},  {0x02C1,0x02C1,0x02C1},
+  {0x02C2,0x02C2,0x02C2},  {0x02C3,0x02C3,0x02C3},
+  {0x02C4,0x02C4,0x02C4},  {0x02C5,0x02C5,0x02C5},
+  {0x02C6,0x02C6,0x02C6},  {0x02C7,0x02C7,0x02C7},
+  {0x02C8,0x02C8,0x02C8},  {0x02C9,0x02C9,0x02C9},
+  {0x02CA,0x02CA,0x02CA},  {0x02CB,0x02CB,0x02CB},
+  {0x02CC,0x02CC,0x02CC},  {0x02CD,0x02CD,0x02CD},
+  {0x02CE,0x02CE,0x02CE},  {0x02CF,0x02CF,0x02CF},
+  {0x02D0,0x02D0,0x02D0},  {0x02D1,0x02D1,0x02D1},
+  {0x02D2,0x02D2,0x02D2},  {0x02D3,0x02D3,0x02D3},
+  {0x02D4,0x02D4,0x02D4},  {0x02D5,0x02D5,0x02D5},
+  {0x02D6,0x02D6,0x02D6},  {0x02D7,0x02D7,0x02D7},
+  {0x02D8,0x02D8,0x02D8},  {0x02D9,0x02D9,0x02D9},
+  {0x02DA,0x02DA,0x02DA},  {0x02DB,0x02DB,0x02DB},
+  {0x02DC,0x02DC,0x02DC},  {0x02DD,0x02DD,0x02DD},
+  {0x02DE,0x02DE,0x02DE},  {0x02DF,0x02DF,0x02DF},
+  {0x02E0,0x02E0,0x02E0},  {0x02E1,0x02E1,0x02E1},
+  {0x02E2,0x02E2,0x02E2},  {0x02E3,0x02E3,0x02E3},
+  {0x02E4,0x02E4,0x02E4},  {0x02E5,0x02E5,0x02E5},
+  {0x02E6,0x02E6,0x02E6},  {0x02E7,0x02E7,0x02E7},
+  {0x02E8,0x02E8,0x02E8},  {0x02E9,0x02E9,0x02E9},
+  {0x02EA,0x02EA,0x02EA},  {0x02EB,0x02EB,0x02EB},
+  {0x02EC,0x02EC,0x02EC},  {0x02ED,0x02ED,0x02ED},
+  {0x02EE,0x02EE,0x02EE},  {0x02EF,0x02EF,0x02EF},
+  {0x02F0,0x02F0,0x02F0},  {0x02F1,0x02F1,0x02F1},
+  {0x02F2,0x02F2,0x02F2},  {0x02F3,0x02F3,0x02F3},
+  {0x02F4,0x02F4,0x02F4},  {0x02F5,0x02F5,0x02F5},
+  {0x02F6,0x02F6,0x02F6},  {0x02F7,0x02F7,0x02F7},
+  {0x02F8,0x02F8,0x02F8},  {0x02F9,0x02F9,0x02F9},
+  {0x02FA,0x02FA,0x02FA},  {0x02FB,0x02FB,0x02FB},
+  {0x02FC,0x02FC,0x02FC},  {0x02FD,0x02FD,0x02FD},
+  {0x02FE,0x02FE,0x02FE},  {0x02FF,0x02FF,0x02FF}
+};
+
+static MY_UNICASE_INFO plane03[]={
+  {0x0300,0x0300,0x0300},  {0x0301,0x0301,0x0301},
+  {0x0302,0x0302,0x0302},  {0x0303,0x0303,0x0303},
+  {0x0304,0x0304,0x0304},  {0x0305,0x0305,0x0305},
+  {0x0306,0x0306,0x0306},  {0x0307,0x0307,0x0307},
+  {0x0308,0x0308,0x0308},  {0x0309,0x0309,0x0309},
+  {0x030A,0x030A,0x030A},  {0x030B,0x030B,0x030B},
+  {0x030C,0x030C,0x030C},  {0x030D,0x030D,0x030D},
+  {0x030E,0x030E,0x030E},  {0x030F,0x030F,0x030F},
+  {0x0310,0x0310,0x0310},  {0x0311,0x0311,0x0311},
+  {0x0312,0x0312,0x0312},  {0x0313,0x0313,0x0313},
+  {0x0314,0x0314,0x0314},  {0x0315,0x0315,0x0315},
+  {0x0316,0x0316,0x0316},  {0x0317,0x0317,0x0317},
+  {0x0318,0x0318,0x0318},  {0x0319,0x0319,0x0319},
+  {0x031A,0x031A,0x031A},  {0x031B,0x031B,0x031B},
+  {0x031C,0x031C,0x031C},  {0x031D,0x031D,0x031D},
+  {0x031E,0x031E,0x031E},  {0x031F,0x031F,0x031F},
+  {0x0320,0x0320,0x0320},  {0x0321,0x0321,0x0321},
+  {0x0322,0x0322,0x0322},  {0x0323,0x0323,0x0323},
+  {0x0324,0x0324,0x0324},  {0x0325,0x0325,0x0325},
+  {0x0326,0x0326,0x0326},  {0x0327,0x0327,0x0327},
+  {0x0328,0x0328,0x0328},  {0x0329,0x0329,0x0329},
+  {0x032A,0x032A,0x032A},  {0x032B,0x032B,0x032B},
+  {0x032C,0x032C,0x032C},  {0x032D,0x032D,0x032D},
+  {0x032E,0x032E,0x032E},  {0x032F,0x032F,0x032F},
+  {0x0330,0x0330,0x0330},  {0x0331,0x0331,0x0331},
+  {0x0332,0x0332,0x0332},  {0x0333,0x0333,0x0333},
+  {0x0334,0x0334,0x0334},  {0x0335,0x0335,0x0335},
+  {0x0336,0x0336,0x0336},  {0x0337,0x0337,0x0337},
+  {0x0338,0x0338,0x0338},  {0x0339,0x0339,0x0339},
+  {0x033A,0x033A,0x033A},  {0x033B,0x033B,0x033B},
+  {0x033C,0x033C,0x033C},  {0x033D,0x033D,0x033D},
+  {0x033E,0x033E,0x033E},  {0x033F,0x033F,0x033F},
+  {0x0340,0x0340,0x0340},  {0x0341,0x0341,0x0341},
+  {0x0342,0x0342,0x0342},  {0x0343,0x0343,0x0343},
+  {0x0344,0x0344,0x0344},  {0x0399,0x0345,0x0399},
+  {0x0346,0x0346,0x0346},  {0x0347,0x0347,0x0347},
+  {0x0348,0x0348,0x0348},  {0x0349,0x0349,0x0349},
+  {0x034A,0x034A,0x034A},  {0x034B,0x034B,0x034B},
+  {0x034C,0x034C,0x034C},  {0x034D,0x034D,0x034D},
+  {0x034E,0x034E,0x034E},  {0x034F,0x034F,0x034F},
+  {0x0350,0x0350,0x0350},  {0x0351,0x0351,0x0351},
+  {0x0352,0x0352,0x0352},  {0x0353,0x0353,0x0353},
+  {0x0354,0x0354,0x0354},  {0x0355,0x0355,0x0355},
+  {0x0356,0x0356,0x0356},  {0x0357,0x0357,0x0357},
+  {0x0358,0x0358,0x0358},  {0x0359,0x0359,0x0359},
+  {0x035A,0x035A,0x035A},  {0x035B,0x035B,0x035B},
+  {0x035C,0x035C,0x035C},  {0x035D,0x035D,0x035D},
+  {0x035E,0x035E,0x035E},  {0x035F,0x035F,0x035F},
+  {0x0360,0x0360,0x0360},  {0x0361,0x0361,0x0361},
+  {0x0362,0x0362,0x0362},  {0x0363,0x0363,0x0363},
+  {0x0364,0x0364,0x0364},  {0x0365,0x0365,0x0365},
+  {0x0366,0x0366,0x0366},  {0x0367,0x0367,0x0367},
+  {0x0368,0x0368,0x0368},  {0x0369,0x0369,0x0369},
+  {0x036A,0x036A,0x036A},  {0x036B,0x036B,0x036B},
+  {0x036C,0x036C,0x036C},  {0x036D,0x036D,0x036D},
+  {0x036E,0x036E,0x036E},  {0x036F,0x036F,0x036F},
+  {0x0370,0x0370,0x0370},  {0x0371,0x0371,0x0371},
+  {0x0372,0x0372,0x0372},  {0x0373,0x0373,0x0373},
+  {0x0374,0x0374,0x0374},  {0x0375,0x0375,0x0375},
+  {0x0376,0x0376,0x0376},  {0x0377,0x0377,0x0377},
+  {0x0378,0x0378,0x0378},  {0x0379,0x0379,0x0379},
+  {0x037A,0x037A,0x037A},  {0x037B,0x037B,0x037B},
+  {0x037C,0x037C,0x037C},  {0x037D,0x037D,0x037D},
+  {0x037E,0x037E,0x037E},  {0x037F,0x037F,0x037F},
+  {0x0380,0x0380,0x0380},  {0x0381,0x0381,0x0381},
+  {0x0382,0x0382,0x0382},  {0x0383,0x0383,0x0383},
+  {0x0384,0x0384,0x0384},  {0x0385,0x0385,0x0385},
+  {0x0386,0x03AC,0x0391},  {0x0387,0x0387,0x0387},
+  {0x0388,0x03AD,0x0395},  {0x0389,0x03AE,0x0397},
+  {0x038A,0x03AF,0x0399},  {0x038B,0x038B,0x038B},
+  {0x038C,0x03CC,0x039F},  {0x038D,0x038D,0x038D},
+  {0x038E,0x03CD,0x03A5},  {0x038F,0x03CE,0x03A9},
+  {0x0390,0x0390,0x0399},  {0x0391,0x03B1,0x0391},
+  {0x0392,0x03B2,0x0392},  {0x0393,0x03B3,0x0393},
+  {0x0394,0x03B4,0x0394},  {0x0395,0x03B5,0x0395},
+  {0x0396,0x03B6,0x0396},  {0x0397,0x03B7,0x0397},
+  {0x0398,0x03B8,0x0398},  {0x0399,0x03B9,0x0399},
+  {0x039A,0x03BA,0x039A},  {0x039B,0x03BB,0x039B},
+  {0x039C,0x03BC,0x039C},  {0x039D,0x03BD,0x039D},
+  {0x039E,0x03BE,0x039E},  {0x039F,0x03BF,0x039F},
+  {0x03A0,0x03C0,0x03A0},  {0x03A1,0x03C1,0x03A1},
+  {0x03A2,0x03A2,0x03A2},  {0x03A3,0x03C3,0x03A3},
+  {0x03A4,0x03C4,0x03A4},  {0x03A5,0x03C5,0x03A5},
+  {0x03A6,0x03C6,0x03A6},  {0x03A7,0x03C7,0x03A7},
+  {0x03A8,0x03C8,0x03A8},  {0x03A9,0x03C9,0x03A9},
+  {0x03AA,0x03CA,0x0399},  {0x03AB,0x03CB,0x03A5},
+  {0x0386,0x03AC,0x0391},  {0x0388,0x03AD,0x0395},
+  {0x0389,0x03AE,0x0397},  {0x038A,0x03AF,0x0399},
+  {0x03B0,0x03B0,0x03A5},  {0x0391,0x03B1,0x0391},
+  {0x0392,0x03B2,0x0392},  {0x0393,0x03B3,0x0393},
+  {0x0394,0x03B4,0x0394},  {0x0395,0x03B5,0x0395},
+  {0x0396,0x03B6,0x0396},  {0x0397,0x03B7,0x0397},
+  {0x0398,0x03B8,0x0398},  {0x0399,0x03B9,0x0399},
+  {0x039A,0x03BA,0x039A},  {0x039B,0x03BB,0x039B},
+  {0x039C,0x03BC,0x039C},  {0x039D,0x03BD,0x039D},
+  {0x039E,0x03BE,0x039E},  {0x039F,0x03BF,0x039F},
+  {0x03A0,0x03C0,0x03A0},  {0x03A1,0x03C1,0x03A1},
+  {0x03A3,0x03C2,0x03A3},  {0x03A3,0x03C3,0x03A3},
+  {0x03A4,0x03C4,0x03A4},  {0x03A5,0x03C5,0x03A5},
+  {0x03A6,0x03C6,0x03A6},  {0x03A7,0x03C7,0x03A7},
+  {0x03A8,0x03C8,0x03A8},  {0x03A9,0x03C9,0x03A9},
+  {0x03AA,0x03CA,0x0399},  {0x03AB,0x03CB,0x03A5},
+  {0x038C,0x03CC,0x039F},  {0x038E,0x03CD,0x03A5},
+  {0x038F,0x03CE,0x03A9},  {0x03CF,0x03CF,0x03CF},
+  {0x0392,0x03D0,0x0392},  {0x0398,0x03D1,0x0398},
+  {0x03D2,0x03D2,0x03D2},  {0x03D3,0x03D3,0x03D2},
+  {0x03D4,0x03D4,0x03D2},  {0x03A6,0x03D5,0x03A6},
+  {0x03A0,0x03D6,0x03A0},  {0x03D7,0x03D7,0x03D7},
+  {0x03D8,0x03D8,0x03D8},  {0x03D9,0x03D9,0x03D9},
+  {0x03DA,0x03DB,0x03DA},  {0x03DA,0x03DB,0x03DA},
+  {0x03DC,0x03DD,0x03DC},  {0x03DC,0x03DD,0x03DC},
+  {0x03DE,0x03DF,0x03DE},  {0x03DE,0x03DF,0x03DE},
+  {0x03E0,0x03E1,0x03E0},  {0x03E0,0x03E1,0x03E0},
+  {0x03E2,0x03E3,0x03E2},  {0x03E2,0x03E3,0x03E2},
+  {0x03E4,0x03E5,0x03E4},  {0x03E4,0x03E5,0x03E4},
+  {0x03E6,0x03E7,0x03E6},  {0x03E6,0x03E7,0x03E6},
+  {0x03E8,0x03E9,0x03E8},  {0x03E8,0x03E9,0x03E8},
+  {0x03EA,0x03EB,0x03EA},  {0x03EA,0x03EB,0x03EA},
+  {0x03EC,0x03ED,0x03EC},  {0x03EC,0x03ED,0x03EC},
+  {0x03EE,0x03EF,0x03EE},  {0x03EE,0x03EF,0x03EE},
+  {0x039A,0x03F0,0x039A},  {0x03A1,0x03F1,0x03A1},
+  {0x03A3,0x03F2,0x03A3},  {0x03F3,0x03F3,0x03F3},
+  {0x03F4,0x03F4,0x03F4},  {0x03F5,0x03F5,0x03F5},
+  {0x03F6,0x03F6,0x03F6},  {0x03F7,0x03F7,0x03F7},
+  {0x03F8,0x03F8,0x03F8},  {0x03F9,0x03F9,0x03F9},
+  {0x03FA,0x03FA,0x03FA},  {0x03FB,0x03FB,0x03FB},
+  {0x03FC,0x03FC,0x03FC},  {0x03FD,0x03FD,0x03FD},
+  {0x03FE,0x03FE,0x03FE},  {0x03FF,0x03FF,0x03FF}
+};
+
+static MY_UNICASE_INFO plane04[]={
+  {0x0400,0x0450,0x0415},  {0x0401,0x0451,0x0415},
+  {0x0402,0x0452,0x0402},  {0x0403,0x0453,0x0413},
+  {0x0404,0x0454,0x0404},  {0x0405,0x0455,0x0405},
+  {0x0406,0x0456,0x0406},  {0x0407,0x0457,0x0406},
+  {0x0408,0x0458,0x0408},  {0x0409,0x0459,0x0409},
+  {0x040A,0x045A,0x040A},  {0x040B,0x045B,0x040B},
+  {0x040C,0x045C,0x041A},  {0x040D,0x045D,0x0418},
+  {0x040E,0x045E,0x0423},  {0x040F,0x045F,0x040F},
+  {0x0410,0x0430,0x0410},  {0x0411,0x0431,0x0411},
+  {0x0412,0x0432,0x0412},  {0x0413,0x0433,0x0413},
+  {0x0414,0x0434,0x0414},  {0x0415,0x0435,0x0415},
+  {0x0416,0x0436,0x0416},  {0x0417,0x0437,0x0417},
+  {0x0418,0x0438,0x0418},  {0x0419,0x0439,0x0419},
+  {0x041A,0x043A,0x041A},  {0x041B,0x043B,0x041B},
+  {0x041C,0x043C,0x041C},  {0x041D,0x043D,0x041D},
+  {0x041E,0x043E,0x041E},  {0x041F,0x043F,0x041F},
+  {0x0420,0x0440,0x0420},  {0x0421,0x0441,0x0421},
+  {0x0422,0x0442,0x0422},  {0x0423,0x0443,0x0423},
+  {0x0424,0x0444,0x0424},  {0x0425,0x0445,0x0425},
+  {0x0426,0x0446,0x0426},  {0x0427,0x0447,0x0427},
+  {0x0428,0x0448,0x0428},  {0x0429,0x0449,0x0429},
+  {0x042A,0x044A,0x042A},  {0x042B,0x044B,0x042B},
+  {0x042C,0x044C,0x042C},  {0x042D,0x044D,0x042D},
+  {0x042E,0x044E,0x042E},  {0x042F,0x044F,0x042F},
+  {0x0410,0x0430,0x0410},  {0x0411,0x0431,0x0411},
+  {0x0412,0x0432,0x0412},  {0x0413,0x0433,0x0413},
+  {0x0414,0x0434,0x0414},  {0x0415,0x0435,0x0415},
+  {0x0416,0x0436,0x0416},  {0x0417,0x0437,0x0417},
+  {0x0418,0x0438,0x0418},  {0x0419,0x0439,0x0419},
+  {0x041A,0x043A,0x041A},  {0x041B,0x043B,0x041B},
+  {0x041C,0x043C,0x041C},  {0x041D,0x043D,0x041D},
+  {0x041E,0x043E,0x041E},  {0x041F,0x043F,0x041F},
+  {0x0420,0x0440,0x0420},  {0x0421,0x0441,0x0421},
+  {0x0422,0x0442,0x0422},  {0x0423,0x0443,0x0423},
+  {0x0424,0x0444,0x0424},  {0x0425,0x0445,0x0425},
+  {0x0426,0x0446,0x0426},  {0x0427,0x0447,0x0427},
+  {0x0428,0x0448,0x0428},  {0x0429,0x0449,0x0429},
+  {0x042A,0x044A,0x042A},  {0x042B,0x044B,0x042B},
+  {0x042C,0x044C,0x042C},  {0x042D,0x044D,0x042D},
+  {0x042E,0x044E,0x042E},  {0x042F,0x044F,0x042F},
+  {0x0400,0x0450,0x0415},  {0x0401,0x0451,0x0415},
+  {0x0402,0x0452,0x0402},  {0x0403,0x0453,0x0413},
+  {0x0404,0x0454,0x0404},  {0x0405,0x0455,0x0405},
+  {0x0406,0x0456,0x0406},  {0x0407,0x0457,0x0406},
+  {0x0408,0x0458,0x0408},  {0x0409,0x0459,0x0409},
+  {0x040A,0x045A,0x040A},  {0x040B,0x045B,0x040B},
+  {0x040C,0x045C,0x041A},  {0x040D,0x045D,0x0418},
+  {0x040E,0x045E,0x0423},  {0x040F,0x045F,0x040F},
+  {0x0460,0x0461,0x0460},  {0x0460,0x0461,0x0460},
+  {0x0462,0x0463,0x0462},  {0x0462,0x0463,0x0462},
+  {0x0464,0x0465,0x0464},  {0x0464,0x0465,0x0464},
+  {0x0466,0x0467,0x0466},  {0x0466,0x0467,0x0466},
+  {0x0468,0x0469,0x0468},  {0x0468,0x0469,0x0468},
+  {0x046A,0x046B,0x046A},  {0x046A,0x046B,0x046A},
+  {0x046C,0x046D,0x046C},  {0x046C,0x046D,0x046C},
+  {0x046E,0x046F,0x046E},  {0x046E,0x046F,0x046E},
+  {0x0470,0x0471,0x0470},  {0x0470,0x0471,0x0470},
+  {0x0472,0x0473,0x0472},  {0x0472,0x0473,0x0472},
+  {0x0474,0x0475,0x0474},  {0x0474,0x0475,0x0474},
+  {0x0476,0x0477,0x0474},  {0x0476,0x0477,0x0474},
+  {0x0478,0x0479,0x0478},  {0x0478,0x0479,0x0478},
+  {0x047A,0x047B,0x047A},  {0x047A,0x047B,0x047A},
+  {0x047C,0x047D,0x047C},  {0x047C,0x047D,0x047C},
+  {0x047E,0x047F,0x047E},  {0x047E,0x047F,0x047E},
+  {0x0480,0x0481,0x0480},  {0x0480,0x0481,0x0480},
+  {0x0482,0x0482,0x0482},  {0x0483,0x0483,0x0483},
+  {0x0484,0x0484,0x0484},  {0x0485,0x0485,0x0485},
+  {0x0486,0x0486,0x0486},  {0x0487,0x0487,0x0487},
+  {0x0488,0x0488,0x0488},  {0x0489,0x0489,0x0489},
+  {0x048A,0x048A,0x048A},  {0x048B,0x048B,0x048B},
+  {0x048C,0x048D,0x048C},  {0x048C,0x048D,0x048C},
+  {0x048E,0x048F,0x048E},  {0x048E,0x048F,0x048E},
+  {0x0490,0x0491,0x0490},  {0x0490,0x0491,0x0490},
+  {0x0492,0x0493,0x0492},  {0x0492,0x0493,0x0492},
+  {0x0494,0x0495,0x0494},  {0x0494,0x0495,0x0494},
+  {0x0496,0x0497,0x0496},  {0x0496,0x0497,0x0496},
+  {0x0498,0x0499,0x0498},  {0x0498,0x0499,0x0498},
+  {0x049A,0x049B,0x049A},  {0x049A,0x049B,0x049A},
+  {0x049C,0x049D,0x049C},  {0x049C,0x049D,0x049C},
+  {0x049E,0x049F,0x049E},  {0x049E,0x049F,0x049E},
+  {0x04A0,0x04A1,0x04A0},  {0x04A0,0x04A1,0x04A0},
+  {0x04A2,0x04A3,0x04A2},  {0x04A2,0x04A3,0x04A2},
+  {0x04A4,0x04A5,0x04A4},  {0x04A4,0x04A5,0x04A4},
+  {0x04A6,0x04A7,0x04A6},  {0x04A6,0x04A7,0x04A6},
+  {0x04A8,0x04A9,0x04A8},  {0x04A8,0x04A9,0x04A8},
+  {0x04AA,0x04AB,0x04AA},  {0x04AA,0x04AB,0x04AA},
+  {0x04AC,0x04AD,0x04AC},  {0x04AC,0x04AD,0x04AC},
+  {0x04AE,0x04AF,0x04AE},  {0x04AE,0x04AF,0x04AE},
+  {0x04B0,0x04B1,0x04B0},  {0x04B0,0x04B1,0x04B0},
+  {0x04B2,0x04B3,0x04B2},  {0x04B2,0x04B3,0x04B2},
+  {0x04B4,0x04B5,0x04B4},  {0x04B4,0x04B5,0x04B4},
+  {0x04B6,0x04B7,0x04B6},  {0x04B6,0x04B7,0x04B6},
+  {0x04B8,0x04B9,0x04B8},  {0x04B8,0x04B9,0x04B8},
+  {0x04BA,0x04BB,0x04BA},  {0x04BA,0x04BB,0x04BA},
+  {0x04BC,0x04BD,0x04BC},  {0x04BC,0x04BD,0x04BC},
+  {0x04BE,0x04BF,0x04BE},  {0x04BE,0x04BF,0x04BE},
+  {0x04C0,0x04C0,0x04C0},  {0x04C1,0x04C2,0x0416},
+  {0x04C1,0x04C2,0x0416},  {0x04C3,0x04C4,0x04C3},
+  {0x04C3,0x04C4,0x04C3},  {0x04C5,0x04C5,0x04C5},
+  {0x04C6,0x04C6,0x04C6},  {0x04C7,0x04C8,0x04C7},
+  {0x04C7,0x04C8,0x04C7},  {0x04C9,0x04C9,0x04C9},
+  {0x04CA,0x04CA,0x04CA},  {0x04CB,0x04CC,0x04CB},
+  {0x04CB,0x04CC,0x04CB},  {0x04CD,0x04CD,0x04CD},
+  {0x04CE,0x04CE,0x04CE},  {0x04CF,0x04CF,0x04CF},
+  {0x04D0,0x04D1,0x0410},  {0x04D0,0x04D1,0x0410},
+  {0x04D2,0x04D3,0x0410},  {0x04D2,0x04D3,0x0410},
+  {0x04D4,0x04D5,0x04D4},  {0x04D4,0x04D5,0x04D4},
+  {0x04D6,0x04D7,0x0415},  {0x04D6,0x04D7,0x0415},
+  {0x04D8,0x04D9,0x04D8},  {0x04D8,0x04D9,0x04D8},
+  {0x04DA,0x04DB,0x04D8},  {0x04DA,0x04DB,0x04D8},
+  {0x04DC,0x04DD,0x0416},  {0x04DC,0x04DD,0x0416},
+  {0x04DE,0x04DF,0x0417},  {0x04DE,0x04DF,0x0417},
+  {0x04E0,0x04E1,0x04E0},  {0x04E0,0x04E1,0x04E0},
+  {0x04E2,0x04E3,0x0418},  {0x04E2,0x04E3,0x0418},
+  {0x04E4,0x04E5,0x0418},  {0x04E4,0x04E5,0x0418},
+  {0x04E6,0x04E7,0x041E},  {0x04E6,0x04E7,0x041E},
+  {0x04E8,0x04E9,0x04E8},  {0x04E8,0x04E9,0x04E8},
+  {0x04EA,0x04EB,0x04E8},  {0x04EA,0x04EB,0x04E8},
+  {0x04EC,0x04ED,0x042D},  {0x04EC,0x04ED,0x042D},
+  {0x04EE,0x04EF,0x0423},  {0x04EE,0x04EF,0x0423},
+  {0x04F0,0x04F1,0x0423},  {0x04F0,0x04F1,0x0423},
+  {0x04F2,0x04F3,0x0423},  {0x04F2,0x04F3,0x0423},
+  {0x04F4,0x04F5,0x0427},  {0x04F4,0x04F5,0x0427},
+  {0x04F6,0x04F6,0x04F6},  {0x04F7,0x04F7,0x04F7},
+  {0x04F8,0x04F9,0x042B},  {0x04F8,0x04F9,0x042B},
+  {0x04FA,0x04FA,0x04FA},  {0x04FB,0x04FB,0x04FB},
+  {0x04FC,0x04FC,0x04FC},  {0x04FD,0x04FD,0x04FD},
+  {0x04FE,0x04FE,0x04FE},  {0x04FF,0x04FF,0x04FF}
+};
+
+static MY_UNICASE_INFO plane05[]={
+  {0x0500,0x0500,0x0500},  {0x0501,0x0501,0x0501},
+  {0x0502,0x0502,0x0502},  {0x0503,0x0503,0x0503},
+  {0x0504,0x0504,0x0504},  {0x0505,0x0505,0x0505},
+  {0x0506,0x0506,0x0506},  {0x0507,0x0507,0x0507},
+  {0x0508,0x0508,0x0508},  {0x0509,0x0509,0x0509},
+  {0x050A,0x050A,0x050A},  {0x050B,0x050B,0x050B},
+  {0x050C,0x050C,0x050C},  {0x050D,0x050D,0x050D},
+  {0x050E,0x050E,0x050E},  {0x050F,0x050F,0x050F},
+  {0x0510,0x0510,0x0510},  {0x0511,0x0511,0x0511},
+  {0x0512,0x0512,0x0512},  {0x0513,0x0513,0x0513},
+  {0x0514,0x0514,0x0514},  {0x0515,0x0515,0x0515},
+  {0x0516,0x0516,0x0516},  {0x0517,0x0517,0x0517},
+  {0x0518,0x0518,0x0518},  {0x0519,0x0519,0x0519},
+  {0x051A,0x051A,0x051A},  {0x051B,0x051B,0x051B},
+  {0x051C,0x051C,0x051C},  {0x051D,0x051D,0x051D},
+  {0x051E,0x051E,0x051E},  {0x051F,0x051F,0x051F},
+  {0x0520,0x0520,0x0520},  {0x0521,0x0521,0x0521},
+  {0x0522,0x0522,0x0522},  {0x0523,0x0523,0x0523},
+  {0x0524,0x0524,0x0524},  {0x0525,0x0525,0x0525},
+  {0x0526,0x0526,0x0526},  {0x0527,0x0527,0x0527},
+  {0x0528,0x0528,0x0528},  {0x0529,0x0529,0x0529},
+  {0x052A,0x052A,0x052A},  {0x052B,0x052B,0x052B},
+  {0x052C,0x052C,0x052C},  {0x052D,0x052D,0x052D},
+  {0x052E,0x052E,0x052E},  {0x052F,0x052F,0x052F},
+  {0x0530,0x0530,0x0530},  {0x0531,0x0561,0x0531},
+  {0x0532,0x0562,0x0532},  {0x0533,0x0563,0x0533},
+  {0x0534,0x0564,0x0534},  {0x0535,0x0565,0x0535},
+  {0x0536,0x0566,0x0536},  {0x0537,0x0567,0x0537},
+  {0x0538,0x0568,0x0538},  {0x0539,0x0569,0x0539},
+  {0x053A,0x056A,0x053A},  {0x053B,0x056B,0x053B},
+  {0x053C,0x056C,0x053C},  {0x053D,0x056D,0x053D},
+  {0x053E,0x056E,0x053E},  {0x053F,0x056F,0x053F},
+  {0x0540,0x0570,0x0540},  {0x0541,0x0571,0x0541},
+  {0x0542,0x0572,0x0542},  {0x0543,0x0573,0x0543},
+  {0x0544,0x0574,0x0544},  {0x0545,0x0575,0x0545},
+  {0x0546,0x0576,0x0546},  {0x0547,0x0577,0x0547},
+  {0x0548,0x0578,0x0548},  {0x0549,0x0579,0x0549},
+  {0x054A,0x057A,0x054A},  {0x054B,0x057B,0x054B},
+  {0x054C,0x057C,0x054C},  {0x054D,0x057D,0x054D},
+  {0x054E,0x057E,0x054E},  {0x054F,0x057F,0x054F},
+  {0x0550,0x0580,0x0550},  {0x0551,0x0581,0x0551},
+  {0x0552,0x0582,0x0552},  {0x0553,0x0583,0x0553},
+  {0x0554,0x0584,0x0554},  {0x0555,0x0585,0x0555},
+  {0x0556,0x0586,0x0556},  {0x0557,0x0557,0x0557},
+  {0x0558,0x0558,0x0558},  {0x0559,0x0559,0x0559},
+  {0x055A,0x055A,0x055A},  {0x055B,0x055B,0x055B},
+  {0x055C,0x055C,0x055C},  {0x055D,0x055D,0x055D},
+  {0x055E,0x055E,0x055E},  {0x055F,0x055F,0x055F},
+  {0x0560,0x0560,0x0560},  {0x0531,0x0561,0x0531},
+  {0x0532,0x0562,0x0532},  {0x0533,0x0563,0x0533},
+  {0x0534,0x0564,0x0534},  {0x0535,0x0565,0x0535},
+  {0x0536,0x0566,0x0536},  {0x0537,0x0567,0x0537},
+  {0x0538,0x0568,0x0538},  {0x0539,0x0569,0x0539},
+  {0x053A,0x056A,0x053A},  {0x053B,0x056B,0x053B},
+  {0x053C,0x056C,0x053C},  {0x053D,0x056D,0x053D},
+  {0x053E,0x056E,0x053E},  {0x053F,0x056F,0x053F},
+  {0x0540,0x0570,0x0540},  {0x0541,0x0571,0x0541},
+  {0x0542,0x0572,0x0542},  {0x0543,0x0573,0x0543},
+  {0x0544,0x0574,0x0544},  {0x0545,0x0575,0x0545},
+  {0x0546,0x0576,0x0546},  {0x0547,0x0577,0x0547},
+  {0x0548,0x0578,0x0548},  {0x0549,0x0579,0x0549},
+  {0x054A,0x057A,0x054A},  {0x054B,0x057B,0x054B},
+  {0x054C,0x057C,0x054C},  {0x054D,0x057D,0x054D},
+  {0x054E,0x057E,0x054E},  {0x054F,0x057F,0x054F},
+  {0x0550,0x0580,0x0550},  {0x0551,0x0581,0x0551},
+  {0x0552,0x0582,0x0552},  {0x0553,0x0583,0x0553},
+  {0x0554,0x0584,0x0554},  {0x0555,0x0585,0x0555},
+  {0x0556,0x0586,0x0556},  {0x0587,0x0587,0x0587},
+  {0x0588,0x0588,0x0588},  {0x0589,0x0589,0x0589},
+  {0x058A,0x058A,0x058A},  {0x058B,0x058B,0x058B},
+  {0x058C,0x058C,0x058C},  {0x058D,0x058D,0x058D},
+  {0x058E,0x058E,0x058E},  {0x058F,0x058F,0x058F},
+  {0x0590,0x0590,0x0590},  {0x0591,0x0591,0x0591},
+  {0x0592,0x0592,0x0592},  {0x0593,0x0593,0x0593},
+  {0x0594,0x0594,0x0594},  {0x0595,0x0595,0x0595},
+  {0x0596,0x0596,0x0596},  {0x0597,0x0597,0x0597},
+  {0x0598,0x0598,0x0598},  {0x0599,0x0599,0x0599},
+  {0x059A,0x059A,0x059A},  {0x059B,0x059B,0x059B},
+  {0x059C,0x059C,0x059C},  {0x059D,0x059D,0x059D},
+  {0x059E,0x059E,0x059E},  {0x059F,0x059F,0x059F},
+  {0x05A0,0x05A0,0x05A0},  {0x05A1,0x05A1,0x05A1},
+  {0x05A2,0x05A2,0x05A2},  {0x05A3,0x05A3,0x05A3},
+  {0x05A4,0x05A4,0x05A4},  {0x05A5,0x05A5,0x05A5},
+  {0x05A6,0x05A6,0x05A6},  {0x05A7,0x05A7,0x05A7},
+  {0x05A8,0x05A8,0x05A8},  {0x05A9,0x05A9,0x05A9},
+  {0x05AA,0x05AA,0x05AA},  {0x05AB,0x05AB,0x05AB},
+  {0x05AC,0x05AC,0x05AC},  {0x05AD,0x05AD,0x05AD},
+  {0x05AE,0x05AE,0x05AE},  {0x05AF,0x05AF,0x05AF},
+  {0x05B0,0x05B0,0x05B0},  {0x05B1,0x05B1,0x05B1},
+  {0x05B2,0x05B2,0x05B2},  {0x05B3,0x05B3,0x05B3},
+  {0x05B4,0x05B4,0x05B4},  {0x05B5,0x05B5,0x05B5},
+  {0x05B6,0x05B6,0x05B6},  {0x05B7,0x05B7,0x05B7},
+  {0x05B8,0x05B8,0x05B8},  {0x05B9,0x05B9,0x05B9},
+  {0x05BA,0x05BA,0x05BA},  {0x05BB,0x05BB,0x05BB},
+  {0x05BC,0x05BC,0x05BC},  {0x05BD,0x05BD,0x05BD},
+  {0x05BE,0x05BE,0x05BE},  {0x05BF,0x05BF,0x05BF},
+  {0x05C0,0x05C0,0x05C0},  {0x05C1,0x05C1,0x05C1},
+  {0x05C2,0x05C2,0x05C2},  {0x05C3,0x05C3,0x05C3},
+  {0x05C4,0x05C4,0x05C4},  {0x05C5,0x05C5,0x05C5},
+  {0x05C6,0x05C6,0x05C6},  {0x05C7,0x05C7,0x05C7},
+  {0x05C8,0x05C8,0x05C8},  {0x05C9,0x05C9,0x05C9},
+  {0x05CA,0x05CA,0x05CA},  {0x05CB,0x05CB,0x05CB},
+  {0x05CC,0x05CC,0x05CC},  {0x05CD,0x05CD,0x05CD},
+  {0x05CE,0x05CE,0x05CE},  {0x05CF,0x05CF,0x05CF},
+  {0x05D0,0x05D0,0x05D0},  {0x05D1,0x05D1,0x05D1},
+  {0x05D2,0x05D2,0x05D2},  {0x05D3,0x05D3,0x05D3},
+  {0x05D4,0x05D4,0x05D4},  {0x05D5,0x05D5,0x05D5},
+  {0x05D6,0x05D6,0x05D6},  {0x05D7,0x05D7,0x05D7},
+  {0x05D8,0x05D8,0x05D8},  {0x05D9,0x05D9,0x05D9},
+  {0x05DA,0x05DA,0x05DA},  {0x05DB,0x05DB,0x05DB},
+  {0x05DC,0x05DC,0x05DC},  {0x05DD,0x05DD,0x05DD},
+  {0x05DE,0x05DE,0x05DE},  {0x05DF,0x05DF,0x05DF},
+  {0x05E0,0x05E0,0x05E0},  {0x05E1,0x05E1,0x05E1},
+  {0x05E2,0x05E2,0x05E2},  {0x05E3,0x05E3,0x05E3},
+  {0x05E4,0x05E4,0x05E4},  {0x05E5,0x05E5,0x05E5},
+  {0x05E6,0x05E6,0x05E6},  {0x05E7,0x05E7,0x05E7},
+  {0x05E8,0x05E8,0x05E8},  {0x05E9,0x05E9,0x05E9},
+  {0x05EA,0x05EA,0x05EA},  {0x05EB,0x05EB,0x05EB},
+  {0x05EC,0x05EC,0x05EC},  {0x05ED,0x05ED,0x05ED},
+  {0x05EE,0x05EE,0x05EE},  {0x05EF,0x05EF,0x05EF},
+  {0x05F0,0x05F0,0x05F0},  {0x05F1,0x05F1,0x05F1},
+  {0x05F2,0x05F2,0x05F2},  {0x05F3,0x05F3,0x05F3},
+  {0x05F4,0x05F4,0x05F4},  {0x05F5,0x05F5,0x05F5},
+  {0x05F6,0x05F6,0x05F6},  {0x05F7,0x05F7,0x05F7},
+  {0x05F8,0x05F8,0x05F8},  {0x05F9,0x05F9,0x05F9},
+  {0x05FA,0x05FA,0x05FA},  {0x05FB,0x05FB,0x05FB},
+  {0x05FC,0x05FC,0x05FC},  {0x05FD,0x05FD,0x05FD},
+  {0x05FE,0x05FE,0x05FE},  {0x05FF,0x05FF,0x05FF}
+};
+
+static MY_UNICASE_INFO plane1E[]={
+  {0x1E00,0x1E01,0x0041},  {0x1E00,0x1E01,0x0041},
+  {0x1E02,0x1E03,0x0042},  {0x1E02,0x1E03,0x0042},
+  {0x1E04,0x1E05,0x0042},  {0x1E04,0x1E05,0x0042},
+  {0x1E06,0x1E07,0x0042},  {0x1E06,0x1E07,0x0042},
+  {0x1E08,0x1E09,0x0043},  {0x1E08,0x1E09,0x0043},
+  {0x1E0A,0x1E0B,0x0044},  {0x1E0A,0x1E0B,0x0044},
+  {0x1E0C,0x1E0D,0x0044},  {0x1E0C,0x1E0D,0x0044},
+  {0x1E0E,0x1E0F,0x0044},  {0x1E0E,0x1E0F,0x0044},
+  {0x1E10,0x1E11,0x0044},  {0x1E10,0x1E11,0x0044},
+  {0x1E12,0x1E13,0x0044},  {0x1E12,0x1E13,0x0044},
+  {0x1E14,0x1E15,0x0045},  {0x1E14,0x1E15,0x0045},
+  {0x1E16,0x1E17,0x0045},  {0x1E16,0x1E17,0x0045},
+  {0x1E18,0x1E19,0x0045},  {0x1E18,0x1E19,0x0045},
+  {0x1E1A,0x1E1B,0x0045},  {0x1E1A,0x1E1B,0x0045},
+  {0x1E1C,0x1E1D,0x0045},  {0x1E1C,0x1E1D,0x0045},
+  {0x1E1E,0x1E1F,0x0046},  {0x1E1E,0x1E1F,0x0046},
+  {0x1E20,0x1E21,0x0047},  {0x1E20,0x1E21,0x0047},
+  {0x1E22,0x1E23,0x0048},  {0x1E22,0x1E23,0x0048},
+  {0x1E24,0x1E25,0x0048},  {0x1E24,0x1E25,0x0048},
+  {0x1E26,0x1E27,0x0048},  {0x1E26,0x1E27,0x0048},
+  {0x1E28,0x1E29,0x0048},  {0x1E28,0x1E29,0x0048},
+  {0x1E2A,0x1E2B,0x0048},  {0x1E2A,0x1E2B,0x0048},
+  {0x1E2C,0x1E2D,0x0049},  {0x1E2C,0x1E2D,0x0049},
+  {0x1E2E,0x1E2F,0x0049},  {0x1E2E,0x1E2F,0x0049},
+  {0x1E30,0x1E31,0x004B},  {0x1E30,0x1E31,0x004B},
+  {0x1E32,0x1E33,0x004B},  {0x1E32,0x1E33,0x004B},
+  {0x1E34,0x1E35,0x004B},  {0x1E34,0x1E35,0x004B},
+  {0x1E36,0x1E37,0x004C},  {0x1E36,0x1E37,0x004C},
+  {0x1E38,0x1E39,0x004C},  {0x1E38,0x1E39,0x004C},
+  {0x1E3A,0x1E3B,0x004C},  {0x1E3A,0x1E3B,0x004C},
+  {0x1E3C,0x1E3D,0x004C},  {0x1E3C,0x1E3D,0x004C},
+  {0x1E3E,0x1E3F,0x004D},  {0x1E3E,0x1E3F,0x004D},
+  {0x1E40,0x1E41,0x004D},  {0x1E40,0x1E41,0x004D},
+  {0x1E42,0x1E43,0x004D},  {0x1E42,0x1E43,0x004D},
+  {0x1E44,0x1E45,0x004E},  {0x1E44,0x1E45,0x004E},
+  {0x1E46,0x1E47,0x004E},  {0x1E46,0x1E47,0x004E},
+  {0x1E48,0x1E49,0x004E},  {0x1E48,0x1E49,0x004E},
+  {0x1E4A,0x1E4B,0x004E},  {0x1E4A,0x1E4B,0x004E},
+  {0x1E4C,0x1E4D,0x004F},  {0x1E4C,0x1E4D,0x004F},
+  {0x1E4E,0x1E4F,0x004F},  {0x1E4E,0x1E4F,0x004F},
+  {0x1E50,0x1E51,0x004F},  {0x1E50,0x1E51,0x004F},
+  {0x1E52,0x1E53,0x004F},  {0x1E52,0x1E53,0x004F},
+  {0x1E54,0x1E55,0x0050},  {0x1E54,0x1E55,0x0050},
+  {0x1E56,0x1E57,0x0050},  {0x1E56,0x1E57,0x0050},
+  {0x1E58,0x1E59,0x0052},  {0x1E58,0x1E59,0x0052},
+  {0x1E5A,0x1E5B,0x0052},  {0x1E5A,0x1E5B,0x0052},
+  {0x1E5C,0x1E5D,0x0052},  {0x1E5C,0x1E5D,0x0052},
+  {0x1E5E,0x1E5F,0x0052},  {0x1E5E,0x1E5F,0x0052},
+  {0x1E60,0x1E61,0x0053},  {0x1E60,0x1E61,0x0053},
+  {0x1E62,0x1E63,0x0053},  {0x1E62,0x1E63,0x0053},
+  {0x1E64,0x1E65,0x0053},  {0x1E64,0x1E65,0x0053},
+  {0x1E66,0x1E67,0x0053},  {0x1E66,0x1E67,0x0053},
+  {0x1E68,0x1E69,0x0053},  {0x1E68,0x1E69,0x0053},
+  {0x1E6A,0x1E6B,0x0054},  {0x1E6A,0x1E6B,0x0054},
+  {0x1E6C,0x1E6D,0x0054},  {0x1E6C,0x1E6D,0x0054},
+  {0x1E6E,0x1E6F,0x0054},  {0x1E6E,0x1E6F,0x0054},
+  {0x1E70,0x1E71,0x0054},  {0x1E70,0x1E71,0x0054},
+  {0x1E72,0x1E73,0x0055},  {0x1E72,0x1E73,0x0055},
+  {0x1E74,0x1E75,0x0055},  {0x1E74,0x1E75,0x0055},
+  {0x1E76,0x1E77,0x0055},  {0x1E76,0x1E77,0x0055},
+  {0x1E78,0x1E79,0x0055},  {0x1E78,0x1E79,0x0055},
+  {0x1E7A,0x1E7B,0x0055},  {0x1E7A,0x1E7B,0x0055},
+  {0x1E7C,0x1E7D,0x0056},  {0x1E7C,0x1E7D,0x0056},
+  {0x1E7E,0x1E7F,0x0056},  {0x1E7E,0x1E7F,0x0056},
+  {0x1E80,0x1E81,0x0057},  {0x1E80,0x1E81,0x0057},
+  {0x1E82,0x1E83,0x0057},  {0x1E82,0x1E83,0x0057},
+  {0x1E84,0x1E85,0x0057},  {0x1E84,0x1E85,0x0057},
+  {0x1E86,0x1E87,0x0057},  {0x1E86,0x1E87,0x0057},
+  {0x1E88,0x1E89,0x0057},  {0x1E88,0x1E89,0x0057},
+  {0x1E8A,0x1E8B,0x0058},  {0x1E8A,0x1E8B,0x0058},
+  {0x1E8C,0x1E8D,0x0058},  {0x1E8C,0x1E8D,0x0058},
+  {0x1E8E,0x1E8F,0x0059},  {0x1E8E,0x1E8F,0x0059},
+  {0x1E90,0x1E91,0x005A},  {0x1E90,0x1E91,0x005A},
+  {0x1E92,0x1E93,0x005A},  {0x1E92,0x1E93,0x005A},
+  {0x1E94,0x1E95,0x005A},  {0x1E94,0x1E95,0x005A},
+  {0x1E96,0x1E96,0x0048},  {0x1E97,0x1E97,0x0054},
+  {0x1E98,0x1E98,0x0057},  {0x1E99,0x1E99,0x0059},
+  {0x1E9A,0x1E9A,0x1E9A},  {0x1E60,0x1E9B,0x0053},
+  {0x1E9C,0x1E9C,0x1E9C},  {0x1E9D,0x1E9D,0x1E9D},
+  {0x1E9E,0x1E9E,0x1E9E},  {0x1E9F,0x1E9F,0x1E9F},
+  {0x1EA0,0x1EA1,0x0041},  {0x1EA0,0x1EA1,0x0041},
+  {0x1EA2,0x1EA3,0x0041},  {0x1EA2,0x1EA3,0x0041},
+  {0x1EA4,0x1EA5,0x0041},  {0x1EA4,0x1EA5,0x0041},
+  {0x1EA6,0x1EA7,0x0041},  {0x1EA6,0x1EA7,0x0041},
+  {0x1EA8,0x1EA9,0x0041},  {0x1EA8,0x1EA9,0x0041},
+  {0x1EAA,0x1EAB,0x0041},  {0x1EAA,0x1EAB,0x0041},
+  {0x1EAC,0x1EAD,0x0041},  {0x1EAC,0x1EAD,0x0041},
+  {0x1EAE,0x1EAF,0x0041},  {0x1EAE,0x1EAF,0x0041},
+  {0x1EB0,0x1EB1,0x0041},  {0x1EB0,0x1EB1,0x0041},
+  {0x1EB2,0x1EB3,0x0041},  {0x1EB2,0x1EB3,0x0041},
+  {0x1EB4,0x1EB5,0x0041},  {0x1EB4,0x1EB5,0x0041},
+  {0x1EB6,0x1EB7,0x0041},  {0x1EB6,0x1EB7,0x0041},
+  {0x1EB8,0x1EB9,0x0045},  {0x1EB8,0x1EB9,0x0045},
+  {0x1EBA,0x1EBB,0x0045},  {0x1EBA,0x1EBB,0x0045},
+  {0x1EBC,0x1EBD,0x0045},  {0x1EBC,0x1EBD,0x0045},
+  {0x1EBE,0x1EBF,0x0045},  {0x1EBE,0x1EBF,0x0045},
+  {0x1EC0,0x1EC1,0x0045},  {0x1EC0,0x1EC1,0x0045},
+  {0x1EC2,0x1EC3,0x0045},  {0x1EC2,0x1EC3,0x0045},
+  {0x1EC4,0x1EC5,0x0045},  {0x1EC4,0x1EC5,0x0045},
+  {0x1EC6,0x1EC7,0x0045},  {0x1EC6,0x1EC7,0x0045},
+  {0x1EC8,0x1EC9,0x0049},  {0x1EC8,0x1EC9,0x0049},
+  {0x1ECA,0x1ECB,0x0049},  {0x1ECA,0x1ECB,0x0049},
+  {0x1ECC,0x1ECD,0x004F},  {0x1ECC,0x1ECD,0x004F},
+  {0x1ECE,0x1ECF,0x004F},  {0x1ECE,0x1ECF,0x004F},
+  {0x1ED0,0x1ED1,0x004F},  {0x1ED0,0x1ED1,0x004F},
+  {0x1ED2,0x1ED3,0x004F},  {0x1ED2,0x1ED3,0x004F},
+  {0x1ED4,0x1ED5,0x004F},  {0x1ED4,0x1ED5,0x004F},
+  {0x1ED6,0x1ED7,0x004F},  {0x1ED6,0x1ED7,0x004F},
+  {0x1ED8,0x1ED9,0x004F},  {0x1ED8,0x1ED9,0x004F},
+  {0x1EDA,0x1EDB,0x004F},  {0x1EDA,0x1EDB,0x004F},
+  {0x1EDC,0x1EDD,0x004F},  {0x1EDC,0x1EDD,0x004F},
+  {0x1EDE,0x1EDF,0x004F},  {0x1EDE,0x1EDF,0x004F},
+  {0x1EE0,0x1EE1,0x004F},  {0x1EE0,0x1EE1,0x004F},
+  {0x1EE2,0x1EE3,0x004F},  {0x1EE2,0x1EE3,0x004F},
+  {0x1EE4,0x1EE5,0x0055},  {0x1EE4,0x1EE5,0x0055},
+  {0x1EE6,0x1EE7,0x0055},  {0x1EE6,0x1EE7,0x0055},
+  {0x1EE8,0x1EE9,0x0055},  {0x1EE8,0x1EE9,0x0055},
+  {0x1EEA,0x1EEB,0x0055},  {0x1EEA,0x1EEB,0x0055},
+  {0x1EEC,0x1EED,0x0055},  {0x1EEC,0x1EED,0x0055},
+  {0x1EEE,0x1EEF,0x0055},  {0x1EEE,0x1EEF,0x0055},
+  {0x1EF0,0x1EF1,0x0055},  {0x1EF0,0x1EF1,0x0055},
+  {0x1EF2,0x1EF3,0x0059},  {0x1EF2,0x1EF3,0x0059},
+  {0x1EF4,0x1EF5,0x0059},  {0x1EF4,0x1EF5,0x0059},
+  {0x1EF6,0x1EF7,0x0059},  {0x1EF6,0x1EF7,0x0059},
+  {0x1EF8,0x1EF9,0x0059},  {0x1EF8,0x1EF9,0x0059},
+  {0x1EFA,0x1EFA,0x1EFA},  {0x1EFB,0x1EFB,0x1EFB},
+  {0x1EFC,0x1EFC,0x1EFC},  {0x1EFD,0x1EFD,0x1EFD},
+  {0x1EFE,0x1EFE,0x1EFE},  {0x1EFF,0x1EFF,0x1EFF}
+};
+
+static MY_UNICASE_INFO plane1F[]={
+  {0x1F08,0x1F00,0x0391},  {0x1F09,0x1F01,0x0391},
+  {0x1F0A,0x1F02,0x0391},  {0x1F0B,0x1F03,0x0391},
+  {0x1F0C,0x1F04,0x0391},  {0x1F0D,0x1F05,0x0391},
+  {0x1F0E,0x1F06,0x0391},  {0x1F0F,0x1F07,0x0391},
+  {0x1F08,0x1F00,0x0391},  {0x1F09,0x1F01,0x0391},
+  {0x1F0A,0x1F02,0x0391},  {0x1F0B,0x1F03,0x0391},
+  {0x1F0C,0x1F04,0x0391},  {0x1F0D,0x1F05,0x0391},
+  {0x1F0E,0x1F06,0x0391},  {0x1F0F,0x1F07,0x0391},
+  {0x1F18,0x1F10,0x0395},  {0x1F19,0x1F11,0x0395},
+  {0x1F1A,0x1F12,0x0395},  {0x1F1B,0x1F13,0x0395},
+  {0x1F1C,0x1F14,0x0395},  {0x1F1D,0x1F15,0x0395},
+  {0x1F16,0x1F16,0x1F16},  {0x1F17,0x1F17,0x1F17},
+  {0x1F18,0x1F10,0x0395},  {0x1F19,0x1F11,0x0395},
+  {0x1F1A,0x1F12,0x0395},  {0x1F1B,0x1F13,0x0395},
+  {0x1F1C,0x1F14,0x0395},  {0x1F1D,0x1F15,0x0395},
+  {0x1F1E,0x1F1E,0x1F1E},  {0x1F1F,0x1F1F,0x1F1F},
+  {0x1F28,0x1F20,0x0397},  {0x1F29,0x1F21,0x0397},
+  {0x1F2A,0x1F22,0x0397},  {0x1F2B,0x1F23,0x0397},
+  {0x1F2C,0x1F24,0x0397},  {0x1F2D,0x1F25,0x0397},
+  {0x1F2E,0x1F26,0x0397},  {0x1F2F,0x1F27,0x0397},
+  {0x1F28,0x1F20,0x0397},  {0x1F29,0x1F21,0x0397},
+  {0x1F2A,0x1F22,0x0397},  {0x1F2B,0x1F23,0x0397},
+  {0x1F2C,0x1F24,0x0397},  {0x1F2D,0x1F25,0x0397},
+  {0x1F2E,0x1F26,0x0397},  {0x1F2F,0x1F27,0x0397},
+  {0x1F38,0x1F30,0x0399},  {0x1F39,0x1F31,0x0399},
+  {0x1F3A,0x1F32,0x0399},  {0x1F3B,0x1F33,0x0399},
+  {0x1F3C,0x1F34,0x0399},  {0x1F3D,0x1F35,0x0399},
+  {0x1F3E,0x1F36,0x0399},  {0x1F3F,0x1F37,0x0399},
+  {0x1F38,0x1F30,0x0399},  {0x1F39,0x1F31,0x0399},
+  {0x1F3A,0x1F32,0x0399},  {0x1F3B,0x1F33,0x0399},
+  {0x1F3C,0x1F34,0x0399},  {0x1F3D,0x1F35,0x0399},
+  {0x1F3E,0x1F36,0x0399},  {0x1F3F,0x1F37,0x0399},
+  {0x1F48,0x1F40,0x039F},  {0x1F49,0x1F41,0x039F},
+  {0x1F4A,0x1F42,0x039F},  {0x1F4B,0x1F43,0x039F},
+  {0x1F4C,0x1F44,0x039F},  {0x1F4D,0x1F45,0x039F},
+  {0x1F46,0x1F46,0x1F46},  {0x1F47,0x1F47,0x1F47},
+  {0x1F48,0x1F40,0x039F},  {0x1F49,0x1F41,0x039F},
+  {0x1F4A,0x1F42,0x039F},  {0x1F4B,0x1F43,0x039F},
+  {0x1F4C,0x1F44,0x039F},  {0x1F4D,0x1F45,0x039F},
+  {0x1F4E,0x1F4E,0x1F4E},  {0x1F4F,0x1F4F,0x1F4F},
+  {0x1F50,0x1F50,0x03A5},  {0x1F59,0x1F51,0x03A5},
+  {0x1F52,0x1F52,0x03A5},  {0x1F5B,0x1F53,0x03A5},
+  {0x1F54,0x1F54,0x03A5},  {0x1F5D,0x1F55,0x03A5},
+  {0x1F56,0x1F56,0x03A5},  {0x1F5F,0x1F57,0x03A5},
+  {0x1F58,0x1F58,0x1F58},  {0x1F59,0x1F51,0x03A5},
+  {0x1F5A,0x1F5A,0x1F5A},  {0x1F5B,0x1F53,0x03A5},
+  {0x1F5C,0x1F5C,0x1F5C},  {0x1F5D,0x1F55,0x03A5},
+  {0x1F5E,0x1F5E,0x1F5E},  {0x1F5F,0x1F57,0x03A5},
+  {0x1F68,0x1F60,0x03A9},  {0x1F69,0x1F61,0x03A9},
+  {0x1F6A,0x1F62,0x03A9},  {0x1F6B,0x1F63,0x03A9},
+  {0x1F6C,0x1F64,0x03A9},  {0x1F6D,0x1F65,0x03A9},
+  {0x1F6E,0x1F66,0x03A9},  {0x1F6F,0x1F67,0x03A9},
+  {0x1F68,0x1F60,0x03A9},  {0x1F69,0x1F61,0x03A9},
+  {0x1F6A,0x1F62,0x03A9},  {0x1F6B,0x1F63,0x03A9},
+  {0x1F6C,0x1F64,0x03A9},  {0x1F6D,0x1F65,0x03A9},
+  {0x1F6E,0x1F66,0x03A9},  {0x1F6F,0x1F67,0x03A9},
+  {0x1FBA,0x1F70,0x0391},  {0x1FBB,0x1F71,0x1FBB},
+  {0x1FC8,0x1F72,0x0395},  {0x1FC9,0x1F73,0x1FC9},
+  {0x1FCA,0x1F74,0x0397},  {0x1FCB,0x1F75,0x1FCB},
+  {0x1FDA,0x1F76,0x0399},  {0x1FDB,0x1F77,0x1FDB},
+  {0x1FF8,0x1F78,0x039F},  {0x1FF9,0x1F79,0x1FF9},
+  {0x1FEA,0x1F7A,0x03A5},  {0x1FEB,0x1F7B,0x1FEB},
+  {0x1FFA,0x1F7C,0x03A9},  {0x1FFB,0x1F7D,0x1FFB},
+  {0x1F7E,0x1F7E,0x1F7E},  {0x1F7F,0x1F7F,0x1F7F},
+  {0x1F88,0x1F80,0x0391},  {0x1F89,0x1F81,0x0391},
+  {0x1F8A,0x1F82,0x0391},  {0x1F8B,0x1F83,0x0391},
+  {0x1F8C,0x1F84,0x0391},  {0x1F8D,0x1F85,0x0391},
+  {0x1F8E,0x1F86,0x0391},  {0x1F8F,0x1F87,0x0391},
+  {0x1F88,0x1F80,0x0391},  {0x1F89,0x1F81,0x0391},
+  {0x1F8A,0x1F82,0x0391},  {0x1F8B,0x1F83,0x0391},
+  {0x1F8C,0x1F84,0x0391},  {0x1F8D,0x1F85,0x0391},
+  {0x1F8E,0x1F86,0x0391},  {0x1F8F,0x1F87,0x0391},
+  {0x1F98,0x1F90,0x0397},  {0x1F99,0x1F91,0x0397},
+  {0x1F9A,0x1F92,0x0397},  {0x1F9B,0x1F93,0x0397},
+  {0x1F9C,0x1F94,0x0397},  {0x1F9D,0x1F95,0x0397},
+  {0x1F9E,0x1F96,0x0397},  {0x1F9F,0x1F97,0x0397},
+  {0x1F98,0x1F90,0x0397},  {0x1F99,0x1F91,0x0397},
+  {0x1F9A,0x1F92,0x0397},  {0x1F9B,0x1F93,0x0397},
+  {0x1F9C,0x1F94,0x0397},  {0x1F9D,0x1F95,0x0397},
+  {0x1F9E,0x1F96,0x0397},  {0x1F9F,0x1F97,0x0397},
+  {0x1FA8,0x1FA0,0x03A9},  {0x1FA9,0x1FA1,0x03A9},
+  {0x1FAA,0x1FA2,0x03A9},  {0x1FAB,0x1FA3,0x03A9},
+  {0x1FAC,0x1FA4,0x03A9},  {0x1FAD,0x1FA5,0x03A9},
+  {0x1FAE,0x1FA6,0x03A9},  {0x1FAF,0x1FA7,0x03A9},
+  {0x1FA8,0x1FA0,0x03A9},  {0x1FA9,0x1FA1,0x03A9},
+  {0x1FAA,0x1FA2,0x03A9},  {0x1FAB,0x1FA3,0x03A9},
+  {0x1FAC,0x1FA4,0x03A9},  {0x1FAD,0x1FA5,0x03A9},
+  {0x1FAE,0x1FA6,0x03A9},  {0x1FAF,0x1FA7,0x03A9},
+  {0x1FB8,0x1FB0,0x0391},  {0x1FB9,0x1FB1,0x0391},
+  {0x1FB2,0x1FB2,0x0391},  {0x1FBC,0x1FB3,0x0391},
+  {0x1FB4,0x1FB4,0x0391},  {0x1FB5,0x1FB5,0x1FB5},
+  {0x1FB6,0x1FB6,0x0391},  {0x1FB7,0x1FB7,0x0391},
+  {0x1FB8,0x1FB0,0x0391},  {0x1FB9,0x1FB1,0x0391},
+  {0x1FBA,0x1F70,0x0391},  {0x1FBB,0x1F71,0x1FBB},
+  {0x1FBC,0x1FB3,0x0391},  {0x1FBD,0x1FBD,0x1FBD},
+  {0x0399,0x1FBE,0x0399},  {0x1FBF,0x1FBF,0x1FBF},
+  {0x1FC0,0x1FC0,0x1FC0},  {0x1FC1,0x1FC1,0x1FC1},
+  {0x1FC2,0x1FC2,0x0397},  {0x1FCC,0x1FC3,0x0397},
+  {0x1FC4,0x1FC4,0x0397},  {0x1FC5,0x1FC5,0x1FC5},
+  {0x1FC6,0x1FC6,0x0397},  {0x1FC7,0x1FC7,0x0397},
+  {0x1FC8,0x1F72,0x0395},  {0x1FC9,0x1F73,0x1FC9},
+  {0x1FCA,0x1F74,0x0397},  {0x1FCB,0x1F75,0x1FCB},
+  {0x1FCC,0x1FC3,0x0397},  {0x1FCD,0x1FCD,0x1FCD},
+  {0x1FCE,0x1FCE,0x1FCE},  {0x1FCF,0x1FCF,0x1FCF},
+  {0x1FD8,0x1FD0,0x0399},  {0x1FD9,0x1FD1,0x0399},
+  {0x1FD2,0x1FD2,0x0399},  {0x1FD3,0x1FD3,0x1FD3},
+  {0x1FD4,0x1FD4,0x1FD4},  {0x1FD5,0x1FD5,0x1FD5},
+  {0x1FD6,0x1FD6,0x0399},  {0x1FD7,0x1FD7,0x0399},
+  {0x1FD8,0x1FD0,0x0399},  {0x1FD9,0x1FD1,0x0399},
+  {0x1FDA,0x1F76,0x0399},  {0x1FDB,0x1F77,0x1FDB},
+  {0x1FDC,0x1FDC,0x1FDC},  {0x1FDD,0x1FDD,0x1FDD},
+  {0x1FDE,0x1FDE,0x1FDE},  {0x1FDF,0x1FDF,0x1FDF},
+  {0x1FE8,0x1FE0,0x03A5},  {0x1FE9,0x1FE1,0x03A5},
+  {0x1FE2,0x1FE2,0x03A5},  {0x1FE3,0x1FE3,0x1FE3},
+  {0x1FE4,0x1FE4,0x03A1},  {0x1FEC,0x1FE5,0x03A1},
+  {0x1FE6,0x1FE6,0x03A5},  {0x1FE7,0x1FE7,0x03A5},
+  {0x1FE8,0x1FE0,0x03A5},  {0x1FE9,0x1FE1,0x03A5},
+  {0x1FEA,0x1F7A,0x03A5},  {0x1FEB,0x1F7B,0x1FEB},
+  {0x1FEC,0x1FE5,0x03A1},  {0x1FED,0x1FED,0x1FED},
+  {0x1FEE,0x1FEE,0x1FEE},  {0x1FEF,0x1FEF,0x1FEF},
+  {0x1FF0,0x1FF0,0x1FF0},  {0x1FF1,0x1FF1,0x1FF1},
+  {0x1FF2,0x1FF2,0x03A9},  {0x1FFC,0x1FF3,0x03A9},
+  {0x1FF4,0x1FF4,0x03A9},  {0x1FF5,0x1FF5,0x1FF5},
+  {0x1FF6,0x1FF6,0x03A9},  {0x1FF7,0x1FF7,0x03A9},
+  {0x1FF8,0x1F78,0x039F},  {0x1FF9,0x1F79,0x1FF9},
+  {0x1FFA,0x1F7C,0x03A9},  {0x1FFB,0x1F7D,0x1FFB},
+  {0x1FFC,0x1FF3,0x03A9},  {0x1FFD,0x1FFD,0x1FFD},
+  {0x1FFE,0x1FFE,0x1FFE},  {0x1FFF,0x1FFF,0x1FFF}
+};
+
+static MY_UNICASE_INFO plane21[]={
+  {0x2100,0x2100,0x2100},  {0x2101,0x2101,0x2101},
+  {0x2102,0x2102,0x2102},  {0x2103,0x2103,0x2103},
+  {0x2104,0x2104,0x2104},  {0x2105,0x2105,0x2105},
+  {0x2106,0x2106,0x2106},  {0x2107,0x2107,0x2107},
+  {0x2108,0x2108,0x2108},  {0x2109,0x2109,0x2109},
+  {0x210A,0x210A,0x210A},  {0x210B,0x210B,0x210B},
+  {0x210C,0x210C,0x210C},  {0x210D,0x210D,0x210D},
+  {0x210E,0x210E,0x210E},  {0x210F,0x210F,0x210F},
+  {0x2110,0x2110,0x2110},  {0x2111,0x2111,0x2111},
+  {0x2112,0x2112,0x2112},  {0x2113,0x2113,0x2113},
+  {0x2114,0x2114,0x2114},  {0x2115,0x2115,0x2115},
+  {0x2116,0x2116,0x2116},  {0x2117,0x2117,0x2117},
+  {0x2118,0x2118,0x2118},  {0x2119,0x2119,0x2119},
+  {0x211A,0x211A,0x211A},  {0x211B,0x211B,0x211B},
+  {0x211C,0x211C,0x211C},  {0x211D,0x211D,0x211D},
+  {0x211E,0x211E,0x211E},  {0x211F,0x211F,0x211F},
+  {0x2120,0x2120,0x2120},  {0x2121,0x2121,0x2121},
+  {0x2122,0x2122,0x2122},  {0x2123,0x2123,0x2123},
+  {0x2124,0x2124,0x2124},  {0x2125,0x2125,0x2125},
+  {0x2126,0x03C9,0x2126},  {0x2127,0x2127,0x2127},
+  {0x2128,0x2128,0x2128},  {0x2129,0x2129,0x2129},
+  {0x212A,0x006B,0x212A},  {0x212B,0x00E5,0x212B},
+  {0x212C,0x212C,0x212C},  {0x212D,0x212D,0x212D},
+  {0x212E,0x212E,0x212E},  {0x212F,0x212F,0x212F},
+  {0x2130,0x2130,0x2130},  {0x2131,0x2131,0x2131},
+  {0x2132,0x2132,0x2132},  {0x2133,0x2133,0x2133},
+  {0x2134,0x2134,0x2134},  {0x2135,0x2135,0x2135},
+  {0x2136,0x2136,0x2136},  {0x2137,0x2137,0x2137},
+  {0x2138,0x2138,0x2138},  {0x2139,0x2139,0x2139},
+  {0x213A,0x213A,0x213A},  {0x213B,0x213B,0x213B},
+  {0x213C,0x213C,0x213C},  {0x213D,0x213D,0x213D},
+  {0x213E,0x213E,0x213E},  {0x213F,0x213F,0x213F},
+  {0x2140,0x2140,0x2140},  {0x2141,0x2141,0x2141},
+  {0x2142,0x2142,0x2142},  {0x2143,0x2143,0x2143},
+  {0x2144,0x2144,0x2144},  {0x2145,0x2145,0x2145},
+  {0x2146,0x2146,0x2146},  {0x2147,0x2147,0x2147},
+  {0x2148,0x2148,0x2148},  {0x2149,0x2149,0x2149},
+  {0x214A,0x214A,0x214A},  {0x214B,0x214B,0x214B},
+  {0x214C,0x214C,0x214C},  {0x214D,0x214D,0x214D},
+  {0x214E,0x214E,0x214E},  {0x214F,0x214F,0x214F},
+  {0x2150,0x2150,0x2150},  {0x2151,0x2151,0x2151},
+  {0x2152,0x2152,0x2152},  {0x2153,0x2153,0x2153},
+  {0x2154,0x2154,0x2154},  {0x2155,0x2155,0x2155},
+  {0x2156,0x2156,0x2156},  {0x2157,0x2157,0x2157},
+  {0x2158,0x2158,0x2158},  {0x2159,0x2159,0x2159},
+  {0x215A,0x215A,0x215A},  {0x215B,0x215B,0x215B},
+  {0x215C,0x215C,0x215C},  {0x215D,0x215D,0x215D},
+  {0x215E,0x215E,0x215E},  {0x215F,0x215F,0x215F},
+  {0x2160,0x2170,0x2160},  {0x2161,0x2171,0x2161},
+  {0x2162,0x2172,0x2162},  {0x2163,0x2173,0x2163},
+  {0x2164,0x2174,0x2164},  {0x2165,0x2175,0x2165},
+  {0x2166,0x2176,0x2166},  {0x2167,0x2177,0x2167},
+  {0x2168,0x2178,0x2168},  {0x2169,0x2179,0x2169},
+  {0x216A,0x217A,0x216A},  {0x216B,0x217B,0x216B},
+  {0x216C,0x217C,0x216C},  {0x216D,0x217D,0x216D},
+  {0x216E,0x217E,0x216E},  {0x216F,0x217F,0x216F},
+  {0x2160,0x2170,0x2160},  {0x2161,0x2171,0x2161},
+  {0x2162,0x2172,0x2162},  {0x2163,0x2173,0x2163},
+  {0x2164,0x2174,0x2164},  {0x2165,0x2175,0x2165},
+  {0x2166,0x2176,0x2166},  {0x2167,0x2177,0x2167},
+  {0x2168,0x2178,0x2168},  {0x2169,0x2179,0x2169},
+  {0x216A,0x217A,0x216A},  {0x216B,0x217B,0x216B},
+  {0x216C,0x217C,0x216C},  {0x216D,0x217D,0x216D},
+  {0x216E,0x217E,0x216E},  {0x216F,0x217F,0x216F},
+  {0x2180,0x2180,0x2180},  {0x2181,0x2181,0x2181},
+  {0x2182,0x2182,0x2182},  {0x2183,0x2183,0x2183},
+  {0x2184,0x2184,0x2184},  {0x2185,0x2185,0x2185},
+  {0x2186,0x2186,0x2186},  {0x2187,0x2187,0x2187},
+  {0x2188,0x2188,0x2188},  {0x2189,0x2189,0x2189},
+  {0x218A,0x218A,0x218A},  {0x218B,0x218B,0x218B},
+  {0x218C,0x218C,0x218C},  {0x218D,0x218D,0x218D},
+  {0x218E,0x218E,0x218E},  {0x218F,0x218F,0x218F},
+  {0x2190,0x2190,0x2190},  {0x2191,0x2191,0x2191},
+  {0x2192,0x2192,0x2192},  {0x2193,0x2193,0x2193},
+  {0x2194,0x2194,0x2194},  {0x2195,0x2195,0x2195},
+  {0x2196,0x2196,0x2196},  {0x2197,0x2197,0x2197},
+  {0x2198,0x2198,0x2198},  {0x2199,0x2199,0x2199},
+  {0x219A,0x219A,0x219A},  {0x219B,0x219B,0x219B},
+  {0x219C,0x219C,0x219C},  {0x219D,0x219D,0x219D},
+  {0x219E,0x219E,0x219E},  {0x219F,0x219F,0x219F},
+  {0x21A0,0x21A0,0x21A0},  {0x21A1,0x21A1,0x21A1},
+  {0x21A2,0x21A2,0x21A2},  {0x21A3,0x21A3,0x21A3},
+  {0x21A4,0x21A4,0x21A4},  {0x21A5,0x21A5,0x21A5},
+  {0x21A6,0x21A6,0x21A6},  {0x21A7,0x21A7,0x21A7},
+  {0x21A8,0x21A8,0x21A8},  {0x21A9,0x21A9,0x21A9},
+  {0x21AA,0x21AA,0x21AA},  {0x21AB,0x21AB,0x21AB},
+  {0x21AC,0x21AC,0x21AC},  {0x21AD,0x21AD,0x21AD},
+  {0x21AE,0x21AE,0x21AE},  {0x21AF,0x21AF,0x21AF},
+  {0x21B0,0x21B0,0x21B0},  {0x21B1,0x21B1,0x21B1},
+  {0x21B2,0x21B2,0x21B2},  {0x21B3,0x21B3,0x21B3},
+  {0x21B4,0x21B4,0x21B4},  {0x21B5,0x21B5,0x21B5},
+  {0x21B6,0x21B6,0x21B6},  {0x21B7,0x21B7,0x21B7},
+  {0x21B8,0x21B8,0x21B8},  {0x21B9,0x21B9,0x21B9},
+  {0x21BA,0x21BA,0x21BA},  {0x21BB,0x21BB,0x21BB},
+  {0x21BC,0x21BC,0x21BC},  {0x21BD,0x21BD,0x21BD},
+  {0x21BE,0x21BE,0x21BE},  {0x21BF,0x21BF,0x21BF},
+  {0x21C0,0x21C0,0x21C0},  {0x21C1,0x21C1,0x21C1},
+  {0x21C2,0x21C2,0x21C2},  {0x21C3,0x21C3,0x21C3},
+  {0x21C4,0x21C4,0x21C4},  {0x21C5,0x21C5,0x21C5},
+  {0x21C6,0x21C6,0x21C6},  {0x21C7,0x21C7,0x21C7},
+  {0x21C8,0x21C8,0x21C8},  {0x21C9,0x21C9,0x21C9},
+  {0x21CA,0x21CA,0x21CA},  {0x21CB,0x21CB,0x21CB},
+  {0x21CC,0x21CC,0x21CC},  {0x21CD,0x21CD,0x21CD},
+  {0x21CE,0x21CE,0x21CE},  {0x21CF,0x21CF,0x21CF},
+  {0x21D0,0x21D0,0x21D0},  {0x21D1,0x21D1,0x21D1},
+  {0x21D2,0x21D2,0x21D2},  {0x21D3,0x21D3,0x21D3},
+  {0x21D4,0x21D4,0x21D4},  {0x21D5,0x21D5,0x21D5},
+  {0x21D6,0x21D6,0x21D6},  {0x21D7,0x21D7,0x21D7},
+  {0x21D8,0x21D8,0x21D8},  {0x21D9,0x21D9,0x21D9},
+  {0x21DA,0x21DA,0x21DA},  {0x21DB,0x21DB,0x21DB},
+  {0x21DC,0x21DC,0x21DC},  {0x21DD,0x21DD,0x21DD},
+  {0x21DE,0x21DE,0x21DE},  {0x21DF,0x21DF,0x21DF},
+  {0x21E0,0x21E0,0x21E0},  {0x21E1,0x21E1,0x21E1},
+  {0x21E2,0x21E2,0x21E2},  {0x21E3,0x21E3,0x21E3},
+  {0x21E4,0x21E4,0x21E4},  {0x21E5,0x21E5,0x21E5},
+  {0x21E6,0x21E6,0x21E6},  {0x21E7,0x21E7,0x21E7},
+  {0x21E8,0x21E8,0x21E8},  {0x21E9,0x21E9,0x21E9},
+  {0x21EA,0x21EA,0x21EA},  {0x21EB,0x21EB,0x21EB},
+  {0x21EC,0x21EC,0x21EC},  {0x21ED,0x21ED,0x21ED},
+  {0x21EE,0x21EE,0x21EE},  {0x21EF,0x21EF,0x21EF},
+  {0x21F0,0x21F0,0x21F0},  {0x21F1,0x21F1,0x21F1},
+  {0x21F2,0x21F2,0x21F2},  {0x21F3,0x21F3,0x21F3},
+  {0x21F4,0x21F4,0x21F4},  {0x21F5,0x21F5,0x21F5},
+  {0x21F6,0x21F6,0x21F6},  {0x21F7,0x21F7,0x21F7},
+  {0x21F8,0x21F8,0x21F8},  {0x21F9,0x21F9,0x21F9},
+  {0x21FA,0x21FA,0x21FA},  {0x21FB,0x21FB,0x21FB},
+  {0x21FC,0x21FC,0x21FC},  {0x21FD,0x21FD,0x21FD},
+  {0x21FE,0x21FE,0x21FE},  {0x21FF,0x21FF,0x21FF}
+};
+
+static MY_UNICASE_INFO plane24[]={
+  {0x2400,0x2400,0x2400},  {0x2401,0x2401,0x2401},
+  {0x2402,0x2402,0x2402},  {0x2403,0x2403,0x2403},
+  {0x2404,0x2404,0x2404},  {0x2405,0x2405,0x2405},
+  {0x2406,0x2406,0x2406},  {0x2407,0x2407,0x2407},
+  {0x2408,0x2408,0x2408},  {0x2409,0x2409,0x2409},
+  {0x240A,0x240A,0x240A},  {0x240B,0x240B,0x240B},
+  {0x240C,0x240C,0x240C},  {0x240D,0x240D,0x240D},
+  {0x240E,0x240E,0x240E},  {0x240F,0x240F,0x240F},
+  {0x2410,0x2410,0x2410},  {0x2411,0x2411,0x2411},
+  {0x2412,0x2412,0x2412},  {0x2413,0x2413,0x2413},
+  {0x2414,0x2414,0x2414},  {0x2415,0x2415,0x2415},
+  {0x2416,0x2416,0x2416},  {0x2417,0x2417,0x2417},
+  {0x2418,0x2418,0x2418},  {0x2419,0x2419,0x2419},
+  {0x241A,0x241A,0x241A},  {0x241B,0x241B,0x241B},
+  {0x241C,0x241C,0x241C},  {0x241D,0x241D,0x241D},
+  {0x241E,0x241E,0x241E},  {0x241F,0x241F,0x241F},
+  {0x2420,0x2420,0x2420},  {0x2421,0x2421,0x2421},
+  {0x2422,0x2422,0x2422},  {0x2423,0x2423,0x2423},
+  {0x2424,0x2424,0x2424},  {0x2425,0x2425,0x2425},
+  {0x2426,0x2426,0x2426},  {0x2427,0x2427,0x2427},
+  {0x2428,0x2428,0x2428},  {0x2429,0x2429,0x2429},
+  {0x242A,0x242A,0x242A},  {0x242B,0x242B,0x242B},
+  {0x242C,0x242C,0x242C},  {0x242D,0x242D,0x242D},
+  {0x242E,0x242E,0x242E},  {0x242F,0x242F,0x242F},
+  {0x2430,0x2430,0x2430},  {0x2431,0x2431,0x2431},
+  {0x2432,0x2432,0x2432},  {0x2433,0x2433,0x2433},
+  {0x2434,0x2434,0x2434},  {0x2435,0x2435,0x2435},
+  {0x2436,0x2436,0x2436},  {0x2437,0x2437,0x2437},
+  {0x2438,0x2438,0x2438},  {0x2439,0x2439,0x2439},
+  {0x243A,0x243A,0x243A},  {0x243B,0x243B,0x243B},
+  {0x243C,0x243C,0x243C},  {0x243D,0x243D,0x243D},
+  {0x243E,0x243E,0x243E},  {0x243F,0x243F,0x243F},
+  {0x2440,0x2440,0x2440},  {0x2441,0x2441,0x2441},
+  {0x2442,0x2442,0x2442},  {0x2443,0x2443,0x2443},
+  {0x2444,0x2444,0x2444},  {0x2445,0x2445,0x2445},
+  {0x2446,0x2446,0x2446},  {0x2447,0x2447,0x2447},
+  {0x2448,0x2448,0x2448},  {0x2449,0x2449,0x2449},
+  {0x244A,0x244A,0x244A},  {0x244B,0x244B,0x244B},
+  {0x244C,0x244C,0x244C},  {0x244D,0x244D,0x244D},
+  {0x244E,0x244E,0x244E},  {0x244F,0x244F,0x244F},
+  {0x2450,0x2450,0x2450},  {0x2451,0x2451,0x2451},
+  {0x2452,0x2452,0x2452},  {0x2453,0x2453,0x2453},
+  {0x2454,0x2454,0x2454},  {0x2455,0x2455,0x2455},
+  {0x2456,0x2456,0x2456},  {0x2457,0x2457,0x2457},
+  {0x2458,0x2458,0x2458},  {0x2459,0x2459,0x2459},
+  {0x245A,0x245A,0x245A},  {0x245B,0x245B,0x245B},
+  {0x245C,0x245C,0x245C},  {0x245D,0x245D,0x245D},
+  {0x245E,0x245E,0x245E},  {0x245F,0x245F,0x245F},
+  {0x2460,0x2460,0x2460},  {0x2461,0x2461,0x2461},
+  {0x2462,0x2462,0x2462},  {0x2463,0x2463,0x2463},
+  {0x2464,0x2464,0x2464},  {0x2465,0x2465,0x2465},
+  {0x2466,0x2466,0x2466},  {0x2467,0x2467,0x2467},
+  {0x2468,0x2468,0x2468},  {0x2469,0x2469,0x2469},
+  {0x246A,0x246A,0x246A},  {0x246B,0x246B,0x246B},
+  {0x246C,0x246C,0x246C},  {0x246D,0x246D,0x246D},
+  {0x246E,0x246E,0x246E},  {0x246F,0x246F,0x246F},
+  {0x2470,0x2470,0x2470},  {0x2471,0x2471,0x2471},
+  {0x2472,0x2472,0x2472},  {0x2473,0x2473,0x2473},
+  {0x2474,0x2474,0x2474},  {0x2475,0x2475,0x2475},
+  {0x2476,0x2476,0x2476},  {0x2477,0x2477,0x2477},
+  {0x2478,0x2478,0x2478},  {0x2479,0x2479,0x2479},
+  {0x247A,0x247A,0x247A},  {0x247B,0x247B,0x247B},
+  {0x247C,0x247C,0x247C},  {0x247D,0x247D,0x247D},
+  {0x247E,0x247E,0x247E},  {0x247F,0x247F,0x247F},
+  {0x2480,0x2480,0x2480},  {0x2481,0x2481,0x2481},
+  {0x2482,0x2482,0x2482},  {0x2483,0x2483,0x2483},
+  {0x2484,0x2484,0x2484},  {0x2485,0x2485,0x2485},
+  {0x2486,0x2486,0x2486},  {0x2487,0x2487,0x2487},
+  {0x2488,0x2488,0x2488},  {0x2489,0x2489,0x2489},
+  {0x248A,0x248A,0x248A},  {0x248B,0x248B,0x248B},
+  {0x248C,0x248C,0x248C},  {0x248D,0x248D,0x248D},
+  {0x248E,0x248E,0x248E},  {0x248F,0x248F,0x248F},
+  {0x2490,0x2490,0x2490},  {0x2491,0x2491,0x2491},
+  {0x2492,0x2492,0x2492},  {0x2493,0x2493,0x2493},
+  {0x2494,0x2494,0x2494},  {0x2495,0x2495,0x2495},
+  {0x2496,0x2496,0x2496},  {0x2497,0x2497,0x2497},
+  {0x2498,0x2498,0x2498},  {0x2499,0x2499,0x2499},
+  {0x249A,0x249A,0x249A},  {0x249B,0x249B,0x249B},
+  {0x249C,0x249C,0x249C},  {0x249D,0x249D,0x249D},
+  {0x249E,0x249E,0x249E},  {0x249F,0x249F,0x249F},
+  {0x24A0,0x24A0,0x24A0},  {0x24A1,0x24A1,0x24A1},
+  {0x24A2,0x24A2,0x24A2},  {0x24A3,0x24A3,0x24A3},
+  {0x24A4,0x24A4,0x24A4},  {0x24A5,0x24A5,0x24A5},
+  {0x24A6,0x24A6,0x24A6},  {0x24A7,0x24A7,0x24A7},
+  {0x24A8,0x24A8,0x24A8},  {0x24A9,0x24A9,0x24A9},
+  {0x24AA,0x24AA,0x24AA},  {0x24AB,0x24AB,0x24AB},
+  {0x24AC,0x24AC,0x24AC},  {0x24AD,0x24AD,0x24AD},
+  {0x24AE,0x24AE,0x24AE},  {0x24AF,0x24AF,0x24AF},
+  {0x24B0,0x24B0,0x24B0},  {0x24B1,0x24B1,0x24B1},
+  {0x24B2,0x24B2,0x24B2},  {0x24B3,0x24B3,0x24B3},
+  {0x24B4,0x24B4,0x24B4},  {0x24B5,0x24B5,0x24B5},
+  {0x24B6,0x24D0,0x24B6},  {0x24B7,0x24D1,0x24B7},
+  {0x24B8,0x24D2,0x24B8},  {0x24B9,0x24D3,0x24B9},
+  {0x24BA,0x24D4,0x24BA},  {0x24BB,0x24D5,0x24BB},
+  {0x24BC,0x24D6,0x24BC},  {0x24BD,0x24D7,0x24BD},
+  {0x24BE,0x24D8,0x24BE},  {0x24BF,0x24D9,0x24BF},
+  {0x24C0,0x24DA,0x24C0},  {0x24C1,0x24DB,0x24C1},
+  {0x24C2,0x24DC,0x24C2},  {0x24C3,0x24DD,0x24C3},
+  {0x24C4,0x24DE,0x24C4},  {0x24C5,0x24DF,0x24C5},
+  {0x24C6,0x24E0,0x24C6},  {0x24C7,0x24E1,0x24C7},
+  {0x24C8,0x24E2,0x24C8},  {0x24C9,0x24E3,0x24C9},
+  {0x24CA,0x24E4,0x24CA},  {0x24CB,0x24E5,0x24CB},
+  {0x24CC,0x24E6,0x24CC},  {0x24CD,0x24E7,0x24CD},
+  {0x24CE,0x24E8,0x24CE},  {0x24CF,0x24E9,0x24CF},
+  {0x24B6,0x24D0,0x24B6},  {0x24B7,0x24D1,0x24B7},
+  {0x24B8,0x24D2,0x24B8},  {0x24B9,0x24D3,0x24B9},
+  {0x24BA,0x24D4,0x24BA},  {0x24BB,0x24D5,0x24BB},
+  {0x24BC,0x24D6,0x24BC},  {0x24BD,0x24D7,0x24BD},
+  {0x24BE,0x24D8,0x24BE},  {0x24BF,0x24D9,0x24BF},
+  {0x24C0,0x24DA,0x24C0},  {0x24C1,0x24DB,0x24C1},
+  {0x24C2,0x24DC,0x24C2},  {0x24C3,0x24DD,0x24C3},
+  {0x24C4,0x24DE,0x24C4},  {0x24C5,0x24DF,0x24C5},
+  {0x24C6,0x24E0,0x24C6},  {0x24C7,0x24E1,0x24C7},
+  {0x24C8,0x24E2,0x24C8},  {0x24C9,0x24E3,0x24C9},
+  {0x24CA,0x24E4,0x24CA},  {0x24CB,0x24E5,0x24CB},
+  {0x24CC,0x24E6,0x24CC},  {0x24CD,0x24E7,0x24CD},
+  {0x24CE,0x24E8,0x24CE},  {0x24CF,0x24E9,0x24CF},
+  {0x24EA,0x24EA,0x24EA},  {0x24EB,0x24EB,0x24EB},
+  {0x24EC,0x24EC,0x24EC},  {0x24ED,0x24ED,0x24ED},
+  {0x24EE,0x24EE,0x24EE},  {0x24EF,0x24EF,0x24EF},
+  {0x24F0,0x24F0,0x24F0},  {0x24F1,0x24F1,0x24F1},
+  {0x24F2,0x24F2,0x24F2},  {0x24F3,0x24F3,0x24F3},
+  {0x24F4,0x24F4,0x24F4},  {0x24F5,0x24F5,0x24F5},
+  {0x24F6,0x24F6,0x24F6},  {0x24F7,0x24F7,0x24F7},
+  {0x24F8,0x24F8,0x24F8},  {0x24F9,0x24F9,0x24F9},
+  {0x24FA,0x24FA,0x24FA},  {0x24FB,0x24FB,0x24FB},
+  {0x24FC,0x24FC,0x24FC},  {0x24FD,0x24FD,0x24FD},
+  {0x24FE,0x24FE,0x24FE},  {0x24FF,0x24FF,0x24FF}
+};
+
+static MY_UNICASE_INFO planeFF[]={
+  {0xFF00,0xFF00,0xFF00},  {0xFF01,0xFF01,0xFF01},
+  {0xFF02,0xFF02,0xFF02},  {0xFF03,0xFF03,0xFF03},
+  {0xFF04,0xFF04,0xFF04},  {0xFF05,0xFF05,0xFF05},
+  {0xFF06,0xFF06,0xFF06},  {0xFF07,0xFF07,0xFF07},
+  {0xFF08,0xFF08,0xFF08},  {0xFF09,0xFF09,0xFF09},
+  {0xFF0A,0xFF0A,0xFF0A},  {0xFF0B,0xFF0B,0xFF0B},
+  {0xFF0C,0xFF0C,0xFF0C},  {0xFF0D,0xFF0D,0xFF0D},
+  {0xFF0E,0xFF0E,0xFF0E},  {0xFF0F,0xFF0F,0xFF0F},
+  {0xFF10,0xFF10,0xFF10},  {0xFF11,0xFF11,0xFF11},
+  {0xFF12,0xFF12,0xFF12},  {0xFF13,0xFF13,0xFF13},
+  {0xFF14,0xFF14,0xFF14},  {0xFF15,0xFF15,0xFF15},
+  {0xFF16,0xFF16,0xFF16},  {0xFF17,0xFF17,0xFF17},
+  {0xFF18,0xFF18,0xFF18},  {0xFF19,0xFF19,0xFF19},
+  {0xFF1A,0xFF1A,0xFF1A},  {0xFF1B,0xFF1B,0xFF1B},
+  {0xFF1C,0xFF1C,0xFF1C},  {0xFF1D,0xFF1D,0xFF1D},
+  {0xFF1E,0xFF1E,0xFF1E},  {0xFF1F,0xFF1F,0xFF1F},
+  {0xFF20,0xFF20,0xFF20},  {0xFF21,0xFF41,0xFF21},
+  {0xFF22,0xFF42,0xFF22},  {0xFF23,0xFF43,0xFF23},
+  {0xFF24,0xFF44,0xFF24},  {0xFF25,0xFF45,0xFF25},
+  {0xFF26,0xFF46,0xFF26},  {0xFF27,0xFF47,0xFF27},
+  {0xFF28,0xFF48,0xFF28},  {0xFF29,0xFF49,0xFF29},
+  {0xFF2A,0xFF4A,0xFF2A},  {0xFF2B,0xFF4B,0xFF2B},
+  {0xFF2C,0xFF4C,0xFF2C},  {0xFF2D,0xFF4D,0xFF2D},
+  {0xFF2E,0xFF4E,0xFF2E},  {0xFF2F,0xFF4F,0xFF2F},
+  {0xFF30,0xFF50,0xFF30},  {0xFF31,0xFF51,0xFF31},
+  {0xFF32,0xFF52,0xFF32},  {0xFF33,0xFF53,0xFF33},
+  {0xFF34,0xFF54,0xFF34},  {0xFF35,0xFF55,0xFF35},
+  {0xFF36,0xFF56,0xFF36},  {0xFF37,0xFF57,0xFF37},
+  {0xFF38,0xFF58,0xFF38},  {0xFF39,0xFF59,0xFF39},
+  {0xFF3A,0xFF5A,0xFF3A},  {0xFF3B,0xFF3B,0xFF3B},
+  {0xFF3C,0xFF3C,0xFF3C},  {0xFF3D,0xFF3D,0xFF3D},
+  {0xFF3E,0xFF3E,0xFF3E},  {0xFF3F,0xFF3F,0xFF3F},
+  {0xFF40,0xFF40,0xFF40},  {0xFF21,0xFF41,0xFF21},
+  {0xFF22,0xFF42,0xFF22},  {0xFF23,0xFF43,0xFF23},
+  {0xFF24,0xFF44,0xFF24},  {0xFF25,0xFF45,0xFF25},
+  {0xFF26,0xFF46,0xFF26},  {0xFF27,0xFF47,0xFF27},
+  {0xFF28,0xFF48,0xFF28},  {0xFF29,0xFF49,0xFF29},
+  {0xFF2A,0xFF4A,0xFF2A},  {0xFF2B,0xFF4B,0xFF2B},
+  {0xFF2C,0xFF4C,0xFF2C},  {0xFF2D,0xFF4D,0xFF2D},
+  {0xFF2E,0xFF4E,0xFF2E},  {0xFF2F,0xFF4F,0xFF2F},
+  {0xFF30,0xFF50,0xFF30},  {0xFF31,0xFF51,0xFF31},
+  {0xFF32,0xFF52,0xFF32},  {0xFF33,0xFF53,0xFF33},
+  {0xFF34,0xFF54,0xFF34},  {0xFF35,0xFF55,0xFF35},
+  {0xFF36,0xFF56,0xFF36},  {0xFF37,0xFF57,0xFF37},
+  {0xFF38,0xFF58,0xFF38},  {0xFF39,0xFF59,0xFF39},
+  {0xFF3A,0xFF5A,0xFF3A},  {0xFF5B,0xFF5B,0xFF5B},
+  {0xFF5C,0xFF5C,0xFF5C},  {0xFF5D,0xFF5D,0xFF5D},
+  {0xFF5E,0xFF5E,0xFF5E},  {0xFF5F,0xFF5F,0xFF5F},
+  {0xFF60,0xFF60,0xFF60},  {0xFF61,0xFF61,0xFF61},
+  {0xFF62,0xFF62,0xFF62},  {0xFF63,0xFF63,0xFF63},
+  {0xFF64,0xFF64,0xFF64},  {0xFF65,0xFF65,0xFF65},
+  {0xFF66,0xFF66,0xFF66},  {0xFF67,0xFF67,0xFF67},
+  {0xFF68,0xFF68,0xFF68},  {0xFF69,0xFF69,0xFF69},
+  {0xFF6A,0xFF6A,0xFF6A},  {0xFF6B,0xFF6B,0xFF6B},
+  {0xFF6C,0xFF6C,0xFF6C},  {0xFF6D,0xFF6D,0xFF6D},
+  {0xFF6E,0xFF6E,0xFF6E},  {0xFF6F,0xFF6F,0xFF6F},
+  {0xFF70,0xFF70,0xFF70},  {0xFF71,0xFF71,0xFF71},
+  {0xFF72,0xFF72,0xFF72},  {0xFF73,0xFF73,0xFF73},
+  {0xFF74,0xFF74,0xFF74},  {0xFF75,0xFF75,0xFF75},
+  {0xFF76,0xFF76,0xFF76},  {0xFF77,0xFF77,0xFF77},
+  {0xFF78,0xFF78,0xFF78},  {0xFF79,0xFF79,0xFF79},
+  {0xFF7A,0xFF7A,0xFF7A},  {0xFF7B,0xFF7B,0xFF7B},
+  {0xFF7C,0xFF7C,0xFF7C},  {0xFF7D,0xFF7D,0xFF7D},
+  {0xFF7E,0xFF7E,0xFF7E},  {0xFF7F,0xFF7F,0xFF7F},
+  {0xFF80,0xFF80,0xFF80},  {0xFF81,0xFF81,0xFF81},
+  {0xFF82,0xFF82,0xFF82},  {0xFF83,0xFF83,0xFF83},
+  {0xFF84,0xFF84,0xFF84},  {0xFF85,0xFF85,0xFF85},
+  {0xFF86,0xFF86,0xFF86},  {0xFF87,0xFF87,0xFF87},
+  {0xFF88,0xFF88,0xFF88},  {0xFF89,0xFF89,0xFF89},
+  {0xFF8A,0xFF8A,0xFF8A},  {0xFF8B,0xFF8B,0xFF8B},
+  {0xFF8C,0xFF8C,0xFF8C},  {0xFF8D,0xFF8D,0xFF8D},
+  {0xFF8E,0xFF8E,0xFF8E},  {0xFF8F,0xFF8F,0xFF8F},
+  {0xFF90,0xFF90,0xFF90},  {0xFF91,0xFF91,0xFF91},
+  {0xFF92,0xFF92,0xFF92},  {0xFF93,0xFF93,0xFF93},
+  {0xFF94,0xFF94,0xFF94},  {0xFF95,0xFF95,0xFF95},
+  {0xFF96,0xFF96,0xFF96},  {0xFF97,0xFF97,0xFF97},
+  {0xFF98,0xFF98,0xFF98},  {0xFF99,0xFF99,0xFF99},
+  {0xFF9A,0xFF9A,0xFF9A},  {0xFF9B,0xFF9B,0xFF9B},
+  {0xFF9C,0xFF9C,0xFF9C},  {0xFF9D,0xFF9D,0xFF9D},
+  {0xFF9E,0xFF9E,0xFF9E},  {0xFF9F,0xFF9F,0xFF9F},
+  {0xFFA0,0xFFA0,0xFFA0},  {0xFFA1,0xFFA1,0xFFA1},
+  {0xFFA2,0xFFA2,0xFFA2},  {0xFFA3,0xFFA3,0xFFA3},
+  {0xFFA4,0xFFA4,0xFFA4},  {0xFFA5,0xFFA5,0xFFA5},
+  {0xFFA6,0xFFA6,0xFFA6},  {0xFFA7,0xFFA7,0xFFA7},
+  {0xFFA8,0xFFA8,0xFFA8},  {0xFFA9,0xFFA9,0xFFA9},
+  {0xFFAA,0xFFAA,0xFFAA},  {0xFFAB,0xFFAB,0xFFAB},
+  {0xFFAC,0xFFAC,0xFFAC},  {0xFFAD,0xFFAD,0xFFAD},
+  {0xFFAE,0xFFAE,0xFFAE},  {0xFFAF,0xFFAF,0xFFAF},
+  {0xFFB0,0xFFB0,0xFFB0},  {0xFFB1,0xFFB1,0xFFB1},
+  {0xFFB2,0xFFB2,0xFFB2},  {0xFFB3,0xFFB3,0xFFB3},
+  {0xFFB4,0xFFB4,0xFFB4},  {0xFFB5,0xFFB5,0xFFB5},
+  {0xFFB6,0xFFB6,0xFFB6},  {0xFFB7,0xFFB7,0xFFB7},
+  {0xFFB8,0xFFB8,0xFFB8},  {0xFFB9,0xFFB9,0xFFB9},
+  {0xFFBA,0xFFBA,0xFFBA},  {0xFFBB,0xFFBB,0xFFBB},
+  {0xFFBC,0xFFBC,0xFFBC},  {0xFFBD,0xFFBD,0xFFBD},
+  {0xFFBE,0xFFBE,0xFFBE},  {0xFFBF,0xFFBF,0xFFBF},
+  {0xFFC0,0xFFC0,0xFFC0},  {0xFFC1,0xFFC1,0xFFC1},
+  {0xFFC2,0xFFC2,0xFFC2},  {0xFFC3,0xFFC3,0xFFC3},
+  {0xFFC4,0xFFC4,0xFFC4},  {0xFFC5,0xFFC5,0xFFC5},
+  {0xFFC6,0xFFC6,0xFFC6},  {0xFFC7,0xFFC7,0xFFC7},
+  {0xFFC8,0xFFC8,0xFFC8},  {0xFFC9,0xFFC9,0xFFC9},
+  {0xFFCA,0xFFCA,0xFFCA},  {0xFFCB,0xFFCB,0xFFCB},
+  {0xFFCC,0xFFCC,0xFFCC},  {0xFFCD,0xFFCD,0xFFCD},
+  {0xFFCE,0xFFCE,0xFFCE},  {0xFFCF,0xFFCF,0xFFCF},
+  {0xFFD0,0xFFD0,0xFFD0},  {0xFFD1,0xFFD1,0xFFD1},
+  {0xFFD2,0xFFD2,0xFFD2},  {0xFFD3,0xFFD3,0xFFD3},
+  {0xFFD4,0xFFD4,0xFFD4},  {0xFFD5,0xFFD5,0xFFD5},
+  {0xFFD6,0xFFD6,0xFFD6},  {0xFFD7,0xFFD7,0xFFD7},
+  {0xFFD8,0xFFD8,0xFFD8},  {0xFFD9,0xFFD9,0xFFD9},
+  {0xFFDA,0xFFDA,0xFFDA},  {0xFFDB,0xFFDB,0xFFDB},
+  {0xFFDC,0xFFDC,0xFFDC},  {0xFFDD,0xFFDD,0xFFDD},
+  {0xFFDE,0xFFDE,0xFFDE},  {0xFFDF,0xFFDF,0xFFDF},
+  {0xFFE0,0xFFE0,0xFFE0},  {0xFFE1,0xFFE1,0xFFE1},
+  {0xFFE2,0xFFE2,0xFFE2},  {0xFFE3,0xFFE3,0xFFE3},
+  {0xFFE4,0xFFE4,0xFFE4},  {0xFFE5,0xFFE5,0xFFE5},
+  {0xFFE6,0xFFE6,0xFFE6},  {0xFFE7,0xFFE7,0xFFE7},
+  {0xFFE8,0xFFE8,0xFFE8},  {0xFFE9,0xFFE9,0xFFE9},
+  {0xFFEA,0xFFEA,0xFFEA},  {0xFFEB,0xFFEB,0xFFEB},
+  {0xFFEC,0xFFEC,0xFFEC},  {0xFFED,0xFFED,0xFFED},
+  {0xFFEE,0xFFEE,0xFFEE},  {0xFFEF,0xFFEF,0xFFEF},
+  {0xFFF0,0xFFF0,0xFFF0},  {0xFFF1,0xFFF1,0xFFF1},
+  {0xFFF2,0xFFF2,0xFFF2},  {0xFFF3,0xFFF3,0xFFF3},
+  {0xFFF4,0xFFF4,0xFFF4},  {0xFFF5,0xFFF5,0xFFF5},
+  {0xFFF6,0xFFF6,0xFFF6},  {0xFFF7,0xFFF7,0xFFF7},
+  {0xFFF8,0xFFF8,0xFFF8},  {0xFFF9,0xFFF9,0xFFF9},
+  {0xFFFA,0xFFFA,0xFFFA},  {0xFFFB,0xFFFB,0xFFFB},
+  {0xFFFC,0xFFFC,0xFFFC},  {0xFFFD,0xFFFD,0xFFFD},
+  {0xFFFE,0xFFFE,0xFFFE},  {0xFFFF,0xFFFF,0xFFFF}
+};
+
+namespace stardict_collation {
+MY_UNICASE_INFO *my_unicase_default[256]={
+ plane00, plane01, plane02, plane03, plane04, plane05,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL, plane1E, plane1F,
+    NULL, plane21,    NULL,    NULL, plane24,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL, planeFF
+
+};
+
+}; //namespace
+
+#if 0
+/*
+  Turkish lower/upper mapping:
+  1. LOWER(0x0049 LATIN CAPITAL LETTER I) -> 
+           0x0131 LATIN SMALL   LETTER DOTLESS I
+  2. UPPER(0x0069 LATIN SMALL   LETTER I) -> 
+           0x0130 LATIN CAPITAL LETTER I WITH DOT ABOVE
+*/
+
+static MY_UNICASE_INFO turk00[]=
+{
+  {0x0000,0x0000,0x0000},  {0x0001,0x0001,0x0001},
+  {0x0002,0x0002,0x0002},  {0x0003,0x0003,0x0003},
+  {0x0004,0x0004,0x0004},  {0x0005,0x0005,0x0005},
+  {0x0006,0x0006,0x0006},  {0x0007,0x0007,0x0007},
+  {0x0008,0x0008,0x0008},  {0x0009,0x0009,0x0009},
+  {0x000A,0x000A,0x000A},  {0x000B,0x000B,0x000B},
+  {0x000C,0x000C,0x000C},  {0x000D,0x000D,0x000D},
+  {0x000E,0x000E,0x000E},  {0x000F,0x000F,0x000F},
+  {0x0010,0x0010,0x0010},  {0x0011,0x0011,0x0011},
+  {0x0012,0x0012,0x0012},  {0x0013,0x0013,0x0013},
+  {0x0014,0x0014,0x0014},  {0x0015,0x0015,0x0015},
+  {0x0016,0x0016,0x0016},  {0x0017,0x0017,0x0017},
+  {0x0018,0x0018,0x0018},  {0x0019,0x0019,0x0019},
+  {0x001A,0x001A,0x001A},  {0x001B,0x001B,0x001B},
+  {0x001C,0x001C,0x001C},  {0x001D,0x001D,0x001D},
+  {0x001E,0x001E,0x001E},  {0x001F,0x001F,0x001F},
+  {0x0020,0x0020,0x0020},  {0x0021,0x0021,0x0021},
+  {0x0022,0x0022,0x0022},  {0x0023,0x0023,0x0023},
+  {0x0024,0x0024,0x0024},  {0x0025,0x0025,0x0025},
+  {0x0026,0x0026,0x0026},  {0x0027,0x0027,0x0027},
+  {0x0028,0x0028,0x0028},  {0x0029,0x0029,0x0029},
+  {0x002A,0x002A,0x002A},  {0x002B,0x002B,0x002B},
+  {0x002C,0x002C,0x002C},  {0x002D,0x002D,0x002D},
+  {0x002E,0x002E,0x002E},  {0x002F,0x002F,0x002F},
+  {0x0030,0x0030,0x0030},  {0x0031,0x0031,0x0031},
+  {0x0032,0x0032,0x0032},  {0x0033,0x0033,0x0033},
+  {0x0034,0x0034,0x0034},  {0x0035,0x0035,0x0035},
+  {0x0036,0x0036,0x0036},  {0x0037,0x0037,0x0037},
+  {0x0038,0x0038,0x0038},  {0x0039,0x0039,0x0039},
+  {0x003A,0x003A,0x003A},  {0x003B,0x003B,0x003B},
+  {0x003C,0x003C,0x003C},  {0x003D,0x003D,0x003D},
+  {0x003E,0x003E,0x003E},  {0x003F,0x003F,0x003F},
+  {0x0040,0x0040,0x0040},  {0x0041,0x0061,0x0041},
+  {0x0042,0x0062,0x0042},  {0x0043,0x0063,0x0043},
+  {0x0044,0x0064,0x0044},  {0x0045,0x0065,0x0045},
+  {0x0046,0x0066,0x0046},  {0x0047,0x0067,0x0047},
+  {0x0048,0x0068,0x0048},  {0x0049,0x0131,0x0049},
+  {0x004A,0x006A,0x004A},  {0x004B,0x006B,0x004B},
+  {0x004C,0x006C,0x004C},  {0x004D,0x006D,0x004D},
+  {0x004E,0x006E,0x004E},  {0x004F,0x006F,0x004F},
+  {0x0050,0x0070,0x0050},  {0x0051,0x0071,0x0051},
+  {0x0052,0x0072,0x0052},  {0x0053,0x0073,0x0053},
+  {0x0054,0x0074,0x0054},  {0x0055,0x0075,0x0055},
+  {0x0056,0x0076,0x0056},  {0x0057,0x0077,0x0057},
+  {0x0058,0x0078,0x0058},  {0x0059,0x0079,0x0059},
+  {0x005A,0x007A,0x005A},  {0x005B,0x005B,0x005B},
+  {0x005C,0x005C,0x005C},  {0x005D,0x005D,0x005D},
+  {0x005E,0x005E,0x005E},  {0x005F,0x005F,0x005F},
+  {0x0060,0x0060,0x0060},  {0x0041,0x0061,0x0041},
+  {0x0042,0x0062,0x0042},  {0x0043,0x0063,0x0043},
+  {0x0044,0x0064,0x0044},  {0x0045,0x0065,0x0045},
+  {0x0046,0x0066,0x0046},  {0x0047,0x0067,0x0047},
+  {0x0048,0x0068,0x0048},  {0x0130,0x0069,0x0049},
+  {0x004A,0x006A,0x004A},  {0x004B,0x006B,0x004B},
+  {0x004C,0x006C,0x004C},  {0x004D,0x006D,0x004D},
+  {0x004E,0x006E,0x004E},  {0x004F,0x006F,0x004F},
+  {0x0050,0x0070,0x0050},  {0x0051,0x0071,0x0051},
+  {0x0052,0x0072,0x0052},  {0x0053,0x0073,0x0053},
+  {0x0054,0x0074,0x0054},  {0x0055,0x0075,0x0055},
+  {0x0056,0x0076,0x0056},  {0x0057,0x0077,0x0057},
+  {0x0058,0x0078,0x0058},  {0x0059,0x0079,0x0059},
+  {0x005A,0x007A,0x005A},  {0x007B,0x007B,0x007B},
+  {0x007C,0x007C,0x007C},  {0x007D,0x007D,0x007D},
+  {0x007E,0x007E,0x007E},  {0x007F,0x007F,0x007F},
+  {0x0080,0x0080,0x0080},  {0x0081,0x0081,0x0081},
+  {0x0082,0x0082,0x0082},  {0x0083,0x0083,0x0083},
+  {0x0084,0x0084,0x0084},  {0x0085,0x0085,0x0085},
+  {0x0086,0x0086,0x0086},  {0x0087,0x0087,0x0087},
+  {0x0088,0x0088,0x0088},  {0x0089,0x0089,0x0089},
+  {0x008A,0x008A,0x008A},  {0x008B,0x008B,0x008B},
+  {0x008C,0x008C,0x008C},  {0x008D,0x008D,0x008D},
+  {0x008E,0x008E,0x008E},  {0x008F,0x008F,0x008F},
+  {0x0090,0x0090,0x0090},  {0x0091,0x0091,0x0091},
+  {0x0092,0x0092,0x0092},  {0x0093,0x0093,0x0093},
+  {0x0094,0x0094,0x0094},  {0x0095,0x0095,0x0095},
+  {0x0096,0x0096,0x0096},  {0x0097,0x0097,0x0097},
+  {0x0098,0x0098,0x0098},  {0x0099,0x0099,0x0099},
+  {0x009A,0x009A,0x009A},  {0x009B,0x009B,0x009B},
+  {0x009C,0x009C,0x009C},  {0x009D,0x009D,0x009D},
+  {0x009E,0x009E,0x009E},  {0x009F,0x009F,0x009F},
+  {0x00A0,0x00A0,0x00A0},  {0x00A1,0x00A1,0x00A1},
+  {0x00A2,0x00A2,0x00A2},  {0x00A3,0x00A3,0x00A3},
+  {0x00A4,0x00A4,0x00A4},  {0x00A5,0x00A5,0x00A5},
+  {0x00A6,0x00A6,0x00A6},  {0x00A7,0x00A7,0x00A7},
+  {0x00A8,0x00A8,0x00A8},  {0x00A9,0x00A9,0x00A9},
+  {0x00AA,0x00AA,0x00AA},  {0x00AB,0x00AB,0x00AB},
+  {0x00AC,0x00AC,0x00AC},  {0x00AD,0x00AD,0x00AD},
+  {0x00AE,0x00AE,0x00AE},  {0x00AF,0x00AF,0x00AF},
+  {0x00B0,0x00B0,0x00B0},  {0x00B1,0x00B1,0x00B1},
+  {0x00B2,0x00B2,0x00B2},  {0x00B3,0x00B3,0x00B3},
+  {0x00B4,0x00B4,0x00B4},  {0x039C,0x00B5,0x039C},
+  {0x00B6,0x00B6,0x00B6},  {0x00B7,0x00B7,0x00B7},
+  {0x00B8,0x00B8,0x00B8},  {0x00B9,0x00B9,0x00B9},
+  {0x00BA,0x00BA,0x00BA},  {0x00BB,0x00BB,0x00BB},
+  {0x00BC,0x00BC,0x00BC},  {0x00BD,0x00BD,0x00BD},
+  {0x00BE,0x00BE,0x00BE},  {0x00BF,0x00BF,0x00BF},
+  {0x00C0,0x00E0,0x0041},  {0x00C1,0x00E1,0x0041},
+  {0x00C2,0x00E2,0x0041},  {0x00C3,0x00E3,0x0041},
+  {0x00C4,0x00E4,0x0041},  {0x00C5,0x00E5,0x0041},
+  {0x00C6,0x00E6,0x00C6},  {0x00C7,0x00E7,0x0043},
+  {0x00C8,0x00E8,0x0045},  {0x00C9,0x00E9,0x0045},
+  {0x00CA,0x00EA,0x0045},  {0x00CB,0x00EB,0x0045},
+  {0x00CC,0x00EC,0x0049},  {0x00CD,0x00ED,0x0049},
+  {0x00CE,0x00EE,0x0049},  {0x00CF,0x00EF,0x0049},
+  {0x00D0,0x00F0,0x00D0},  {0x00D1,0x00F1,0x004E},
+  {0x00D2,0x00F2,0x004F},  {0x00D3,0x00F3,0x004F},
+  {0x00D4,0x00F4,0x004F},  {0x00D5,0x00F5,0x004F},
+  {0x00D6,0x00F6,0x004F},  {0x00D7,0x00D7,0x00D7},
+  {0x00D8,0x00F8,0x00D8},  {0x00D9,0x00F9,0x0055},
+  {0x00DA,0x00FA,0x0055},  {0x00DB,0x00FB,0x0055},
+  {0x00DC,0x00FC,0x0055},  {0x00DD,0x00FD,0x0059},
+  {0x00DE,0x00FE,0x00DE},  {0x00DF,0x00DF,0x00DF},
+  {0x00C0,0x00E0,0x0041},  {0x00C1,0x00E1,0x0041},
+  {0x00C2,0x00E2,0x0041},  {0x00C3,0x00E3,0x0041},
+  {0x00C4,0x00E4,0x0041},  {0x00C5,0x00E5,0x0041},
+  {0x00C6,0x00E6,0x00C6},  {0x00C7,0x00E7,0x0043},
+  {0x00C8,0x00E8,0x0045},  {0x00C9,0x00E9,0x0045},
+  {0x00CA,0x00EA,0x0045},  {0x00CB,0x00EB,0x0045},
+  {0x00CC,0x00EC,0x0049},  {0x00CD,0x00ED,0x0049},
+  {0x00CE,0x00EE,0x0049},  {0x00CF,0x00EF,0x0049},
+  {0x00D0,0x00F0,0x00D0},  {0x00D1,0x00F1,0x004E},
+  {0x00D2,0x00F2,0x004F},  {0x00D3,0x00F3,0x004F},
+  {0x00D4,0x00F4,0x004F},  {0x00D5,0x00F5,0x004F},
+  {0x00D6,0x00F6,0x004F},  {0x00F7,0x00F7,0x00F7},
+  {0x00D8,0x00F8,0x00D8},  {0x00D9,0x00F9,0x0055},
+  {0x00DA,0x00FA,0x0055},  {0x00DB,0x00FB,0x0055},
+  {0x00DC,0x00FC,0x0055},  {0x00DD,0x00FD,0x0059},
+  {0x00DE,0x00FE,0x00DE},  {0x0178,0x00FF,0x0059}
+};
+
+
+
+MY_UNICASE_INFO *my_unicase_turkish[256]=
+{
+  turk00, plane01, plane02, plane03, plane04, plane05,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL, plane1E, plane1F,
+    NULL, plane21,    NULL,    NULL, plane24,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,
+    NULL,    NULL,    NULL,    NULL,    NULL,    NULL,    NULL, planeFF
+};
+#endif
+
+
+#if 0
+/*
+** Compare string against string with wildcard
+** This function is used in UTF8 and UCS2
+**
+**     0 if matched
+**     -1 if not matched with wildcard
+**      1 if matched with wildcard
+*/
+
+int my_wildcmp_unicode(CHARSET_INFO *cs,
+                      const char *str,const char *str_end,
+                      const char *wildstr,const char *wildend,
+                      int escape, int w_one, int w_many,
+                      MY_UNICASE_INFO **weights)
+{
+  int result= -1;                      /* Not found, using wildcards */
+  my_wc_t s_wc, w_wc;
+  int scan, plane;
+  int (*mb_wc)(struct charset_info_st *cs, my_wc_t *wc,
+               const unsigned char *s,const unsigned char *e);
+  mb_wc= cs->cset->mb_wc;
+  
+  while (wildstr != wildend)
+  {
+    while (1)
+    {
+      my_bool escaped= 0;
+      if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+                       (const uchar*)wildend)) <= 0)
+        return 1;
+
+      if (w_wc == (my_wc_t)w_many)
+      {
+        result= 1;                             /* Found an anchor char */
+        break;
+      }
+
+      wildstr+= scan;
+      if (w_wc ==  (my_wc_t)escape && wildstr < wildend)
+      {
+        if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+                         (const uchar*)wildend)) <= 0)
+          return 1;
+        wildstr+= scan;
+        escaped= 1;
+      }
+      
+      if ((scan= mb_wc(cs, &s_wc, (const uchar*)str,
+                       (const uchar*)str_end)) <= 0)
+        return 1;
+      str+= scan;
+      
+      if (!escaped && w_wc == (my_wc_t)w_one)
+      {
+        result= 1;                             /* Found an anchor char */
+      }
+      else
+      {
+        if (weights)
+        {
+          plane=(s_wc>>8) & 0xFF;
+          s_wc = weights[plane] ? weights[plane][s_wc & 0xFF].sort : s_wc;
+          plane=(w_wc>>8) & 0xFF;
+          w_wc = weights[plane] ? weights[plane][w_wc & 0xFF].sort : w_wc;
+        }
+        if (s_wc != w_wc)
+          return 1;                            /* No match */
+      }
+      if (wildstr == wildend)
+       return (str != str_end);                /* Match if both are at end */
+    }
+    
+    
+    if (w_wc == (my_wc_t)w_many)
+    {                                          /* Found w_many */
+    
+      /* Remove any '%' and '_' from the wild search string */
+      for ( ; wildstr != wildend ; )
+      {
+        if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+                         (const uchar*)wildend)) <= 0)
+          return 1;
+        
+       if (w_wc == (my_wc_t)w_many)
+       {
+         wildstr+= scan;
+         continue;
+       } 
+       
+       if (w_wc == (my_wc_t)w_one)
+       {
+         wildstr+= scan;
+          if ((scan= mb_wc(cs, &s_wc, (const uchar*)str,
+                           (const uchar*)str_end)) <=0)
+            return 1;
+          str+= scan;
+         continue;
+       }
+       break;                                  /* Not a wild character */
+      }
+      
+      if (wildstr == wildend)
+       return 0;                               /* Ok if w_many is last */
+      
+      if (str == str_end)
+       return -1;
+      
+      if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+                       (const uchar*)wildend)) <=0)
+        return 1;
+      wildstr+= scan;
+      
+      if (w_wc ==  (my_wc_t)escape)
+      {
+        if (wildstr < wildend)
+        {
+          if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+                           (const uchar*)wildend)) <=0)
+            return 1;
+          wildstr+= scan;
+        }
+      }
+      
+      while (1)
+      {
+        /* Skip until the first character from wildstr is found */
+        while (str != str_end)
+        {
+          if ((scan= mb_wc(cs, &s_wc, (const uchar*)str,
+                           (const uchar*)str_end)) <=0)
+            return 1;
+          if (weights)
+          {
+            plane=(s_wc>>8) & 0xFF;
+            s_wc = weights[plane] ? weights[plane][s_wc & 0xFF].sort : s_wc;
+            plane=(w_wc>>8) & 0xFF;
+            w_wc = weights[plane] ? weights[plane][w_wc & 0xFF].sort : w_wc;
+          }
+          
+          if (s_wc == w_wc)
+            break;
+          str+= scan;
+        }
+        if (str == str_end)
+          return -1;
+        
+        str+= scan;
+        result= my_wildcmp_unicode(cs, str, str_end, wildstr, wildend,
+                                   escape, w_one, w_many,
+                                   weights);
+        if (result <= 0)
+          return result;
+      } 
+    }
+  }
+  return (str != str_end ? 1 : 0);
+}
+#endif
+
+#endif
+
+
+
+#ifdef HAVE_CHARSET_utf8
+
+#if 0
+/*
+  We consider bytes with code more than 127 as a letter.
+  This garantees that word boundaries work fine with regular
+  expressions. Note, there is no need to mark byte 255  as a
+  letter, it is illegal byte in UTF8.
+*/
+static uchar ctype_utf8[] = {
+    0,
+   32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32,
+   32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+   72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+  132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16,
+   16,129,129,129,129,129,129,  1,  1,  1,  1,  1,  1,  1,  1,  1,
+    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, 16, 16, 16, 16, 16,
+   16,130,130,130,130,130,130,  2,  2,  2,  2,  2,  2,  2,  2,  2,
+    2,  2,  2,  2,  2,  2,  2,  2,  2,  2,  2, 16, 16, 16, 16, 32,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
+    3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  0
+};
+
+/* The below are taken from usa7 implementation */
+
+static uchar to_lower_utf8[] = {
+    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, 42, 43, 44, 45, 46, 47,
+   48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+   64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
+  112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95,
+   96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
+  112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,
+  128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+  144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
+  160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
+  176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+  192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+  208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+  224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
+  240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+};
+
+static uchar to_upper_utf8[] = {
+    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, 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, 79,
+   80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
+   96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+   80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127,
+  128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
+  144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
+  160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
+  176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
+  192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
+  208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
+  224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
+  240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+};
+#endif
+
+static inline int bincmp(const uchar *s, const uchar *se,
+                         const uchar *t, const uchar *te)
+{
+  int slen= (int) (se-s), tlen= (int) (te-t);
+  int len=min(slen,tlen);
+  int cmp= memcmp(s,t,len);
+  return cmp ? cmp : slen-tlen;
+}
+
+static int my_utf8_uni(CHARSET_INFO *cs __attribute__((unused)),
+                       my_wc_t * pwc, const uchar *s, const uchar *e)
+{
+  unsigned char c;
+
+  if (s >= e)
+    return MY_CS_TOOSMALL;
+
+  c= s[0];
+  if (c < 0x80)
+  {
+    *pwc = c;
+    return 1;
+  }
+  else if (c < 0xc2)
+    return MY_CS_ILSEQ;
+  else if (c < 0xe0)
+  {
+    if (s+2 > e) /* We need 2 characters */
+      return MY_CS_TOOSMALL2;
+
+    if (!((s[1] ^ 0x80) < 0x40))
+      return MY_CS_ILSEQ;
+
+    *pwc = ((my_wc_t) (c & 0x1f) << 6) | (my_wc_t) (s[1] ^ 0x80);
+    return 2;
+  }
+  else if (c < 0xf0)
+  {
+    if (s+3 > e) /* We need 3 characters */
+      return MY_CS_TOOSMALL3;
+
+    if (!((s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40 && (c >= 0xe1 || s[1] >= 0xa0)))
+      return MY_CS_ILSEQ;
+
+    *pwc = ((my_wc_t) (c & 0x0f) << 12)   |
+           ((my_wc_t) (s[1] ^ 0x80) << 6) |
+            (my_wc_t) (s[2] ^ 0x80);
+
+    return 3;
+  }
+#ifdef UNICODE_32BIT
+  else if (c < 0xf8 && sizeof(my_wc_t)*8 >= 32)
+  {
+    if (s+4 > e) /* We need 4 characters */
+      return MY_CS_TOOSMALL4;
+
+    if (!((s[1] ^ 0x80) < 0x40 &&
+          (s[2] ^ 0x80) < 0x40 &&
+          (s[3] ^ 0x80) < 0x40 &&
+          (c >= 0xf1 || s[1] >= 0x90)))
+      return MY_CS_ILSEQ;
+
+    *pwc = ((my_wc_t) (c & 0x07) << 18)    |
+           ((my_wc_t) (s[1] ^ 0x80) << 12) |
+           ((my_wc_t) (s[2] ^ 0x80) << 6)  |
+            (my_wc_t) (s[3] ^ 0x80);
+
+    return 4;
+  }
+   else if (c < 0xfc && sizeof(my_wc_t)*8 >= 32)
+  {
+    if (s+5 >e) /* We need 5 characters */
+      return MY_CS_TOOSMALL5;
+
+    if (!((s[1] ^ 0x80) < 0x40 &&
+          (s[2] ^ 0x80) < 0x40 &&
+          (s[3] ^ 0x80) < 0x40 &&
+          (s[4] ^ 0x80) < 0x40 &&
+          (c >= 0xf9 || s[1] >= 0x88)))
+      return MY_CS_ILSEQ;
+
+    *pwc = ((my_wc_t) (c & 0x03) << 24) |
+           ((my_wc_t) (s[1] ^ 0x80) << 18) |
+           ((my_wc_t) (s[2] ^ 0x80) << 12) |
+           ((my_wc_t) (s[3] ^ 0x80) << 6) |
+            (my_wc_t) (s[4] ^ 0x80);
+    return 5;
+  }
+  else if (c < 0xfe && sizeof(my_wc_t)*8 >= 32)
+  {
+    if ( s+6 >e ) /* We need 6 characters */
+      return MY_CS_TOOSMALL6;
+
+    if (!((s[1] ^ 0x80) < 0x40   &&
+          (s[2] ^ 0x80) < 0x40   &&
+          (s[3] ^ 0x80) < 0x40   &&
+          (s[4] ^ 0x80) < 0x40   &&
+          (s[5] ^ 0x80) < 0x40   &&
+          (c >= 0xfd || s[1] >= 0x84)))
+      return MY_CS_ILSEQ;
+
+    *pwc = ((my_wc_t) (c & 0x01) << 30)
+      | ((my_wc_t) (s[1] ^ 0x80) << 24)
+      | ((my_wc_t) (s[2] ^ 0x80) << 18)
+      | ((my_wc_t) (s[3] ^ 0x80) << 12)
+      | ((my_wc_t) (s[4] ^ 0x80) << 6)
+      | (my_wc_t) (s[5] ^ 0x80);
+    return 6;
+  }
+#endif
+  return MY_CS_ILSEQ;
+}
+
+#if 0
+static int my_uni_utf8 (CHARSET_INFO *cs __attribute__((unused)) ,
+                 my_wc_t wc, uchar *r, uchar *e)
+{
+  int count;
+
+  if (r >= e)
+    return MY_CS_TOOSMALL;
+
+  if (wc < 0x80)
+    count = 1;
+  else if (wc < 0x800)
+    count = 2;
+  else if (wc < 0x10000)
+    count = 3;
+#ifdef UNICODE_32BIT
+  else if (wc < 0x200000)
+    count = 4;
+  else if (wc < 0x4000000)
+    count = 5;
+  else if (wc <= 0x7fffffff)
+    count = 6;
+#endif
+    else return MY_CS_ILUNI;
+
+  /*
+    e is a character after the string r, not the last character of it.
+    Because of it (r+count > e), not (r+count-1 >e )
+   */
+  if ( r+count > e )
+    return MY_CS_TOOSMALLN(count);
+
+  switch (count) {
+    /* Fall through all cases!!! */
+#ifdef UNICODE_32BIT
+    case 6: r[5] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x4000000;
+    case 5: r[4] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x200000;
+    case 4: r[3] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x10000;
+#endif
+    case 3: r[2] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x800;
+    case 2: r[1] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0xc0;
+    case 1: r[0] = (uchar) wc;
+  }
+  return count;
+}
+
+
+static uint my_caseup_utf8(CHARSET_INFO *cs, char *src, uint srclen,
+                                             char *dst, uint dstlen)
+{
+  my_wc_t wc;
+  int srcres, dstres;
+  char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst;
+  MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+  //DBUG_ASSERT(src != dst || cs->caseup_multiply == 1);
+
+  while ((src < srcend) &&
+         (srcres= my_utf8_uni(cs, &wc, (uchar *) src, (uchar*) srcend)) > 0)
+  {
+    int plane= (wc>>8) & 0xFF;
+    wc= uni_plane[plane] ? uni_plane[plane][wc & 0xFF].toupper : wc;
+    if ((dstres= my_uni_utf8(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0)
+      break;
+    src+= srcres;
+    dst+= dstres;
+  }
+  return (uint) (dst - dst0);
+}
+
+static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, uint slen,
+                              ulong *n1, ulong *n2)
+{
+  my_wc_t wc;
+  int res;
+  const uchar *e=s+slen;
+  MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+
+  /*
+    Remove end space. We have to do this to be able to compare
+    'A ' and 'A' as identical
+  */
+  while (e > s && e[-1] == ' ')
+    e--;
+
+  while ((s < e) && (res=my_utf8_uni(cs,&wc, (uchar *)s, (uchar*)e))>0 )
+  {
+    int plane = (wc>>8) & 0xFF;
+    wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].sort : wc;
+    n1[0]^= (((n1[0] & 63)+n2[0])*(wc & 0xFF))+ (n1[0] << 8);
+    n2[0]+=3;
+    n1[0]^= (((n1[0] & 63)+n2[0])*(wc >> 8))+ (n1[0] << 8);
+    n2[0]+=3;
+    s+=res;
+  }
+}
+
+
+static void my_caseup_str_utf8(CHARSET_INFO * cs, char * s)
+{
+  uint len= (uint) strlen(s);
+  my_caseup_utf8(cs, s, len, s, len);
+}
+
+
+static uint my_casedn_utf8(CHARSET_INFO *cs, char *src, uint srclen,
+                                             char *dst, uint dstlen)
+{
+  my_wc_t wc;
+  int srcres, dstres;
+  char *srcend= src + srclen, *dstend= dst + dstlen, *dst0= dst;
+  MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+  //DBUG_ASSERT(src != dst || cs->casedn_multiply == 1);
+
+  while ((src < srcend) &&
+         (srcres= my_utf8_uni(cs, &wc, (uchar*) src, (uchar*)srcend)) > 0)
+  {
+    int plane= (wc>>8) & 0xFF;
+    wc= uni_plane[plane] ? uni_plane[plane][wc & 0xFF].tolower : wc;
+    if ((dstres= my_uni_utf8(cs, wc, (uchar*) dst, (uchar*) dstend)) <= 0)
+      break;
+    src+= srcres;
+    dst+= dstres;
+  }
+  return (uint) (dst - dst0);
+}
+
+static void my_casedn_str_utf8(CHARSET_INFO *cs, char * s)
+{
+  uint len= (uint) strlen(s);
+  my_casedn_utf8(cs, s, len, s, len);
+}
+#endif
+
+
+static int my_strnncoll_utf8(CHARSET_INFO *cs,
+                             const uchar *s, uint slen,
+                             const uchar *t, uint tlen,
+                             my_bool t_is_prefix)
+{
+  int s_res,t_res;
+  my_wc_t s_wc,t_wc;
+  const uchar *se=s+slen;
+  const uchar *te=t+tlen;
+  MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+
+  while ( s < se && t < te )
+  {
+    int plane;
+    s_res=my_utf8_uni(cs,&s_wc, s, se);
+    t_res=my_utf8_uni(cs,&t_wc, t, te);
+
+    if ( s_res <= 0 || t_res <= 0 )
+    {
+      /* Incorrect string, compare byte by byte value */
+      return bincmp(s, se, t, te);
+    }
+
+    plane=(s_wc>>8) & 0xFF;
+    s_wc = uni_plane[plane] ? uni_plane[plane][s_wc & 0xFF].sort : s_wc;
+    plane=(t_wc>>8) & 0xFF;
+    t_wc = uni_plane[plane] ? uni_plane[plane][t_wc & 0xFF].sort : t_wc;
+    if ( s_wc != t_wc )
+    {
+      return  s_wc > t_wc ? 1 : -1;
+    }
+
+    s+=s_res;
+    t+=t_res;
+  }
+  return (int) (t_is_prefix ? t-te : ((se-s) - (te-t)));
+}
+
+#if 0
+/*
+  Compare strings, discarding end space
+
+  SYNOPSIS
+    my_strnncollsp_utf8()
+    cs                  character set handler
+    a                   First string to compare
+    a_length            Length of 'a'
+    b                   Second string to compare
+    b_length            Length of 'b'
+    diff_if_only_endspace_difference
+                       Set to 1 if the strings should be regarded as different
+                        if they only difference in end space
+
+  IMPLEMENTATION
+    If one string is shorter as the other, then we space extend the other
+    so that the strings have equal length.
+
+    This will ensure that the following things hold:
+
+    "a"  == "a "
+    "a\0" < "a"
+    "a\0" < "a "
+
+  RETURN
+    < 0  a <  b
+    = 0  a == b
+    > 0  a > b
+*/
+
+/*static int my_strnncollsp_utf8(CHARSET_INFO *cs,
+                               const uchar *s, uint slen,
+                               const uchar *t, uint tlen,
+                               my_bool diff_if_only_endspace_difference)*/
+int my_strnncollsp_utf8(const uchar *s, uint slen,
+                               const uchar *t, uint tlen,
+                               my_bool diff_if_only_endspace_difference)
+{
+  int s_res, t_res, res;
+  my_wc_t s_wc,t_wc;
+  const uchar *se= s+slen, *te= t+tlen;
+  //MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+  MY_UNICASE_INFO **uni_plane= my_unicase_default;
+
+#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
+  diff_if_only_endspace_difference= 0;
+#endif
+
+  while ( s < se && t < te )
+  {
+    int plane;
+    s_res=my_utf8_uni(&s_wc, s, se);
+    t_res=my_utf8_uni(&t_wc, t, te);
+
+    if ( s_res <= 0 || t_res <= 0 )
+    {
+      /* Incorrect string, compare byte by byte value */
+      return bincmp(s, se, t, te);
+    }
+
+    plane=(s_wc>>8) & 0xFF;
+    s_wc = uni_plane[plane] ? uni_plane[plane][s_wc & 0xFF].sort : s_wc;
+    plane=(t_wc>>8) & 0xFF;
+    t_wc = uni_plane[plane] ? uni_plane[plane][t_wc & 0xFF].sort : t_wc;
+    if ( s_wc != t_wc )
+    {
+      return  s_wc > t_wc ? 1 : -1;
+    }
+
+    s+=s_res;
+    t+=t_res;
+  }
+
+  slen= (uint) (se-s);
+  tlen= (uint) (te-t);
+  res= 0;
+
+  if (slen != tlen)
+  {
+    int swap= 1;
+    if (diff_if_only_endspace_difference)
+      res= 1;                                   /* Assume 'a' is bigger */
+    if (slen < tlen)
+    {
+      slen= tlen;
+      s= t;
+      se= te;
+      swap= -1;
+      res= -res;
+    }
+    /*
+      This following loop uses the fact that in UTF-8
+      all multibyte characters are greater than space,
+      and all multibyte head characters are greater than
+      space. It means if we meet a character greater
+      than space, it always means that the longer string
+      is greater. So we can reuse the same loop from the
+      8bit version, without having to process full multibute
+      sequences.
+    */
+    for ( ; s < se; s++)
+    {
+      if (*s != ' ')
+       return (*s < ' ') ? -swap : swap;
+    }
+  }
+  return res;
+}
+
+
+/*
+  Compare 0-terminated UTF8 strings.
+
+  SYNOPSIS
+    my_strcasecmp_utf8()
+    cs                  character set handler
+    s                   First 0-terminated string to compare
+    t                   Second 0-terminated string to compare
+
+  IMPLEMENTATION
+
+  RETURN
+    - negative number if s < t
+    - positive number if s > t
+    - 0 is the strings are equal
+*/
+
+static
+int my_strcasecmp_utf8(CHARSET_INFO *cs, const char *s, const char *t)
+{
+  MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+  while (s[0] && t[0])
+  {
+    my_wc_t s_wc,t_wc;
+    
+    if ((uchar) s[0] < 128)
+    {
+      /* 
+        s[0] is between 0 and 127.
+        It represents a single byte character.
+        Convert it into weight according to collation.
+      */
+      s_wc= plane00[(uchar) s[0]].tolower;
+      s++;
+    }
+    else
+    {
+      int plane, res;
+      
+      /*
+        Scan a multibyte character.
+
+        In the future it is worth to write a special version of my_utf8_uni()
+        for 0-terminated strings which will not take in account length. Now
+        we call the regular version of my_utf8_uni() with s+3 in the
+        last argument. s+3 is enough to scan any multibyte sequence.
+
+        Calling the regular version of my_utf8_uni is safe for 0-terminated
+        strings: we will never lose the end of the string:
+        If we have 0 character in the middle of a multibyte sequence,
+        then my_utf8_uni will always return a negative number, so the
+        loop with finish.
+      */
+      
+      res= my_utf8_uni(cs,&s_wc, (const uchar*)s, (const uchar*) s + 3);
+      
+      /* 
+         In the case of wrong multibyte sequence we will
+         call strcmp() for byte-to-byte comparison.
+      */
+      if (res <= 0)
+        return strcmp(s, t);
+      s+= res;
+      
+      /* Convert Unicode code into weight according to collation */
+      plane=(s_wc>>8) & 0xFF;
+      s_wc = uni_plane[plane] ? uni_plane[plane][s_wc & 0xFF].tolower : s_wc;
+    }
+    
+    
+    /* Do the same for the second string */
+    
+    if ((uchar) t[0] < 128)
+    {
+      /* Convert single byte character into weight */
+      t_wc= plane00[(uchar) t[0]].tolower;
+      t++;
+    }
+    else
+    {
+      int plane;
+      int res=my_utf8_uni(cs,&t_wc, (const uchar*)t, (const uchar*) t + 3);
+      if (res <= 0)
+        return strcmp(s, t);
+      t+= res;
+      
+      /* Convert code into weight */
+      plane=(t_wc>>8) & 0xFF;
+      t_wc = uni_plane[plane] ? uni_plane[plane][t_wc & 0xFF].tolower : t_wc;
+    }
+    
+    /* Now we have two weights, let's compare them */
+    if ( s_wc != t_wc )
+      return  ((int) s_wc) - ((int) t_wc);
+  }
+  return ((int)(uchar)s[0]) - ((int) (uchar) t[0]);
+}
+
+
+static
+int my_wildcmp_utf8(CHARSET_INFO *cs,
+                   const char *str,const char *str_end,
+                   const char *wildstr,const char *wildend,
+                   int escape, int w_one, int w_many)
+{
+  MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+  return my_wildcmp_unicode(cs,str,str_end,wildstr,wildend,
+                            escape,w_one,w_many,uni_plane); 
+}
+
+
+static
+uint my_strnxfrmlen_utf8(CHARSET_INFO *cs __attribute__((unused)), uint len)
+{
+  return (len * 2 + 2) / 3;
+}
+
+static int my_strnxfrm_utf8(CHARSET_INFO *cs,
+                            uchar *dst, uint dstlen,
+                            const uchar *src, uint srclen)
+{
+  my_wc_t wc;
+  int res;
+  int plane;
+  uchar *de= dst + dstlen;
+  uchar *de_beg= de - 1;
+  const uchar *se = src + srclen;
+  MY_UNICASE_INFO **uni_plane= cs->caseinfo;
+
+  while (dst < de_beg)
+  {
+    if ((res=my_utf8_uni(cs,&wc, src, se)) <= 0)
+      break;
+    src+=res;
+
+    plane=(wc>>8) & 0xFF;
+    wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].sort : wc;
+
+    *dst++= (uchar)(wc >> 8);
+    *dst++= (uchar)(wc & 0xFF);
+    
+  }
+  
+  while (dst < de_beg) /* Fill the tail with keys for space character */
+  {
+    *dst++= 0x00;
+    *dst++= 0x20;
+  }
+  
+  if (dst < de)  /* Clear the last byte, if "dstlen" was an odd number */
+    *dst= 0x00;
+  
+  return dstlen;
+}
+
+static int my_ismbchar_utf8(CHARSET_INFO *cs,const char *b, const char *e)
+{
+  my_wc_t wc;
+  int  res=my_utf8_uni(cs,&wc, (const uchar*)b, (const uchar*)e);
+  return (res>1) ? res : 0;
+}
+
+static int my_mbcharlen_utf8(CHARSET_INFO *cs  __attribute__((unused)) , uint c)
+{
+  if (c < 0x80)
+    return 1;
+  else if (c < 0xc2)
+    return 0; /* Illegal mb head */
+  else if (c < 0xe0)
+    return 2;
+  else if (c < 0xf0)
+    return 3;
+#ifdef UNICODE_32BIT
+  else if (c < 0xf8)
+    return 4;
+  else if (c < 0xfc)
+    return 5;
+  else if (c < 0xfe)
+    return 6;
+#endif
+  return 0; /* Illegal mb head */;
+}
+#endif
+
+static MY_COLLATION_HANDLER my_collation_ci_handler =
+{
+    NULL,               /* init */
+    my_strnncoll_utf8,
+    //my_strnncollsp_utf8,
+    //my_strnxfrm_utf8,
+    //my_strnxfrmlen_utf8,
+    //my_like_range_mb,
+    //my_wildcmp_utf8,
+    //my_strcasecmp_utf8,
+    //my_instr_mb,
+    //my_hash_sort_utf8,
+    //my_propagate_complex
+};
+
+namespace stardict_collation {
+
+MY_CHARSET_HANDLER my_charset_utf8_handler=
+{
+    NULL,               /* init */
+    //my_ismbchar_utf8,
+    //my_mbcharlen_utf8,
+    //my_numchars_mb,
+    //my_charpos_mb,
+    //my_well_formed_len_mb,
+    //my_lengthsp_8bit,
+    //my_numcells_mb,
+    my_utf8_uni,
+    //my_uni_utf8,
+    //my_mb_ctype_mb,
+    //my_caseup_str_utf8,
+    //my_casedn_str_utf8,
+    //my_caseup_utf8,
+    //my_casedn_utf8,
+    //my_snprintf_8bit,
+    //my_long10_to_str_8bit,
+    //my_longlong10_to_str_8bit,
+    //my_fill_8bit,
+    //my_strntol_8bit,
+    //my_strntoul_8bit,
+    //my_strntoll_8bit,
+    //my_strntoull_8bit,
+    //my_strntod_8bit,
+    //my_strtoll10_8bit,
+    //my_scan_8bit
+};
+
+CHARSET_INFO my_charset_utf8_general_ci=
+{
+    //33,0,0,             /* number       */
+    //MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE,  /* state  */
+    //"utf8",             /* cs name      */
+    //"utf8_general_ci",  /* name         */
+    //"",                 /* comment      */
+    NULL,               /* tailoring    */
+    //ctype_utf8,         /* ctype        */
+    //to_lower_utf8,      /* to_lower     */
+    //to_upper_utf8,      /* to_upper     */
+    //to_upper_utf8,      /* sort_order   */
+    NULL,
+    NULL,               /* contractions */
+    NULL,               /* sort_order_big*/
+    //NULL,               /* tab_to_uni   */
+    //NULL,               /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,               /* state_map    */
+    //NULL,               /* ident_map    */
+    //1,                  /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                  /* mbminlen     */
+    //3,                  /* mbmaxlen     */
+    //0,                  /* min_sort_char */
+    //0xFFFF,             /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_ci_handler
+};
+
+
+CHARSET_INFO my_charset_utf8_bin=
+{
+    //83,0,0,             /* number       */
+    //MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE, /* state  */
+    //"utf8",             /* cs name      */
+    //"utf8_bin",         /* name         */
+    //"",                 /* comment      */
+    NULL,               /* tailoring    */
+    //ctype_utf8,         /* ctype        */
+    //to_lower_utf8,      /* to_lower     */
+    //to_upper_utf8,      /* to_upper     */
+    NULL,               /* sort_order   */
+    NULL,               /* contractions */
+    NULL,               /* sort_order_big*/
+    //NULL,               /* tab_to_uni   */
+    //NULL,               /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    //NULL,               /* state_map    */
+    //NULL,               /* ident_map    */
+    //1,                  /* strxfrm_multiply */
+    //1,                  /* caseup_multiply  */
+    //1,                  /* casedn_multiply  */
+    //1,                  /* mbminlen     */
+    //3,                  /* mbmaxlen     */
+    //0,                  /* min_sort_char */
+    //255,                /* max_sort_char */
+    //' ',                /* pad char      */
+    //0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_mb_bin_handler
+};
+
+}; //namespace
+
+//#ifdef HAVE_UTF8_GENERAL_CS
+#if 0
+
+/*
+ * These functions bacically do the same as their original, except
+ * that they return 0 only when two comparing unicode strings are
+ * strictly the same in case-sensitive way.  See "save_diff" local
+ * variable to what they actually do.
+ */
+
+static int my_strnncoll_utf8_cs(CHARSET_INFO *cs, 
+                                const uchar *s, uint slen,
+                                const uchar *t, uint tlen,
+                                my_bool t_is_prefix)
+{
+  int s_res,t_res;
+  my_wc_t s_wc,t_wc;
+  const uchar *se=s+slen;
+  const uchar *te=t+tlen;
+  int save_diff = 0;
+  int diff;
+
+  while ( s < se && t < te )
+  {
+    int plane;
+    s_res=my_utf8_uni(cs,&s_wc, s, se);
+    t_res=my_utf8_uni(cs,&t_wc, t, te);
+    
+    if ( s_res <= 0 || t_res <= 0 )
+
+    {
+      /* Incorrect string, compare by char value */
+      return ((int)s[0]-(int)t[0]); 
+    }
+    
+    if ( save_diff == 0 )
+    {
+      save_diff = ((int)s_wc) - ((int)t_wc);
+    }
+    plane=(s_wc>>8) & 0xFF;
+    s_wc = uni_plane[plane] ? uni_plane[plane][s_wc & 0xFF].sort : s_wc;
+    plane=(t_wc>>8) & 0xFF;
+    t_wc = uni_plane[plane] ? uni_plane[plane][t_wc & 0xFF].sort : t_wc;
+    if ( s_wc != t_wc )
+    {
+      return  ((int) s_wc) - ((int) t_wc);
+    }
+    
+    s+=s_res;
+    t+=t_res;
+  }
+  diff = ( (se-s) - (te-t) );
+  return t_is_prefix ? t-te : ((diff == 0) ? save_diff : diff);
+}
+
+static int my_strnncollsp_utf8_cs(CHARSET_INFO *cs, 
+                                  const uchar *s, uint slen,
+                                  const uchar *t, uint tlen)
+{
+  int s_res,t_res;
+  my_wc_t s_wc,t_wc;
+  const uchar *se= s+slen;
+  const uchar *te= t+tlen;
+  int save_diff = 0;
+  
+  while ( s < se && t < te )
+  {
+    int plane;
+    s_res=my_utf8_uni(cs,&s_wc, s, se);
+    t_res=my_utf8_uni(cs,&t_wc, t, te);
+    
+    if ( s_res <= 0 || t_res <= 0 )
+    {
+      /* Incorrect string, compare by char value */
+      return ((int)s[0]-(int)t[0]); 
+    }
+    
+    if ( save_diff == 0 )
+    {
+      save_diff = ((int)s_wc) - ((int)t_wc);
+    }
+    plane=(s_wc>>8) & 0xFF;
+    s_wc = uni_plane[plane] ? uni_plane[plane][s_wc & 0xFF].sort : s_wc;
+    plane=(t_wc>>8) & 0xFF;
+    t_wc = uni_plane[plane] ? uni_plane[plane][t_wc & 0xFF].sort : t_wc;
+    if ( s_wc != t_wc )
+    {
+      return  ((int) s_wc) - ((int) t_wc);
+    }
+    
+    s+=s_res;
+    t+=t_res;
+  }
+  
+  slen= se-s;
+  tlen= te-t;
+  
+  if (slen != tlen)
+  {
+    int swap= 0;
+    if (slen < tlen)
+    {
+      slen= tlen;
+      s= t;
+      se= te;
+      swap= -1;
+    }
+    /*
+      This following loop uses the fact that in UTF-8
+      all multibyte characters are greater than space,
+      and all multibyte head characters are greater than
+      space. It means if we meet a character greater
+      than space, it always means that the longer string
+      is greater. So we can reuse the same loop from the
+      8bit version, without having to process full multibute
+      sequences.
+    */
+    for ( ; s < se; s++)
+    {
+      if (*s != ' ')
+        return ((int)*s -  (int) ' ') ^ swap;
+    }
+  }
+  return save_diff;
+}
+
+static MY_COLLATION_HANDLER my_collation_cs_handler =
+{
+    NULL,              /* init */
+    my_strnncoll_utf8_cs,
+    my_strnncollsp_utf8_cs,
+    my_strnxfrm_utf8,
+    my_like_range_simple,
+    my_wildcmp_mb,
+    my_strcasecmp_utf8,
+    my_instr_mb,
+    my_hash_sort_utf8,
+    my_propagate_simple
+};
+
+CHARSET_INFO my_charset_utf8_general_cs=
+{
+    254,0,0,           /* number       */
+    MY_CS_COMPILED|MY_CS_UNICODE,      /* state  */
+    "utf8",            /* cs name      */
+    "utf8_general_cs", /* name         */
+    "",                        /* comment      */
+    NULL,              /* tailoring    */
+    ctype_utf8,                /* ctype        */
+    to_lower_utf8,     /* to_lower     */
+    to_upper_utf8,     /* to_upper     */
+    to_upper_utf8,     /* sort_order   */
+    NULL,              /* contractions */
+    NULL,              /* sort_order_big*/
+    NULL,              /* tab_to_uni   */
+    NULL,              /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,              /* state_map    */
+    NULL,              /* ident_map    */
+    1,                 /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    1,                 /* mbminlen     */
+    3,                 /* mbmaxlen     */
+    0,                 /* min_sort_char */
+    255,               /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_utf8_handler,
+    &my_collation_cs_handler
+};
+#endif /* Cybozu Hack */
+
+
+#if 0
+
+/*
+  File system encoding components:
+
+Code range Pattern            Number   Used Unused  Blocks
+-----------------------------------------------------------------------------
+00C0..017F [.][0..4][g..z] 5*20= 100   97     3  Latin1 Supplement + Ext A
+0370..03FF [.][5..9][g..z] 5*20= 100   88    12  Greek + Coptic
+0400..052F [.][g..z][0..6] 20*7= 140  140   137  Cyrillic
+0530..058F [.][g..z][7..8] 20*2=  40   38     2  Armenian
+2160..217F [.][g..z][9]    20*1=  20   16     4  Number Forms
+0180..02AF [.][g..z][a..k] 28*11=220  203    17  Latin Ext B + IPA
+1E00..0EFF [.][g..z][l..r] 20*7= 140  136     4  Latin Additional Extended
+1F00..1FFF [.][g..z][s..z] 20*8= 160  144    16  Greek Extended
+....  .... [.][a..f][g..z] 6*20= 120    0   120  RESERVED
+24B6..24E9 [.][@][a..z]           26   26     0  Enclosed Alphanumerics
+FF21..FF5A [.][a..z][@]           26   26     0  Full Width forms
+
+All other characters are encoded using five bytes:
+
+[.][0..9a..z][0..9a..z][0..9a..z][0..9a..z]
+
+*/
+
+
+static uint16 touni[5994]=
+{
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x00C0,
+  0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,0x00C8,
+  0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,0x00D0,
+  0x00D1,0x00D2,0x00D3,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x00E0,
+  0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,0x00E8,
+  0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,0x00F0,
+  0x00F1,0x00F2,0x00F3,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x00D4,
+  0x00D5,0x00D6,0x0000,0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,
+  0x00DD,0x00DE,0x0178,0x0100,0x0102,0x0104,0x0106,0x0108,
+  0x010A,0x010C,0x010E,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x00F4,
+  0x00F5,0x00F6,0x00DF,0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,
+  0x00FD,0x00FE,0x00FF,0x0101,0x0103,0x0105,0x0107,0x0109,
+  0x010B,0x010D,0x010F,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0110,
+  0x0112,0x0114,0x0116,0x0118,0x011A,0x011C,0x011E,0x0120,
+  0x0122,0x0124,0x0126,0x0128,0x012A,0x012C,0x012E,0x0000,
+  0x0132,0x0134,0x0136,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0111,
+  0x0113,0x0115,0x0117,0x0119,0x011B,0x011D,0x011F,0x0121,
+  0x0123,0x0125,0x0127,0x0129,0x012B,0x012D,0x012F,0x0131,
+  0x0133,0x0135,0x0137,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0139,0x013B,0x013D,0x013F,0x0141,0x0143,0x0145,0x0147,
+  0x0000,0x014A,0x014C,0x014E,0x0150,0x0152,0x0154,0x0156,
+  0x0158,0x015A,0x015C,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0138,
+  0x013A,0x013C,0x013E,0x0140,0x0142,0x0144,0x0146,0x0148,
+  0x0149,0x014B,0x014D,0x014F,0x0151,0x0153,0x0155,0x0157,
+  0x0159,0x015B,0x015D,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x015E,
+  0x0160,0x0162,0x0164,0x0166,0x0168,0x016A,0x016C,0x016E,
+  0x0170,0x0172,0x0174,0x0176,0x0179,0x017B,0x017D,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x015F,
+  0x0161,0x0163,0x0165,0x0167,0x0169,0x016B,0x016D,0x016F,
+  0x0171,0x0173,0x0175,0x0177,0x017A,0x017C,0x017E,0x017F,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0390,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0386,
+  0x0388,0x0389,0x038A,0x0000,0x0391,0x0000,0x0393,0x0394,
+  0x0395,0x0396,0x0397,0x0000,0x0399,0x0000,0x039B,0x039C,
+  0x039D,0x039E,0x039F,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03AC,
+  0x03AD,0x03AE,0x03AF,0x03B0,0x03B1,0x03B2,0x03B3,0x03B4,
+  0x03B5,0x03B6,0x03B7,0x03B8,0x03B9,0x03BA,0x03BB,0x03BC,
+  0x03BD,0x03BE,0x03BF,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x03A1,0x0000,0x0000,0x03A4,0x03A5,0x0000,0x03A7,0x03A8,
+  0x03A9,0x03AA,0x03AB,0x038C,0x038E,0x038F,0x0000,0x0392,
+  0x0398,0x03D2,0x03D3,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03C0,
+  0x03C1,0x03C2,0x03C3,0x03C4,0x03C5,0x03C6,0x03C7,0x03C8,
+  0x03C9,0x03CA,0x03CB,0x03CC,0x03CD,0x03CE,0x0000,0x03D0,
+  0x03D1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03D4,
+  0x03A6,0x03A0,0x0000,0x0000,0x03DA,0x03DC,0x03DE,0x03E0,
+  0x03E2,0x03E4,0x03E6,0x03E8,0x03EA,0x03EC,0x03EE,0x039A,
+  0x0000,0x03A3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x03D5,0x03D6,0x03D7,0x03D9,0x03DB,0x03DD,0x03DF,0x03E1,
+  0x03E3,0x03E5,0x03E7,0x03E9,0x03EB,0x03ED,0x03EF,0x03F0,
+  0x03F1,0x03F2,0x03F3,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x03FD,0x03FE,0x03FF,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x03F5,
+  0x03F6,0x03F8,0x03FB,0x03FC,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x24B6,0x24B7,0x24B8,0x24B9,0x24BA,0x24BB,0x24BC,
+  0x24BD,0x24BE,0x24BF,0x24C0,0x24C1,0x24C2,0x24C3,0x24C4,
+  0x24C5,0x24C6,0x24C7,0x24C8,0x24C9,0x24CA,0x24CB,0x24CC,
+  0x24CD,0x24CE,0x24CF,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x24D0,0x24D1,0x24D2,0x24D3,0x24D4,0x24D5,0x24D6,
+  0x24D7,0x24D8,0x24D9,0x24DA,0x24DB,0x24DC,0x24DD,0x24DE,
+  0x24DF,0x24E0,0x24E1,0x24E2,0x24E3,0x24E4,0x24E5,0x24E6,
+  0x24E7,0x24E8,0x24E9,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF21,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF22,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF23,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF24,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF25,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF26,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0410,0x0424,0x0408,0x0478,0x04A6,0x04CD,0x04F4,0x0000,
+  0x0544,0x2160,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF27,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x01B3,0x01DE,0x0208,0x0230,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x1E00,0x1E28,0x1E50,0x1E78,
+  0x1E60,0x1EBE,0x1EE6,0x1F08,0x1F2A,0x0000,0x1F6C,0x1F88,
+  0x1FAC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0411,0x0425,0x0409,0x047A,0x04A8,0x0000,0x04F6,0x0531,
+  0x0545,0x2161,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF28,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0182,0x01B5,0x01E0,0x020A,0x0232,0x0000,0x0000,
+  0x019D,0x0000,0x0000,0x0000,0x1E02,0x1E2A,0x1E52,0x1E7A,
+  0x0000,0x1EC0,0x1EE8,0x1F09,0x1F2B,0x0000,0x1F6D,0x1F89,
+  0x1FAD,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0412,0x0426,0x040A,0x047C,0x04AA,0x04D0,0x04F8,0x0532,
+  0x0546,0x2162,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF29,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0184,0x01B8,0x01E2,0x020C,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x1E04,0x1E2C,0x1E54,0x1E7C,
+  0x0000,0x1EC2,0x1EEA,0x1F0A,0x1F2C,0x0000,0x1F6E,0x1F8A,
+  0x1FAE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0413,0x0427,0x040B,0x047E,0x04AC,0x04D2,0x0000,0x0533,
+  0x0547,0x2163,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF2A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0187,0x0000,0x01E4,0x020E,0x0000,0x0000,0x0193,
+  0x0000,0x01AE,0x0000,0x0000,0x1E06,0x1E2E,0x1E56,0x1E7E,
+  0x0000,0x1EC4,0x1EEC,0x1F0B,0x1F2D,0x0000,0x1F6F,0x1F8B,
+  0x1FAF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0414,0x0428,0x040C,0x0480,0x04AE,0x04D4,0x0000,0x0534,
+  0x0548,0x2164,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x018B,0x0000,0x01E6,0x0210,0x0000,0x0000,0x0000,
+  0x019F,0x0000,0x0000,0x0000,0x1E08,0x1E30,0x1E58,0x1E80,
+  0x0000,0x1EC6,0x1EEE,0x1F0C,0x1F2E,0x0000,0x1FBA,0x1F8C,
+  0x1FB8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0415,0x0429,0x040D,0x0000,0x04B0,0x04D6,0x0000,0x0535,
+  0x0549,0x2165,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x01E8,0x0212,0x0000,0x0000,0x0000,
+  0x0000,0x01B1,0x0000,0x0000,0x1E0A,0x1E32,0x1E5A,0x1E82,
+  0x1EA0,0x1EC8,0x1EF0,0x1F0D,0x1F2F,0x1F59,0x1FBB,0x1F8D,
+  0x1FB9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0416,0x042A,0x040E,0x048A,0x04B2,0x04D8,0x0000,0x0536,
+  0x054A,0x2166,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0191,0x0000,0x01EA,0x0214,0x0000,0x0000,0x0194,
+  0x0000,0x01B2,0x0000,0x0000,0x1E0C,0x1E34,0x1E5C,0x1E84,
+  0x1EA2,0x1ECA,0x1EF2,0x1F0E,0x1F38,0x0000,0x1FC8,0x1F8E,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0417,0x042B,0x040F,0x048C,0x04B4,0x04DA,0x0000,0x0537,
+  0x054B,0x2167,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01F6,0x01BC,0x01EC,0x0216,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x1E0E,0x1E36,0x1E5E,0x1E86,
+  0x1EA4,0x1ECC,0x1EF4,0x1F0F,0x1F39,0x1F5B,0x1FC9,0x1F8F,
+  0x1FBC,0x1FE8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0418,0x042C,0x0460,0x048E,0x04B6,0x04DC,0x0000,0x0538,
+  0x054C,0x2168,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF2F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0198,0x01C4,0x01EE,0x0218,0x023A,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x1E10,0x1E38,0x0000,0x1E88,
+  0x1EA6,0x1ECE,0x1EF6,0x1F18,0x1F3A,0x0000,0x1FCA,0x1F98,
+  0x0000,0x1FE9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0419,0x042D,0x0462,0x0490,0x04B8,0x04DE,0x0500,0x0539,
+  0x054D,0x2169,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF30,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x023D,0x01C7,0x0000,0x021A,0x023B,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x1E12,0x1E3A,0x1E62,0x1E8A,
+  0x1EA8,0x1ED0,0x1EF8,0x1F19,0x1F3B,0x1F5D,0x1FCB,0x1F99,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x041A,0x042E,0x0464,0x0492,0x04BA,0x04E0,0x0502,0x053A,
+  0x054E,0x216A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x01CA,0x01F1,0x021C,0x023E,0x0181,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x1E14,0x1E3C,0x1E64,0x1E8C,
+  0x1EAA,0x1ED2,0x0000,0x1F1A,0x1F3C,0x0000,0x1FDA,0x1F9A,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x041B,0x042F,0x0466,0x0494,0x04BC,0x04E2,0x0504,0x053B,
+  0x054F,0x216B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF32,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0220,0x01CD,0x01F4,0x021E,0x0000,0x0186,0x0197,
+  0x0000,0x0000,0x0000,0x0000,0x1E16,0x1E3E,0x1E66,0x1E8E,
+  0x1EAC,0x1ED4,0x0000,0x1F1B,0x1F3D,0x1F5F,0x1FDB,0x1F9B,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x041C,0x0400,0x0468,0x0496,0x04BE,0x04E4,0x0506,0x053C,
+  0x0550,0x216C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01A0,0x01CF,0x01F8,0x0000,0x0000,0x0000,0x0196,
+  0x0000,0x0000,0x0000,0x0000,0x1E18,0x1E40,0x1E68,0x1E90,
+  0x1EAE,0x1ED6,0x0000,0x1F1C,0x1F3E,0x0000,0x1FF8,0x1F9C,
+  0x0000,0x1FEC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x041D,0x0401,0x046A,0x0498,0x04C0,0x04E6,0x0508,0x053D,
+  0x0551,0x216D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF34,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01A2,0x01D1,0x01FA,0x0222,0x0000,0x0189,0x0000,
+  0x0000,0x01B7,0x0000,0x0000,0x1E1A,0x1E42,0x1E6A,0x1E92,
+  0x1EB0,0x1ED8,0x0000,0x1F1D,0x1F3F,0x0000,0x1FF9,0x1F9D,
+  0x1FCC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x041E,0x0402,0x046C,0x049A,0x04C1,0x04E8,0x050A,0x053E,
+  0x0552,0x216E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF35,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01A4,0x01D3,0x01FC,0x0224,0x0000,0x018A,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x1E1C,0x1E44,0x1E6C,0x1E94,
+  0x1EB2,0x1EDA,0x0000,0x0000,0x1F48,0x0000,0x1FEA,0x1F9E,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x041F,0x0403,0x046E,0x049C,0x04C3,0x04EA,0x050C,0x053F,
+  0x0553,0x216F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF36,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01A7,0x01D5,0x01FE,0x0226,0x0000,0x0000,0x0000,
+  0x01A6,0x0241,0x0000,0x0000,0x1E1E,0x1E46,0x1E6E,0x0000,
+  0x1EB4,0x1EDC,0x0000,0x0000,0x1F49,0x0000,0x1FEB,0x1F9F,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0420,0x0404,0x0470,0x049E,0x04C5,0x04EC,0x050E,0x0540,
+  0x0554,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF37,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x01D7,0x0200,0x0228,0x0000,0x018F,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x1E20,0x1E48,0x1E70,0x0000,
+  0x1EB6,0x1EDE,0x0000,0x0000,0x1F4A,0x1F68,0x1FFA,0x1FA8,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0421,0x0405,0x0472,0x04A0,0x04C7,0x04EE,0x0000,0x0541,
+  0x0555,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF38,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x01D9,0x0202,0x022A,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x1E22,0x1E4A,0x1E72,0x0000,
+  0x1EB8,0x1EE0,0x0000,0x0000,0x1F4B,0x1F69,0x1FFB,0x1FA9,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0422,0x0406,0x0474,0x04A2,0x04C9,0x04F0,0x0000,0x0542,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF39,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01AC,0x01DB,0x0204,0x022C,0x0000,0x0190,0x019C,
+  0x01A9,0x0000,0x0000,0x0000,0x1E24,0x1E4C,0x1E74,0x0000,
+  0x1EBA,0x1EE2,0x0000,0x1F28,0x1F4C,0x1F6A,0x0000,0x1FAA,
+  0x1FD8,0x1FFC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0423,0x0407,0x0476,0x04A4,0x04CB,0x04F2,0x0000,0x0543,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF3A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01AF,0x018E,0x0206,0x022E,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x1E26,0x1E4E,0x1E76,0x0000,
+  0x1EBC,0x1EE4,0x0000,0x1F29,0x1F4D,0x1F6B,0x0000,0x1FAB,
+  0x1FD9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF41,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF42,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF43,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF44,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF45,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF46,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0430,0x0444,0x0458,0x0479,0x04A7,0x04CE,0x04F5,0x0000,
+  0x0574,0x2170,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF47,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0180,0x01B4,0x01DF,0x0209,0x0231,0x0000,0x025D,
+  0x0271,0x0285,0x0299,0x02AD,0x1E01,0x1E29,0x1E51,0x1E79,
+  0x1E9B,0x1EBF,0x1EE7,0x1F00,0x1F22,0x0000,0x1F64,0x1F80,
+  0x1FA4,0x1FD2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0431,0x0445,0x0459,0x047B,0x04A9,0x0000,0x04F7,0x0561,
+  0x0575,0x2171,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF48,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0183,0x01B6,0x01E1,0x020B,0x0233,0x0000,0x025E,
+  0x0272,0x0286,0x029A,0x02AE,0x1E03,0x1E2B,0x1E53,0x1E7B,
+  0x0000,0x1EC1,0x1EE9,0x1F01,0x1F23,0x0000,0x1F65,0x1F81,
+  0x1FA5,0x1FD3,0x1FF6,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0432,0x0446,0x045A,0x047D,0x04AB,0x04D1,0x04F9,0x0562,
+  0x0576,0x2172,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF49,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0185,0x01B9,0x01E3,0x020D,0x0234,0x0000,0x025F,
+  0x0273,0x0287,0x029B,0x02AF,0x1E05,0x1E2D,0x1E55,0x1E7D,
+  0x0000,0x1EC3,0x1EEB,0x1F02,0x1F24,0x0000,0x1F66,0x1F82,
+  0x1FA6,0x0000,0x1FF7,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0433,0x0447,0x045B,0x047F,0x04AD,0x04D3,0x0000,0x0563,
+  0x0577,0x2173,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0188,0x01BA,0x01E5,0x020F,0x0235,0x0000,0x0260,
+  0x0274,0x0288,0x029C,0x0000,0x1E07,0x1E2F,0x1E57,0x1E7F,
+  0x0000,0x1EC5,0x1EED,0x1F03,0x1F25,0x0000,0x1F67,0x1F83,
+  0x1FA7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0434,0x0448,0x045C,0x0481,0x04AF,0x04D5,0x0000,0x0564,
+  0x0578,0x2174,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF4B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x018C,0x01BB,0x01E7,0x0211,0x0236,0x0000,0x0261,
+  0x0275,0x0289,0x029D,0x0000,0x1E09,0x1E31,0x1E59,0x1E81,
+  0x0000,0x1EC7,0x1EEF,0x1F04,0x1F26,0x1F50,0x1F70,0x1F84,
+  0x1FB0,0x1FD6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0435,0x0449,0x045D,0x0000,0x04B1,0x04D7,0x0000,0x0565,
+  0x0579,0x2175,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF4C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x018D,0x0000,0x01E9,0x0213,0x0237,0x0000,0x0262,
+  0x0276,0x028A,0x029E,0x0000,0x1E0B,0x1E33,0x1E5B,0x1E83,
+  0x1EA1,0x1EC9,0x1EF1,0x1F05,0x1F27,0x1F51,0x1F71,0x1F85,
+  0x1FB1,0x1FD7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0436,0x044A,0x045E,0x048B,0x04B3,0x04D9,0x0000,0x0566,
+  0x057A,0x2176,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF4D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0192,0x01BE,0x01EB,0x0215,0x0238,0x0000,0x0263,
+  0x0277,0x028B,0x029F,0x0000,0x1E0D,0x1E35,0x1E5D,0x1E85,
+  0x1EA3,0x1ECB,0x1EF3,0x1F06,0x1F30,0x1F52,0x1F72,0x1F86,
+  0x1FB2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0437,0x044B,0x045F,0x048D,0x04B5,0x04DB,0x0000,0x0567,
+  0x057B,0x2177,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF4E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0195,0x01BD,0x01ED,0x0217,0x0239,0x0250,0x0264,
+  0x0278,0x028C,0x02A0,0x0000,0x1E0F,0x1E37,0x1E5F,0x1E87,
+  0x1EA5,0x1ECD,0x1EF5,0x1F07,0x1F31,0x1F53,0x1F73,0x1F87,
+  0x1FB3,0x1FE0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0438,0x044C,0x0461,0x048F,0x04B7,0x04DD,0x0000,0x0568,
+  0x057C,0x2178,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF4F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0199,0x01C6,0x01EF,0x0219,0x0000,0x0251,0x0265,
+  0x0279,0x028D,0x02A1,0x0000,0x1E11,0x1E39,0x1E61,0x1E89,
+  0x1EA7,0x1ECF,0x1EF7,0x1F10,0x1F32,0x1F54,0x1F74,0x1F90,
+  0x1FB4,0x1FE1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0439,0x044D,0x0463,0x0491,0x04B9,0x04DF,0x0501,0x0569,
+  0x057D,0x2179,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF50,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x019A,0x01C9,0x01F0,0x021B,0x023C,0x0252,0x0266,
+  0x027A,0x028E,0x02A2,0x0000,0x1E13,0x1E3B,0x1E63,0x1E8B,
+  0x1EA9,0x1ED1,0x1EF9,0x1F11,0x1F33,0x1F55,0x1F75,0x1F91,
+  0x0000,0x1FE2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x043A,0x044E,0x0465,0x0493,0x04BB,0x04E1,0x0503,0x056A,
+  0x057E,0x217A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF51,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x019B,0x01CC,0x01F3,0x021D,0x0000,0x0253,0x0267,
+  0x027B,0x028F,0x02A3,0x0000,0x1E15,0x1E3D,0x1E65,0x1E8D,
+  0x1EAB,0x1ED3,0x0000,0x1F12,0x1F34,0x1F56,0x1F76,0x1F92,
+  0x1FB6,0x1FE3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x043B,0x044F,0x0467,0x0495,0x04BD,0x04E3,0x0505,0x056B,
+  0x057F,0x217B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF52,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x019E,0x01CE,0x01F5,0x021F,0x023F,0x0254,0x0268,
+  0x027C,0x0290,0x02A4,0x0000,0x1E17,0x1E3F,0x1E67,0x1E8F,
+  0x1EAD,0x1ED5,0x0000,0x1F13,0x1F35,0x1F57,0x1F77,0x1F93,
+  0x1FB7,0x1FE4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x043C,0x0450,0x0469,0x0497,0x04BF,0x04E5,0x0507,0x056C,
+  0x0580,0x217C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF53,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01A1,0x01D0,0x01F9,0x0221,0x0240,0x0255,0x0269,
+  0x027D,0x0291,0x02A5,0x0000,0x1E19,0x1E41,0x1E69,0x1E91,
+  0x1EAF,0x1ED7,0x0000,0x1F14,0x1F36,0x0000,0x1F78,0x1F94,
+  0x1FC2,0x1FE5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x043D,0x0451,0x046B,0x0499,0x0000,0x04E7,0x0509,0x056D,
+  0x0581,0x217D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF54,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01A3,0x01D2,0x01FB,0x0223,0x0000,0x0256,0x026A,
+  0x027E,0x0292,0x02A6,0x0000,0x1E1B,0x1E43,0x1E6B,0x1E93,
+  0x1EB1,0x1ED9,0x0000,0x1F15,0x1F37,0x0000,0x1F79,0x1F95,
+  0x1FC3,0x1FE6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x043E,0x0452,0x046D,0x049B,0x04C2,0x04E9,0x050B,0x056E,
+  0x0582,0x217E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF55,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01A5,0x01D4,0x01FD,0x0225,0x0000,0x0257,0x026B,
+  0x027F,0x0293,0x02A7,0x0000,0x1E1D,0x1E45,0x1E6D,0x1E95,
+  0x1EB3,0x1EDB,0x0000,0x0000,0x1F40,0x0000,0x1F7A,0x1F96,
+  0x1FC4,0x1FE7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x043F,0x0453,0x046F,0x049D,0x04C4,0x04EB,0x050D,0x056F,
+  0x0583,0x217F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF56,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01A8,0x01D6,0x01FF,0x0227,0x0000,0x0258,0x026C,
+  0x0280,0x0294,0x02A8,0x0000,0x1E1F,0x1E47,0x1E6F,0x1E96,
+  0x1EB5,0x1EDD,0x0000,0x0000,0x1F41,0x0000,0x1F7B,0x1F97,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0440,0x0454,0x0471,0x049F,0x04C6,0x04ED,0x050F,0x0570,
+  0x0584,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF57,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01AA,0x01D8,0x0201,0x0229,0x0000,0x0259,0x026D,
+  0x0281,0x0295,0x02A9,0x0000,0x1E21,0x1E49,0x1E71,0x1E97,
+  0x1EB7,0x1EDF,0x0000,0x0000,0x1F42,0x1F60,0x1F7C,0x1FA0,
+  0x1FC6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0441,0x0455,0x0473,0x04A1,0x04C8,0x04EF,0x0000,0x0571,
+  0x0585,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF58,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01AB,0x01DA,0x0203,0x022B,0x0000,0x025A,0x026E,
+  0x0282,0x0296,0x02AA,0x0000,0x1E23,0x1E4B,0x1E73,0x1E98,
+  0x1EB9,0x1EE1,0x0000,0x0000,0x1F43,0x1F61,0x1F7D,0x1FA1,
+  0x1FC7,0x1FF2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0442,0x0456,0x0475,0x04A3,0x04CA,0x04F1,0x0000,0x0572,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF59,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01AD,0x01DC,0x0205,0x022D,0x0000,0x025B,0x026F,
+  0x0283,0x0297,0x02AB,0x0000,0x1E25,0x1E4D,0x1E75,0x1E99,
+  0x1EBB,0x1EE3,0x0000,0x1F20,0x1F44,0x1F62,0x0000,0x1FA2,
+  0x1FD0,0x1FF3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0443,0x0457,0x0477,0x04A5,0x04CC,0x04F3,0x0000,0x0573,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0xFF5A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x01B0,0x01DD,0x0207,0x022F,0x0000,0x025C,0x0270,
+  0x0284,0x0298,0x02AC,0x0000,0x1E27,0x1E4F,0x1E77,0x1E9A,
+  0x1EBD,0x1EE5,0x0000,0x1F21,0x1F45,0x1F63,0x0000,0x1FA3,
+  0x1FD1,0x1FF4
+};
+
+
+/* 00C0-05FF */
+static uint16 uni_0C00_05FF[1344]=
+{
+  0x0017,0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,
+  0x001F,0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,
+  0x0027,0x0028,0x0029,0x002A,0x0067,0x0068,0x0069,0x0000,
+  0x006B,0x006C,0x006D,0x006E,0x006F,0x0070,0x0071,0x008A,
+  0x0037,0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,
+  0x003F,0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,
+  0x0047,0x0048,0x0049,0x004A,0x0087,0x0088,0x0089,0x0000,
+  0x008B,0x008C,0x008D,0x008E,0x008F,0x0090,0x0091,0x0092,
+  0x0073,0x0093,0x0074,0x0094,0x0075,0x0095,0x0076,0x0096,
+  0x0077,0x0097,0x0078,0x0098,0x0079,0x0099,0x007A,0x009A,
+  0x00B7,0x00D7,0x00B8,0x00D8,0x00B9,0x00D9,0x00BA,0x00DA,
+  0x00BB,0x00DB,0x00BC,0x00DC,0x00BD,0x00DD,0x00BE,0x00DE,
+  0x00BF,0x00DF,0x00C0,0x00E0,0x00C1,0x00E1,0x00C2,0x00E2,
+  0x00C3,0x00E3,0x00C4,0x00E4,0x00C5,0x00E5,0x00C6,0x00E6,
+  0x0000,0x00E7,0x00C8,0x00E8,0x00C9,0x00E9,0x00CA,0x00EA,
+  0x0127,0x0108,0x0128,0x0109,0x0129,0x010A,0x012A,0x010B,
+  0x012B,0x010C,0x012C,0x010D,0x012D,0x010E,0x012E,0x010F,
+  0x012F,0x0130,0x0111,0x0131,0x0112,0x0132,0x0113,0x0133,
+  0x0114,0x0134,0x0115,0x0135,0x0116,0x0136,0x0117,0x0137,
+  0x0118,0x0138,0x0119,0x0139,0x011A,0x013A,0x0157,0x0177,
+  0x0158,0x0178,0x0159,0x0179,0x015A,0x017A,0x015B,0x017B,
+  0x015C,0x017C,0x015D,0x017D,0x015E,0x017E,0x015F,0x017F,
+  0x0160,0x0180,0x0161,0x0181,0x0162,0x0182,0x0163,0x0183,
+  0x0072,0x0164,0x0184,0x0165,0x0185,0x0166,0x0186,0x0187,
+  0x1161,0x0A86,0x07B1,0x11B1,0x0801,0x1201,0x0AD6,0x0851,
+  0x1251,0x0B76,0x0BC6,0x08A1,0x12A1,0x12F1,0x0D52,0x0C66,
+  0x0D06,0x0941,0x1341,0x0857,0x0947,0x1391,0x0B27,0x0AD7,
+  0x09E1,0x13E1,0x1431,0x1481,0x0D07,0x07B8,0x14D1,0x08A8,
+  0x0B21,0x1521,0x0B71,0x1571,0x0BC1,0x15C1,0x0C18,0x0C11,
+  0x1611,0x0D08,0x1661,0x16B1,0x0D01,0x1701,0x0859,0x0D51,
+  0x1751,0x08F9,0x0949,0x0762,0x1162,0x07B2,0x11B2,0x0B79,
+  0x0802,0x1202,0x1252,0x12A2,0x0992,0x1392,0x1342,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x09E2,0x0000,0x13E2,0x0A32,
+  0x0000,0x1432,0x0A82,0x0000,0x1482,0x0AD2,0x14D2,0x0B22,
+  0x1522,0x0B72,0x1572,0x0BC2,0x15C2,0x0C12,0x1612,0x0C62,
+  0x1662,0x0CB2,0x16B2,0x0D02,0x1702,0x1752,0x0763,0x1163,
+  0x07B3,0x11B3,0x0803,0x1203,0x0853,0x1253,0x08A3,0x12A3,
+  0x08F3,0x12F3,0x0943,0x1343,0x0993,0x1393,0x09E3,0x13E3,
+  0x1433,0x0A83,0x0000,0x1483,0x0AD3,0x14D3,0x0991,0x0000,
+  0x0B23,0x1523,0x0B73,0x1573,0x0BC3,0x15C3,0x0C13,0x1613,
+  0x0C63,0x1663,0x0CB3,0x16B3,0x0D03,0x1703,0x0D53,0x1753,
+  0x0764,0x1164,0x07B4,0x11B4,0x0804,0x1204,0x0854,0x1254,
+  0x08A4,0x12A4,0x08F4,0x12F4,0x0944,0x1344,0x0994,0x1394,
+  0x09E4,0x13E4,0x0A34,0x1434,0x0A84,0x1484,0x0AD4,0x14D4,
+  0x0AD1,0x1524,0x0B74,0x1574,0x0BC4,0x15C4,0x0C14,0x1614,
+  0x0C64,0x1664,0x0CB4,0x16B4,0x0D04,0x1704,0x0D54,0x1754,
+  0x0765,0x1165,0x07B5,0x11B5,0x1205,0x1255,0x12A5,0x12F5,
+  0x1345,0x1395,0x09E5,0x0A35,0x1435,0x0A31,0x0A85,0x14D5,
+  0x1525,0x0C19,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x1396,0x13E6,0x1436,0x1486,0x14D6,0x1526,0x1576,0x15C6,
+  0x1616,0x1666,0x16B6,0x1706,0x1756,0x1167,0x11B7,0x1207,
+  0x1257,0x12A7,0x12F7,0x1347,0x1397,0x13E7,0x1437,0x1487,
+  0x14D7,0x1527,0x1577,0x15C7,0x1617,0x1667,0x16B7,0x1707,
+  0x1757,0x1168,0x11B8,0x1208,0x1258,0x12A8,0x12F8,0x1348,
+  0x1398,0x13E8,0x1438,0x1488,0x14D8,0x1528,0x1578,0x15C8,
+  0x1618,0x1668,0x16B8,0x1708,0x1758,0x1169,0x11B9,0x1209,
+  0x1259,0x12A9,0x12F9,0x1349,0x1399,0x13E9,0x1439,0x1489,
+  0x14D9,0x1529,0x1579,0x15C9,0x1619,0x1669,0x16B9,0x1709,
+  0x1759,0x116A,0x11BA,0x120A,0x125A,0x12AA,0x12FA,0x134A,
+  0x139A,0x13EA,0x143A,0x148A,0x14DA,0x152A,0x157A,0x15CA,
+  0x161A,0x166A,0x16BA,0x170A,0x175A,0x116B,0x11BB,0x120B,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x01F7,0x0000,
+  0x01F8,0x01F9,0x01FA,0x0000,0x0253,0x0000,0x0254,0x0255,
+  0x01D9,0x01FC,0x0257,0x01FE,0x01FF,0x0200,0x0201,0x0202,
+  0x0258,0x0204,0x02A7,0x0206,0x0207,0x0208,0x0209,0x020A,
+  0x0299,0x0248,0x0000,0x02A9,0x024B,0x024C,0x0298,0x024E,
+  0x024F,0x0250,0x0251,0x0252,0x0217,0x0218,0x0219,0x021A,
+  0x021B,0x021C,0x021D,0x021E,0x021F,0x0220,0x0221,0x0222,
+  0x0223,0x0224,0x0225,0x0226,0x0227,0x0228,0x0229,0x022A,
+  0x0267,0x0268,0x0269,0x026A,0x026B,0x026C,0x026D,0x026E,
+  0x026F,0x0270,0x0271,0x0272,0x0273,0x0274,0x0275,0x0000,
+  0x0277,0x0278,0x0259,0x025A,0x0297,0x02B8,0x02B9,0x02BA,
+  0x0000,0x02BB,0x029C,0x02BC,0x029D,0x02BD,0x029E,0x02BE,
+  0x029F,0x02BF,0x02A0,0x02C0,0x02A1,0x02C1,0x02A2,0x02C2,
+  0x02A3,0x02C3,0x02A4,0x02C4,0x02A5,0x02C5,0x02A6,0x02C6,
+  0x02C7,0x02C8,0x02C9,0x02CA,0x0000,0x0307,0x0308,0x0000,
+  0x0309,0x0000,0x0000,0x030A,0x030B,0x02EC,0x02ED,0x02EE,
+  0x0AF1,0x0B41,0x0B91,0x0BE1,0x0C31,0x0C81,0x0CD1,0x0D21,
+  0x0732,0x0782,0x07D2,0x0822,0x0872,0x08C2,0x0912,0x0962,
+  0x0730,0x0780,0x07D0,0x0820,0x0870,0x08C0,0x0910,0x0960,
+  0x09B0,0x0A00,0x0A50,0x0AA0,0x0AF0,0x0B40,0x0B90,0x0BE0,
+  0x0C30,0x0C80,0x0CD0,0x0D20,0x0731,0x0781,0x07D1,0x0821,
+  0x0871,0x08C1,0x0911,0x0961,0x09B1,0x0A01,0x0A51,0x0AA1,
+  0x1130,0x1180,0x11D0,0x1220,0x1270,0x12C0,0x1310,0x1360,
+  0x13B0,0x1400,0x1450,0x14A0,0x14F0,0x1540,0x1590,0x15E0,
+  0x1630,0x1680,0x16D0,0x1720,0x1131,0x1181,0x11D1,0x1221,
+  0x1271,0x12C1,0x1311,0x1361,0x13B1,0x1401,0x1451,0x14A1,
+  0x14F1,0x1541,0x1591,0x15E1,0x1631,0x1681,0x16D1,0x1721,
+  0x1132,0x1182,0x11D2,0x1222,0x1272,0x12C2,0x1312,0x1362,
+  0x09B2,0x13B2,0x0A02,0x1402,0x0A52,0x1452,0x0AA2,0x14A2,
+  0x0AF2,0x14F2,0x0B42,0x1542,0x0B92,0x1592,0x0BE2,0x15E2,
+  0x0C32,0x1632,0x0C82,0x1682,0x0CD2,0x16D2,0x0D22,0x1722,
+  0x0733,0x1133,0x0783,0x1183,0x07D3,0x11D3,0x0823,0x1223,
+  0x0873,0x1273,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0913,0x1313,0x0963,0x1363,0x09B3,0x13B3,
+  0x0A03,0x1403,0x0A53,0x1453,0x0AA3,0x14A3,0x0AF3,0x14F3,
+  0x0B43,0x1543,0x0B93,0x1593,0x0BE3,0x15E3,0x0C33,0x1633,
+  0x0C83,0x1683,0x0CD3,0x16D3,0x0D23,0x1723,0x0734,0x1134,
+  0x0784,0x1184,0x07D4,0x11D4,0x0824,0x1224,0x0874,0x1274,
+  0x08C4,0x12C4,0x0914,0x1314,0x0964,0x1364,0x09B4,0x13B4,
+  0x0A04,0x1404,0x0A54,0x1454,0x0AA4,0x14A4,0x0AF4,0x14F4,
+  0x0B44,0x0B94,0x1594,0x0BE4,0x15E4,0x0C34,0x1634,0x0C84,
+  0x1684,0x0CD4,0x16D4,0x0D24,0x1724,0x0735,0x1135,0x0000,
+  0x07D5,0x11D5,0x0825,0x1225,0x0875,0x1275,0x08C5,0x12C5,
+  0x0915,0x1315,0x0965,0x1365,0x09B5,0x13B5,0x0A05,0x1405,
+  0x0A55,0x1455,0x0AA5,0x14A5,0x0AF5,0x14F5,0x0B45,0x1545,
+  0x0B95,0x1595,0x0BE5,0x15E5,0x0C35,0x1635,0x0C85,0x1685,
+  0x0CD5,0x16D5,0x0D25,0x1725,0x0736,0x1136,0x0786,0x1186,
+  0x07D6,0x11D6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0A06,0x1406,0x0A56,0x1456,0x0AA6,0x14A6,0x0AF6,0x14F6,
+  0x0B46,0x1546,0x0B96,0x1596,0x0BE6,0x15E6,0x0C36,0x1636,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0787,0x07D7,0x0827,0x0877,0x08C7,0x0917,0x0967,
+  0x09B7,0x0A07,0x0A57,0x0AA7,0x0AF7,0x0B47,0x0B97,0x0BE7,
+  0x0C37,0x0C87,0x0CD7,0x0D27,0x0738,0x0788,0x07D8,0x0828,
+  0x0878,0x08C8,0x0918,0x0968,0x09B8,0x0A08,0x0A58,0x0AA8,
+  0x0AF8,0x0B48,0x0B98,0x0BE8,0x0C38,0x0C88,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x1187,0x11D7,0x1227,0x1277,0x12C7,0x1317,0x1367,
+  0x13B7,0x1407,0x1457,0x14A7,0x14F7,0x1547,0x1597,0x15E7,
+  0x1637,0x1687,0x16D7,0x1727,0x1138,0x1188,0x11D8,0x1228,
+  0x1278,0x12C8,0x1318,0x1368,0x13B8,0x1408,0x1458,0x14A8,
+  0x14F8,0x1548,0x1598,0x15E8,0x1638,0x1688,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+
+/* 1E00-1FFF */
+static uint16 uni_1E00_1FFF[512]=
+{
+  0x076C,0x116C,0x07BC,0x11BC,0x080C,0x120C,0x085C,0x125C,
+  0x08AC,0x12AC,0x08FC,0x12FC,0x094C,0x134C,0x099C,0x139C,
+  0x09EC,0x13EC,0x0A3C,0x143C,0x0A8C,0x148C,0x0ADC,0x14DC,
+  0x0B2C,0x152C,0x0B7C,0x157C,0x0BCC,0x15CC,0x0C1C,0x161C,
+  0x0C6C,0x166C,0x0CBC,0x16BC,0x0D0C,0x170C,0x0D5C,0x175C,
+  0x076D,0x116D,0x07BD,0x11BD,0x080D,0x120D,0x085D,0x125D,
+  0x08AD,0x12AD,0x08FD,0x12FD,0x094D,0x134D,0x099D,0x139D,
+  0x09ED,0x13ED,0x0A3D,0x143D,0x0A8D,0x148D,0x0ADD,0x14DD,
+  0x0B2D,0x152D,0x0B7D,0x157D,0x0BCD,0x15CD,0x0C1D,0x161D,
+  0x0C6D,0x166D,0x0CBD,0x16BD,0x0D0D,0x170D,0x0D5D,0x175D,
+  0x076E,0x116E,0x07BE,0x11BE,0x080E,0x120E,0x085E,0x125E,
+  0x08AE,0x12AE,0x08FE,0x12FE,0x094E,0x134E,0x099E,0x139E,
+  0x0770,0x13EE,0x0A3E,0x143E,0x0A8E,0x148E,0x0ADE,0x14DE,
+  0x0B2E,0x152E,0x0B7E,0x157E,0x0BCE,0x15CE,0x0C1E,0x161E,
+  0x0C6E,0x166E,0x0CBE,0x16BE,0x0D0E,0x170E,0x0D5E,0x175E,
+  0x076F,0x116F,0x07BF,0x11BF,0x080F,0x120F,0x085F,0x125F,
+  0x08AF,0x12AF,0x08FF,0x12FF,0x094F,0x134F,0x099F,0x139F,
+  0x09EF,0x13EF,0x0A3F,0x143F,0x0A8F,0x148F,0x0ADF,0x14DF,
+  0x0B2F,0x152F,0x0B7F,0x157F,0x0BCF,0x15CF,0x161F,0x166F,
+  0x16BF,0x170F,0x175F,0x1170,0x0000,0x0000,0x0000,0x0000,
+  0x0900,0x1300,0x0950,0x1350,0x09A0,0x13A0,0x09F0,0x13F0,
+  0x0A40,0x1440,0x0A90,0x1490,0x0AE0,0x14E0,0x0B30,0x1530,
+  0x0B80,0x1580,0x0BD0,0x15D0,0x0C20,0x1620,0x0C70,0x1670,
+  0x0CC0,0x16C0,0x0D10,0x1710,0x0D60,0x1760,0x0771,0x1171,
+  0x07C1,0x11C1,0x0811,0x1211,0x0861,0x1261,0x08B1,0x12B1,
+  0x0901,0x1301,0x0951,0x1351,0x09A1,0x13A1,0x09F1,0x13F1,
+  0x0A41,0x1441,0x0A91,0x1491,0x0AE1,0x14E1,0x0B31,0x1531,
+  0x0B81,0x1581,0x0BD1,0x15D1,0x0C21,0x1621,0x0C71,0x1671,
+  0x0CC1,0x16C1,0x0D11,0x1711,0x0D61,0x1761,0x0772,0x1172,
+  0x07C2,0x11C2,0x0812,0x1212,0x0862,0x1262,0x08B2,0x12B2,
+  0x0902,0x1302,0x0952,0x1352,0x09A2,0x13A2,0x09F2,0x13F2,
+  0x0A42,0x1442,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x1173,0x11C3,0x1213,0x1263,0x12B3,0x1303,0x1353,0x13A3,
+  0x0773,0x07C3,0x0813,0x0863,0x08B3,0x0903,0x0953,0x09A3,
+  0x13F3,0x1443,0x1493,0x14E3,0x1533,0x1583,0x0000,0x0000,
+  0x09F3,0x0A43,0x0A93,0x0AE3,0x0B33,0x0B83,0x0000,0x0000,
+  0x1713,0x1763,0x1174,0x11C4,0x1214,0x1264,0x12B4,0x1304,
+  0x0D13,0x0D63,0x0774,0x07C4,0x0814,0x0864,0x08B4,0x0904,
+  0x1354,0x13A4,0x13F4,0x1444,0x1494,0x14E4,0x1534,0x1584,
+  0x0954,0x09A4,0x09F4,0x0A44,0x0A94,0x0AE4,0x0B34,0x0B84,
+  0x15D4,0x1624,0x1674,0x16C4,0x1714,0x1764,0x0000,0x0000,
+  0x0BD4,0x0C24,0x0C74,0x0CC4,0x0D14,0x0D64,0x0000,0x0000,
+  0x12B5,0x1305,0x1355,0x13A5,0x13F5,0x1445,0x1495,0x14E5,
+  0x0000,0x0905,0x0000,0x09A5,0x0000,0x0A45,0x0000,0x0AE5,
+  0x1675,0x16C5,0x1715,0x1765,0x1176,0x11C6,0x1216,0x1266,
+  0x0C75,0x0CC5,0x0D15,0x0D65,0x0776,0x07C6,0x0816,0x0866,
+  0x12B6,0x1306,0x1356,0x13A6,0x13F6,0x1446,0x1496,0x14E6,
+  0x1536,0x1586,0x15D6,0x1626,0x1676,0x16C6,0x0000,0x0000,
+  0x1177,0x11C7,0x1217,0x1267,0x12B7,0x1307,0x1357,0x13A7,
+  0x0777,0x07C7,0x0817,0x0867,0x08B7,0x0907,0x0957,0x09A7,
+  0x13F7,0x1447,0x1497,0x14E7,0x1537,0x1587,0x15D7,0x1627,
+  0x09F7,0x0A47,0x0A97,0x0AE7,0x0B37,0x0B87,0x0BD7,0x0C27,
+  0x1677,0x16C7,0x1717,0x1767,0x1178,0x11C8,0x1218,0x1268,
+  0x0C77,0x0CC7,0x0D17,0x0D67,0x0778,0x07C8,0x0818,0x0868,
+  0x12B8,0x1308,0x1358,0x13A8,0x13F8,0x0000,0x1498,0x14E8,
+  0x08B8,0x0908,0x08B6,0x0906,0x09A8,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x1538,0x1588,0x15D8,0x0000,0x1678,0x16C8,
+  0x0956,0x09A6,0x09F6,0x0A46,0x0B88,0x0000,0x0000,0x0000,
+  0x1718,0x1768,0x1179,0x11C9,0x0000,0x0000,0x12B9,0x1309,
+  0x0D18,0x0D68,0x0A96,0x0AE6,0x0000,0x0000,0x0000,0x0000,
+  0x13A9,0x13F9,0x1449,0x1499,0x14E9,0x1539,0x1589,0x15D9,
+  0x09A9,0x09F9,0x0BD6,0x0C26,0x0B39,0x0000,0x0000,0x0000,
+  0x0000,0x0000,0x16C9,0x1719,0x0000,0x0000,0x11CA,0x121A,
+  0x0B36,0x0B86,0x0C76,0x0CC6,0x0D19,0x0000,0x0000,0x0000
+};
+
+
+/* 2160-217F */
+static uint16 uni_2160_217F[32]=
+{
+  0x0739,0x0789,0x07D9,0x0829,0x0879,0x08C9,0x0919,0x0969,
+  0x09B9,0x0A09,0x0A59,0x0AA9,0x0AF9,0x0B49,0x0B99,0x0BE9,
+  0x1139,0x1189,0x11D9,0x1229,0x1279,0x12C9,0x1319,0x1369,
+  0x13B9,0x1409,0x1459,0x14A9,0x14F9,0x1549,0x1599,0x15E9
+};
+
+
+/* 24B0-24EF */
+static uint16 uni_24B0_24EF[64]=
+{
+  0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0511,0x0512,
+  0x0513,0x0514,0x0515,0x0516,0x0517,0x0518,0x0519,0x051A,
+  0x051B,0x051C,0x051D,0x051E,0x051F,0x0520,0x0521,0x0522,
+  0x0523,0x0524,0x0525,0x0526,0x0527,0x0528,0x0529,0x052A,
+  0x0531,0x0532,0x0533,0x0534,0x0535,0x0536,0x0537,0x0538,
+  0x0539,0x053A,0x053B,0x053C,0x053D,0x053E,0x053F,0x0540,
+  0x0541,0x0542,0x0543,0x0544,0x0545,0x0546,0x0547,0x0548,
+  0x0549,0x054A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+
+/* FF20-FF5F */
+static uint16 uni_FF20_FF5F[64]=
+{
+  0x0000,0x0560,0x05B0,0x0600,0x0650,0x06A0,0x06F0,0x0740,
+  0x0790,0x07E0,0x0830,0x0880,0x08D0,0x0920,0x0970,0x09C0,
+  0x0A10,0x0A60,0x0AB0,0x0B00,0x0B50,0x0BA0,0x0BF0,0x0C40,
+  0x0C90,0x0CE0,0x0D30,0x0000,0x0000,0x0000,0x0000,0x0000,
+  0x0000,0x0F60,0x0FB0,0x1000,0x1050,0x10A0,0x10F0,0x1140,
+  0x1190,0x11E0,0x1230,0x1280,0x12D0,0x1320,0x1370,0x13C0,
+  0x1410,0x1460,0x14B0,0x1500,0x1550,0x15A0,0x15F0,0x1640,
+  0x1690,0x16E0,0x1730,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+
+
+
+
+/*
+  Returns
+   a number 0..15, if a valid HEX digit in lower case,
+   -1 otherwise.
+*/
+
+static int hexlo(int x)
+{
+  static char hex_lo_digit[256]=
+  {
+    -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, /*  !"#$%&'()*+,-./ */
+     0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1,-1,-1,-1,-1, /* 0123456789:;<=>? */
+    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* @ABCDEFGHIJKLMNO */
+    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* PQRSTUVWXYZ[\]^_ */
+    -1,10,11,12,13,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* `abcdefghijklmno */
+    -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, /* pqrstuvwxyz{|}~. */
+    -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, /* ................ */
+    -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, /* ................ */
+    -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, /* ................ */
+  };
+  return hex_lo_digit[(unsigned int) x];
+}
+
+
+/*
+  Safe characters:
+   '\0'  NULL
+   A..Z  capital letters,
+   a..z  small letters
+   0..9  digits
+   _     underscore
+*/
+static char filename_safe_char[128]=
+{
+  1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* ................ */
+  0,0,0,0,0,0,0,0,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,0,0,0,0,0,0, /* 0123456789:;<=>? */
+  0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* @ABCDEFGHIJKLMNO */
+  1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1, /* PQRSTUVWXYZ[\]^_ */
+  0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* `abcdefghijklmno */
+  1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0, /* pqrstuvwxyz{|}~. */
+};
+
+#define MY_FILENAME_ESCAPE '@'
+
+static int
+my_mb_wc_filename(CHARSET_INFO *cs __attribute__((unused)),
+                  my_wc_t *pwc, const uchar *s, const uchar *e)
+{
+  int byte1, byte2;
+  if (s >= e)
+    return MY_CS_TOOSMALL;
+
+  if (*s < 128 && filename_safe_char[*s])  
+  {
+    *pwc= *s;
+    return 1;
+  }
+  
+  if (*s != MY_FILENAME_ESCAPE)
+    return MY_CS_ILSEQ;
+  
+  if (s + 3 > e)
+    return MY_CS_TOOSMALL3;
+  
+  byte1= s[1];
+  byte2= s[2];
+  
+  if (byte1 >= 0x30 && byte1 <= 0x7F &&
+      byte2 >= 0x30 && byte2 <= 0x7F)
+  {
+    int code= (byte1 - 0x30) * 80 + byte2 - 0x30;
+    if (code < 5994 && touni[code])
+    {
+      *pwc= touni[code];
+      return 3;
+    }
+  }
+  
+  if (s + 4 > e)
+    return MY_CS_TOOSMALL4;
+
+  if ((byte1= hexlo(byte1)) >= 0 &&
+      (byte2= hexlo(byte2)) >= 0)
+  {
+    int byte3= hexlo(s[3]);
+    int byte4= hexlo(s[4]);
+    if (byte3 >=0 && byte4 >=0)
+    {
+      *pwc= (byte1 << 12) + (byte2 << 8) + (byte3 << 4) + byte4;
+      return 5;
+    }
+  }
+  
+  return MY_CS_ILSEQ;
+}
+
+
+static int
+my_wc_mb_filename(CHARSET_INFO *cs __attribute__((unused)),
+                  my_wc_t wc, unsigned char *s, unsigned char *e)
+{
+  int code;
+  char hex[]= "0123456789abcdef";
+  if (wc < 128 && filename_safe_char[wc])
+  {
+    *s= wc;
+    return 1;
+  }
+  
+  if (s + 3 > e)
+    return MY_CS_TOOSMALL3;
+
+  *s++= MY_FILENAME_ESCAPE;
+  if ((wc >= 0x00C0 && wc <= 0x05FF && (code= uni_0C00_05FF[wc - 0x00C0])) ||
+      (wc >= 0x1E00 && wc <= 0x1FFF && (code= uni_1E00_1FFF[wc - 0x1E00])) ||
+      (wc >= 0x2160 && wc <= 0x217F && (code= uni_2160_217F[wc - 0x2160])) ||
+      (wc >= 0x24B0 && wc <= 0x24EF && (code= uni_24B0_24EF[wc - 0x24B0])) ||
+      (wc >= 0xFF20 && wc <= 0xFF5F && (code= uni_FF20_FF5F[wc - 0xFF20])))
+  {
+    *s++= (code / 80) + 0x30;
+    *s++= (code % 80) + 0x30;
+    return 3;
+  }
+
+  /* Non letter */
+  if (s + 5 > e)
+    return MY_CS_TOOSMALL5;
+
+  *s++= hex[(wc >> 12) & 15];
+  *s++= hex[(wc >> 8) & 15];
+  *s++= hex[(wc >> 4) & 15];
+  *s++= hex[(wc)      & 15];
+  return 5;
+}
+
+
+static MY_COLLATION_HANDLER my_collation_filename_handler =
+{
+    NULL,               /* init */
+    my_strnncoll_utf8,
+    my_strnncollsp_utf8,
+    my_strnxfrm_utf8,
+    my_strnxfrmlen_utf8,
+    my_like_range_mb,
+    my_wildcmp_utf8,
+    my_strcasecmp_utf8,
+    my_instr_mb,
+    my_hash_sort_utf8,
+    my_propagate_complex
+};
+
+static MY_CHARSET_HANDLER my_charset_filename_handler=
+{
+    NULL,               /* init */
+    my_ismbchar_utf8,
+    my_mbcharlen_utf8,
+    my_numchars_mb,
+    my_charpos_mb,
+    my_well_formed_len_mb,
+    my_lengthsp_8bit,
+    my_numcells_mb,
+    my_mb_wc_filename,
+    my_wc_mb_filename,
+    my_mb_ctype_mb,
+    my_caseup_str_utf8,
+    my_casedn_str_utf8,
+    my_caseup_utf8,
+    my_casedn_utf8,
+    my_snprintf_8bit,
+    my_long10_to_str_8bit,
+    my_longlong10_to_str_8bit,
+    my_fill_8bit,
+    my_strntol_8bit,
+    my_strntoul_8bit,
+    my_strntoll_8bit,
+    my_strntoull_8bit,
+    my_strntod_8bit,
+    my_strtoll10_8bit,
+    my_scan_8bit
+};
+
+
+
+CHARSET_INFO my_charset_filename=
+{
+    17,0,0,             /* number       */
+    MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_HIDDEN,
+    "filename",         /* cs name      */
+    "filename",         /* name         */
+    "",                 /* comment      */
+    NULL,               /* tailoring    */
+    ctype_utf8,         /* ctype        */
+    to_lower_utf8,      /* to_lower     */
+    to_upper_utf8,      /* to_upper     */
+    to_upper_utf8,      /* sort_order   */
+    NULL,               /* contractions */
+    NULL,               /* sort_order_big*/
+    NULL,               /* tab_to_uni   */
+    NULL,               /* tab_from_uni */
+    my_unicase_default, /* caseinfo     */
+    NULL,               /* state_map    */
+    NULL,               /* ident_map    */
+    1,                  /* strxfrm_multiply */
+    1,                  /* caseup_multiply  */
+    1,                  /* casedn_multiply  */
+    1,                  /* mbminlen     */
+    5,                  /* mbmaxlen     */
+    0,                  /* min_sort_char */
+    0xFFFF,             /* max_sort_char */
+    ' ',                /* pad char      */
+    0,                  /* escape_with_backslash_is_dangerous */
+    &my_charset_filename_handler,
+    &my_collation_filename_handler
+};
+
+#ifdef MY_TEST_UTF8
+#include <stdio.h>
+
+static void test_mb(CHARSET_INFO *cs, uchar *s)
+{
+  while(*s)
+  {
+    if (my_ismbhead_utf8(cs,*s))
+    {
+      int len=my_mbcharlen_utf8(cs,*s);
+      while(len--)
+      {
+        printf("%c",*s);
+        s++;
+      }
+      printf("\n");
+    }
+    else
+    {
+      printf("%c\n",*s);
+      s++;
+    }
+  }
+}
+
+int main()
+{
+  char str[1024]=" utf8 test проба ПЕРА по-РУССКИ";
+  CHARSET_INFO *cs;
+
+  test_mb(cs,(uchar*)str);
+
+  printf("orig      :'%s'\n",str);
+
+  my_caseup_utf8(cs,str,15);
+  printf("caseup    :'%s'\n",str);
+
+  my_caseup_str_utf8(cs,str);
+  printf("caseup_str:'%s'\n",str);
+
+  my_casedn_utf8(cs,str,15);
+  printf("casedn    :'%s'\n",str);
+
+  my_casedn_str_utf8(cs,str);
+  printf("casedn_str:'%s'\n",str);
+
+  return 0;
+}
+
+#endif
+
+#endif
+
+#endif /* HAVE_CHARSET_UTF8 */
+
+
+
diff --git a/src/lib/data.cpp b/src/lib/data.cpp
new file mode 100644 (file)
index 0000000..45c7d1a
--- /dev/null
@@ -0,0 +1,298 @@
+/*
+ * This file part of StarDict - A international dictionary for GNOME.
+ * http://stardict.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/* implementation of class to work with dictionary data */
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "kmp.h"
+
+#include "data.hpp"
+#include "getuint32.h"
+
+
+DictBase::DictBase()
+{
+       dictfile = NULL;
+       cache_cur =0;
+}
+
+DictBase::~DictBase()
+{
+       if (dictfile)
+               fclose(dictfile);
+}
+
+gchar* DictBase::GetWordData(guint32 idxitem_offset, guint32 idxitem_size)
+{
+       for (int i=0; i<WORDDATA_CACHE_NUM; i++)
+               if (cache[i].data && cache[i].offset == idxitem_offset)
+                       return cache[i].data;
+
+       if (dictfile)
+               fseek(dictfile, idxitem_offset, SEEK_SET);
+
+       gchar *data;
+       if (!sametypesequence.empty()) {
+               gchar *origin_data = (gchar *)g_malloc(idxitem_size);
+
+               if (dictfile)
+                       fread(origin_data, idxitem_size, 1, dictfile);
+               else
+                       dictdzfile->read(origin_data, idxitem_offset, idxitem_size);
+
+               guint32 data_size;
+               gint sametypesequence_len = sametypesequence.length();
+               //there have sametypesequence_len char being omitted.
+               data_size = idxitem_size + sametypesequence_len; //Here is a bug fix of 2.4.8, which don't add sizeof(guint32) anymore.
+
+               //if the last item's size is determined by the end up '\0',then +=sizeof(gchar);
+               //if the last item's size is determined by the head guint32 type data,then +=sizeof(guint32);
+               switch (sametypesequence[sametypesequence_len-1]) {
+               case 'm':
+               case 't':
+               case 'y':
+               case 'l':
+               case 'g':
+               case 'x':
+               case 'k':
+               case 'w':
+                       data_size += sizeof(gchar);
+                       break;
+               case 'W':
+               case 'P':
+                       data_size += sizeof(guint32);
+                       break;
+               default:
+                       if (g_ascii_isupper(sametypesequence[sametypesequence_len-1]))
+                               data_size += sizeof(guint32);
+                       else
+                               data_size += sizeof(gchar);
+                       break;
+               }
+               data = (gchar *)g_malloc(data_size + sizeof(guint32));
+               gchar *p1,*p2;
+               p1 = data + sizeof(guint32);
+               p2 = origin_data;
+               guint32 sec_size;
+               //copy the head items.
+               for (int i=0; i<sametypesequence_len-1; i++) {
+                       *p1=sametypesequence[i];
+                       p1+=sizeof(gchar);
+                       switch (sametypesequence[i]) {
+                       case 'm':
+                       case 't':
+                       case 'y':
+                       case 'l':
+                       case 'g':
+                       case 'x':
+                       case 'k':
+                       case 'w':
+                               sec_size = strlen(p2)+1;
+                               memcpy(p1, p2, sec_size);
+                               p1+=sec_size;
+                               p2+=sec_size;
+                               break;
+                       case 'W':
+                       case 'P':
+                               sec_size = get_uint32(p2);
+                               sec_size += sizeof(guint32);
+                               memcpy(p1, p2, sec_size);
+                               p1+=sec_size;
+                               p2+=sec_size;
+                               break;
+                       default:
+                               if (g_ascii_isupper(sametypesequence[i])) {
+                                       sec_size = get_uint32(p2);
+                                       sec_size += sizeof(guint32);
+                               } else {
+                                       sec_size = strlen(p2)+1;
+                               }
+                               memcpy(p1, p2, sec_size);
+                               p1+=sec_size;
+                               p2+=sec_size;
+                               break;
+                       }
+               }
+               //calculate the last item 's size.
+               sec_size = idxitem_size - (p2-origin_data);
+               *p1=sametypesequence[sametypesequence_len-1];
+               p1+=sizeof(gchar);
+               switch (sametypesequence[sametypesequence_len-1]) {
+               case 'm':
+               case 't':
+               case 'y':
+               case 'l':
+               case 'g':
+               case 'x':
+               case 'k':
+               case 'w':
+                       memcpy(p1, p2, sec_size);
+                       p1 += sec_size;
+                       *p1='\0';//add the end up '\0';
+                       break;
+               case 'W':
+               case 'P':
+                       memcpy(p1, &sec_size, sizeof(guint32));
+                       p1 += sizeof(guint32);
+                       memcpy(p1, p2, sec_size);
+                       break;
+               default:
+                       if (g_ascii_isupper(sametypesequence[sametypesequence_len-1])) {
+                               memcpy(p1, &sec_size, sizeof(guint32));
+                               p1 += sizeof(guint32);
+                               memcpy(p1, p2, sec_size);
+                       } else {
+                               memcpy(p1, p2, sec_size);
+                               p1 += sec_size;
+                               *p1='\0';
+                       }
+                       break;
+               }
+               g_free(origin_data);
+               memcpy(data, &data_size, sizeof(guint32));
+       } else {
+               data = (gchar *)g_malloc(idxitem_size + sizeof(guint32));
+               if (dictfile)
+                       fread(data+sizeof(guint32), idxitem_size, 1, dictfile);
+               else
+                       dictdzfile->read(data+sizeof(guint32), idxitem_offset, idxitem_size);
+               memcpy(data, &idxitem_size, sizeof(guint32));
+       }
+       g_free(cache[cache_cur].data);
+
+       cache[cache_cur].data = data;
+       cache[cache_cur].offset = idxitem_offset;
+       cache_cur++;
+       if (cache_cur==WORDDATA_CACHE_NUM)
+               cache_cur = 0;
+       return data;
+}
+
+bool DictBase::SearchData(std::vector<std::string> &SearchWords, guint32 idxitem_offset, guint32 idxitem_size, gchar *origin_data)
+{
+       int nWord = SearchWords.size();
+       std::vector<bool> WordFind(nWord, false);
+       int nfound=0;
+
+       if (dictfile)
+               fseek(dictfile, idxitem_offset, SEEK_SET);
+       if (dictfile)
+               fread(origin_data, idxitem_size, 1, dictfile);
+       else
+               dictdzfile->read(origin_data, idxitem_offset, idxitem_size);
+       gchar *p = origin_data;
+       guint32 sec_size;
+       int j;
+       if (!sametypesequence.empty()) {
+               gint sametypesequence_len = sametypesequence.length();
+               for (int i=0; i<sametypesequence_len-1; i++) {
+                       switch (sametypesequence[i]) {
+                       case 'm':
+                       case 't':
+                       case 'y':
+                       case 'l':
+                       case 'g':
+                       case 'x':
+                       case 'k':
+                       case 'w':
+                       case 'h':
+                               for (j=0; j<nWord; j++)
+                                       // KMP() is faster than strstr() in theory. Really? Always be true?
+                                       //if (!WordFind[j] && strstr(p, SearchWords[j].c_str())) {
+                                       if (!WordFind[j] && KMP(p, strlen(p), SearchWords[j].c_str())!=-1) {
+                                               WordFind[j] = true;
+                                               ++nfound;
+                                       }
+
+                               if (nfound==nWord)
+                                       return true;
+                               sec_size = strlen(p)+1;
+                               p+=sec_size;
+                               break;
+                       default:
+                               if (g_ascii_isupper(sametypesequence[i])) {
+                                       sec_size = get_uint32(p);
+                                       sec_size += sizeof(guint32);
+                               } else {
+                                       sec_size = strlen(p)+1;
+                               }
+                               p+=sec_size;
+                       }
+               }
+               switch (sametypesequence[sametypesequence_len-1]) {
+               case 'm':
+               case 't':
+               case 'y':
+               case 'l':
+               case 'g':
+               case 'x':
+               case 'k':
+               case 'w':
+               case 'h':
+                       sec_size = idxitem_size - (p-origin_data);
+                       for (j=0; j<nWord; j++)
+                               //if (!WordFind[j] && g_strstr_len(p, sec_size, SearchWords[j].c_str())) {
+                               if (!WordFind[j] && KMP(p, sec_size, SearchWords[j].c_str())!=-1) {
+                                       WordFind[j] = true;
+                                       ++nfound;
+                               }
+
+                       if (nfound==nWord)
+                               return true;
+                       break;
+               }
+       } else {
+               while (guint32(p - origin_data)<idxitem_size) {
+                       switch (*p) {
+                       case 'm':
+                       case 't':
+                       case 'y':
+                       case 'l':
+                       case 'g':
+                       case 'x':
+                       case 'k':
+                       case 'w':
+                       case 'h':
+                               for (j=0; j<nWord; j++)
+                                       if (!WordFind[j] && strstr(p, SearchWords[j].c_str())) {
+                                               WordFind[j] = true;
+                                               ++nfound;
+                                       }
+
+                               if (nfound==nWord)
+                                       return true;
+                               sec_size = strlen(p)+1;
+                               p+=sec_size;
+                               break;
+                        default:
+                                if (g_ascii_isupper(*p)) {
+                                        sec_size = get_uint32(p);
+                                       sec_size += sizeof(guint32);
+                                } else {
+                                        sec_size = strlen(p)+1;
+                                }
+                                p+=sec_size;
+                       }
+               }
+       }
+       return false;
+}
+
diff --git a/src/lib/data.hpp b/src/lib/data.hpp
new file mode 100644 (file)
index 0000000..c26b52f
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef _DATA_HPP_
+#define _DATA_HPP_
+
+#include <glib.h>
+#include <vector>
+#include <string>
+#include <memory>
+
+#include "dictziplib.hpp"
+
+struct cacheItem {
+  guint32 offset;
+       gchar *data;
+  //write code here to make it inline
+  cacheItem() {data= NULL;}
+  ~cacheItem() {g_free(data);}
+};
+
+const int WORDDATA_CACHE_NUM = 10;
+const int UNSET_INDEX = -1;
+const int INVALID_INDEX=-100;
+
+class DictBase {
+public:
+       DictBase();
+       ~DictBase();
+       gchar * GetWordData(guint32 idxitem_offset, guint32 idxitem_size);
+       bool containSearchData() {
+               if (sametypesequence.empty())
+                       return true;
+
+               return sametypesequence.find_first_of("mlgxtykwh") !=
+                       std::string::npos;
+       }
+       bool SearchData(std::vector<std::string> &SearchWords, guint32 idxitem_offset, guint32 idxitem_size, gchar *origin_data);
+protected:
+       std::string sametypesequence;
+       FILE *dictfile;
+       std::auto_ptr<dictData> dictdzfile;
+private:
+  cacheItem cache[WORDDATA_CACHE_NUM];
+       gint cache_cur;
+};
+
+#endif//!_DATA_HPP_
diff --git a/src/lib/dict_client.cpp b/src/lib/dict_client.cpp
new file mode 100644 (file)
index 0000000..fcfa995
--- /dev/null
@@ -0,0 +1,611 @@
+/*
+ * This file part of StarDict - A international dictionary for GNOME.
+ * http://stardict.sourceforge.net
+ * Copyright (C) 2006 Evgeniy <dushistov@mail.ru>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * Based on RFC 2229 and gnome dictionary source code
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <glib.h>
+
+#include "sockets.hpp"
+
+#include "dict_client.hpp"
+
+sigc::signal<void, const std::string&> DictClient::on_error_;
+sigc::signal<void, const DictClient::IndexList&>
+DictClient::on_simple_lookup_end_;
+sigc::signal<void, const DictClient::StringList&>
+ DictClient::on_complex_lookup_end_;
+
+/* Status codes as defined by RFC 2229 */
+enum DICTStatusCode {
+  STATUS_INVALID                   = 0,
+
+  STATUS_N_DATABASES_PRESENT       = 110,
+  STATUS_N_STRATEGIES_PRESENT      = 111,
+  STATUS_DATABASE_INFO             = 112,
+  STATUS_HELP_TEXT                 = 113,
+  STATUS_SERVER_INFO               = 114,
+  STATUS_CHALLENGE                 = 130,
+  STATUS_N_DEFINITIONS_RETRIEVED   = 150,
+  STATUS_WORD_DB_NAME              = 151,
+  STATUS_N_MATCHES_FOUND           = 152,
+  STATUS_CONNECT                   = 220,
+  STATUS_QUIT                      = 221,
+  STATUS_AUTH_OK                   = 230,
+  STATUS_OK                        = 250,
+  STATUS_SEND_RESPONSE             = 330,
+  /* Connect response codes */
+  STATUS_SERVER_DOWN               = 420,
+  STATUS_SHUTDOWN                  = 421,
+  /* Error codes */
+  STATUS_BAD_COMMAND               = 500,
+  STATUS_BAD_PARAMETERS            = 501,
+  STATUS_COMMAND_NOT_IMPLEMENTED   = 502,
+  STATUS_PARAMETER_NOT_IMPLEMENTED = 503,
+  STATUS_NO_ACCESS                 = 530,
+  STATUS_USE_SHOW_INFO             = 531,
+  STATUS_UNKNOWN_MECHANISM         = 532,
+  STATUS_BAD_DATABASE              = 550,
+  STATUS_BAD_STRATEGY              = 551,
+  STATUS_NO_MATCH                  = 552,
+  STATUS_NO_DATABASES_PRESENT      = 554,
+  STATUS_NO_STRATEGIES_PRESENT     = 555
+};
+
+
+void DICT::Cmd::send(GIOChannel *channel, GError *&err)
+{
+       g_assert(channel);
+
+       GIOStatus res =
+               g_io_channel_write_chars(channel,
+                                        query().c_str(),
+                                        -1, NULL, &err);
+       if (res != G_IO_STATUS_NORMAL)
+               return;
+
+       /* force flushing of the write buffer */
+       res = g_io_channel_flush(channel, &err);
+
+       if (res != G_IO_STATUS_NORMAL)
+               return;
+
+       state_ = DICT::Cmd::DATA;
+}
+
+class DefineCmd : public DICT::Cmd {
+public:
+       DefineCmd(const gchar *database, const gchar *word) {
+               char *quote_word = g_shell_quote(word);
+               query_ = std::string("DEFINE ") + database + ' ' + quote_word +
+                       "\r\n";
+               g_free(quote_word);
+       }
+       bool parse(gchar *str, int code);
+};
+
+class MatchCmd : public DICT::Cmd {
+public:
+       MatchCmd(const gchar *database, const gchar *strategy,
+                const gchar *word) :
+               database_(database),
+               strategy_(strategy),
+               word_(word)
+               {               
+               }
+       const std::string& query() {
+               if (query_.empty()) {
+                       handle_word();
+                       char *quote_word = g_shell_quote(word_.c_str());
+                       query_ = "MATCH " + database_ + " " + strategy_ +
+                               ' ' + quote_word + "\r\n";
+                       g_free(quote_word);
+               }
+               return DICT::Cmd::query();
+       }
+       bool parse(gchar *str, int code);
+protected:
+       std::string database_;
+       std::string strategy_;
+       std::string word_;
+
+       virtual void handle_word() {}
+};
+
+class LevCmd : public MatchCmd {
+public:
+       LevCmd(const gchar *database, const gchar *word) :
+               MatchCmd(database, "lev", word)
+               {
+               }
+};
+
+class RegexpCmd : public MatchCmd {
+public:
+       RegexpCmd(const gchar *database, const gchar *word) :
+               MatchCmd(database, "re", word) 
+               {
+               }
+protected:
+       void handle_word();
+};
+
+void RegexpCmd::handle_word()
+{
+       std::string newword;
+       std::string::const_iterator it;
+
+       for (it = word_.begin(); it != word_.end(); ++it)
+               if (*it == '*')
+                       newword += ".*";
+               else
+                       newword += *it;
+
+       word_ = "^" + newword;
+}
+
+bool MatchCmd::parse(gchar *str, int code)
+{
+       if (code == STATUS_N_MATCHES_FOUND) { 
+          gchar *p = g_utf8_strchr(str, -1, ' ');
+
+          if (p)
+            p = g_utf8_next_char (p);
+         g_debug("server replied: %d matches found\n", atoi (p));
+        } else if (0 == strcmp (str, "."))
+               state_ = FINISH;
+       else {
+          gchar *word, *db_name, *p;
+
+          db_name = str;
+          if (!db_name)
+                 return false;
+
+          p = g_utf8_strchr(db_name, -1, ' ');
+          if (p)
+            *p = '\0';
+
+          word = g_utf8_next_char (p);
+
+          if (word[0] == '\"')
+                 word = g_utf8_next_char (word);
+
+          p = g_utf8_strchr (word, -1, '\"');
+          if (p)
+            *p = '\0';
+          
+          reslist_.push_back(DICT::Definition(word));
+        }
+
+       return true;
+}
+
+bool DefineCmd::parse(gchar *str, int code)
+{
+       if (state_ != DATA)
+               return false;
+       switch (code) {
+       case STATUS_N_DEFINITIONS_RETRIEVED: {
+               gchar *p = g_utf8_strchr(str, -1, ' ');
+               if (p)
+                       p = g_utf8_next_char (p);
+
+               g_debug("server replied: %d definitions found\n", atoi(p));
+               break;
+       }
+       case STATUS_WORD_DB_NAME: {
+               gchar *word, *db_name, *db_full, *p;
+
+               word = str;
+
+               /* skip the status code */
+               word = g_utf8_strchr(word, -1, ' ');
+               word = g_utf8_next_char(word);
+
+               if (word[0] == '\"')
+                       word = g_utf8_next_char(word);
+
+               p = g_utf8_strchr(word, -1, '\"');
+               if (p)
+                       *p = '\0';
+
+               p = g_utf8_next_char(p);
+
+               /* the database name is not protected by "" */
+               db_name = g_utf8_next_char(p);
+               if (!db_name)
+                       break;
+
+               p = g_utf8_strchr(db_name, -1, ' ');
+               if (p)
+                       *p = '\0';
+
+               p = g_utf8_next_char(p);
+
+               db_full = g_utf8_next_char(p);
+               if (!db_full)
+                       break;
+
+               if (db_full[0] == '\"')
+                       db_full = g_utf8_next_char(db_full);
+
+               p = g_utf8_strchr(db_full, -1, '\"');
+               if (p)
+                       *p = '\0';
+
+               g_debug("{ word .= '%s', db_name .= '%s', db_full .= '%s' }\n",
+                       word, db_name, db_full);
+               reslist_.push_back(DICT::Definition(word));
+               break;
+       }
+       default:
+               if (!reslist_.empty() && strcmp(".", str))
+                       reslist_.back().data_ += std::string(str) + "\n";
+
+               break;
+       }
+       return true;
+}
+
+
+DictClient::DictClient(const char *host, int port)
+{
+       host_ = host;
+       port_ = port;
+       sd_ = -1;
+       channel_ = NULL;
+       source_id_ = 0;
+       is_connected_ = false;
+       last_index_ = 0;
+}
+
+DictClient::~DictClient()
+{
+       disconnect();
+}
+
+void DictClient::connect()
+{
+    Socket::resolve(host_, this, on_resolved);
+}
+
+void DictClient::on_resolved(gpointer data, struct hostent *ret)
+{
+       DictClient *oDictClient = (DictClient *)data;
+       oDictClient->sd_ = Socket::socket();
+
+       if (oDictClient->sd_ == -1) {
+               on_error_.emit("Can not create socket: " + Socket::get_error_msg());
+               return;
+       }
+
+#ifdef _WIN32
+       oDictClient->channel_ = g_io_channel_win32_new_socket(oDictClient->sd_);
+#else
+       oDictClient->channel_ = g_io_channel_unix_new(oDictClient->sd_);
+#endif
+
+/* RFC2229 mandates the usage of UTF-8, so we force this encoding */
+       g_io_channel_set_encoding(oDictClient->channel_, "UTF-8", NULL);
+
+       g_io_channel_set_line_term(oDictClient->channel_, "\r\n", 2);
+
+/* make sure that the channel is non-blocking */
+       int flags = g_io_channel_get_flags(oDictClient->channel_);
+       flags |= G_IO_FLAG_NONBLOCK;
+       GError *err = NULL;
+       g_io_channel_set_flags(oDictClient->channel_, GIOFlags(flags), &err);
+       if (err) {
+               g_io_channel_unref(oDictClient->channel_);
+               oDictClient->channel_ = NULL;
+               on_error_.emit("Unable to set the channel as non-blocking: " +
+                              std::string(err->message));
+               g_error_free(err);
+               return;
+       }
+
+       if (!Socket::connect(oDictClient->sd_, ret, oDictClient->port_)) {
+               gchar *mes = g_strdup_printf("Can not connect to %s: %s\n",
+                                            oDictClient->host_.c_str(), Socket::get_error_msg().c_str());
+               on_error_.emit(mes);
+               g_free(mes);
+               return;
+       }
+
+       oDictClient->source_id_ = g_io_add_watch(oDictClient->channel_, GIOCondition(G_IO_IN | G_IO_ERR),
+                                  on_io_event, oDictClient);
+}
+
+void DictClient::disconnect()
+{
+       if (source_id_) {
+               g_source_remove(source_id_);
+               source_id_ = 0;
+       }
+
+       if (channel_) {
+               g_io_channel_shutdown(channel_, TRUE, NULL);
+               g_io_channel_unref(channel_);
+               channel_ = NULL;
+       }
+       if (sd_ != -1) {
+               Socket::close(sd_);
+               sd_ = -1;
+       }
+       is_connected_ = false;
+}
+
+gboolean DictClient::on_io_event(GIOChannel *ch, GIOCondition cond,
+                                gpointer user_data)
+{
+       DictClient *dict_client = static_cast<DictClient *>(user_data);
+
+       g_assert(dict_client);
+
+       if (!dict_client->channel_) {
+               g_warning("No channel available\n");
+               return FALSE;
+       }
+
+       if (cond & G_IO_ERR) {
+               gchar *mes =
+                       g_strdup_printf("Connection failed to the dictionary server at %s:%d",
+                                       dict_client->host_.c_str(), dict_client->port_);
+               on_error_.emit(mes);
+               g_free(mes);
+               return FALSE;
+       }
+
+       GError *err = NULL;
+       gsize term, len;
+       gchar *line;
+       GIOStatus res;
+
+       for (;;) {
+               if (!dict_client->channel_)
+                       break;
+               res = g_io_channel_read_line(dict_client->channel_, &line,
+                                            &len, &term, &err);
+               if (res == G_IO_STATUS_ERROR) {
+                       if (err) {
+                               on_error_.emit("Error while reading reply from server: " +
+                                              std::string(err->message));
+                               g_error_free(err);
+                       }
+                       dict_client->disconnect();
+
+                       return FALSE;
+               }
+
+               if (!len)
+                       break;
+
+               //truncate the line terminator before parsing
+               line[term] = '\0';
+               int status_code = get_status_code(line);
+               bool res = dict_client->parse(line, status_code);
+               g_free(line);
+               if (!res) {
+                       dict_client->disconnect();
+                       return FALSE;
+               }
+       }
+
+       return TRUE;
+}
+
+bool DictClient::parse(gchar *line, int status_code)
+{
+       g_debug("get %s\n", line);
+
+       if (!cmd_.get()) {
+               if (status_code == STATUS_CONNECT)
+                       is_connected_ = true;
+               else if (status_code == STATUS_SERVER_DOWN ||
+                        status_code == STATUS_SHUTDOWN) {
+                       gchar *mes =
+                               g_strdup_printf("Unable to connect to the "
+                                               "dictionary server at '%s:%d'. "
+                                               "The server replied with code"
+                                               " %d (server down)",
+                                               host_.c_str(), port_,
+                                               status_code);
+                       on_error_.emit(mes);
+                       g_free(mes);
+                       return true;
+               } else {
+                       gchar *mes =
+                               g_strdup_printf("Unable to parse the dictionary"
+                                               " server reply: '%s'", line);
+                       on_error_.emit(mes);
+                       g_free(mes);
+                       return false;
+               }
+       }
+
+       bool success = false;
+
+       switch (status_code) {
+       case STATUS_BAD_PARAMETERS:
+       {
+               gchar *mes = g_strdup_printf("Bad parameters for command '%s'",
+                                            cmd_->query().c_str());
+               on_error_.emit(mes);
+               g_free(mes);
+               cmd_->state_ = DICT::Cmd::FINISH;
+               break;
+       }
+       case STATUS_BAD_COMMAND:
+       {
+               gchar *mes = g_strdup_printf("Bad command '%s'",
+                                            cmd_->query().c_str());
+               on_error_.emit(mes);
+               g_free(mes);
+               cmd_->state_ = DICT::Cmd::FINISH;
+               break;
+       }
+       default:
+               success = true;
+               break;
+       }
+
+       if (cmd_->state_ == DICT::Cmd::START) {
+               GError *err = NULL;
+               cmd_->send(channel_, err);
+               if (err) {
+                       on_error_.emit(err->message);
+                       g_error_free(err);
+                       return false;
+               }
+               return true;
+       }
+
+       if (status_code == STATUS_OK || cmd_->state_ == DICT::Cmd::FINISH ||
+           status_code == STATUS_NO_MATCH ||
+           status_code == STATUS_BAD_DATABASE ||
+           status_code == STATUS_BAD_STRATEGY ||
+           status_code == STATUS_NO_DATABASES_PRESENT ||
+           status_code == STATUS_NO_STRATEGIES_PRESENT) {
+               defmap_.clear();
+               const DICT::DefList& res = cmd_->result();
+               if (simple_lookup_) {
+                       IndexList ilist(res.size());
+                       for (size_t i = 0; i < res.size(); ++i) {
+                               ilist[i] = last_index_;
+                               defmap_.insert(std::make_pair(last_index_++, res[i]));
+                       }
+                       last_index_ = 0;
+                       cmd_.reset(0);
+                       disconnect();
+                       on_simple_lookup_end_.emit(ilist);
+               } else {
+                       StringList slist;
+                       for (size_t i = 0; i < res.size(); ++i)
+                               slist.push_back(res[i].word_);
+                       last_index_ = 0;
+                       cmd_.reset(0);
+                       disconnect();
+                       on_complex_lookup_end_.emit(slist);
+               }
+
+               return success;
+       }
+
+       if (!cmd_->parse(line, status_code))
+               return false;
+
+
+       return true;
+}
+
+/* retrieve the status code from the server response line */
+int DictClient::get_status_code(gchar *line)
+{
+  gint retval;
+
+  if (strlen (line) < 3)
+    return 0;
+
+  if (!g_unichar_isdigit (line[0]) ||
+      !g_unichar_isdigit (line[1]) ||
+      !g_unichar_isdigit (line[2]))
+    return 0;
+
+  gchar tmp = line[3];
+  line[3] = '\0';
+
+  retval = atoi(line);
+
+  line[3] = tmp;
+
+  return retval;
+}
+
+void DictClient::lookup_simple(const gchar *word)
+{
+       simple_lookup_ = true;
+
+       if (!word || !*word) {
+               on_simple_lookup_end_.emit(IndexList());
+               return;
+       }
+
+       if (!channel_ || !source_id_)
+                       return;
+    connect();
+
+       cmd_.reset(new DefineCmd("*", word));
+}
+
+void DictClient::lookup_with_rule(const gchar *word)
+{
+       simple_lookup_ = false;
+
+       if (!word || !*word) {
+               on_complex_lookup_end_.emit(StringList());
+               return;
+       }
+
+       if (!channel_ || !source_id_)
+                       return;
+    connect();
+
+       cmd_.reset(new RegexpCmd("*", word));
+}
+
+void DictClient::lookup_with_fuzzy(const gchar *word)
+{
+       simple_lookup_ = false;
+
+       if (!word || !*word) {
+               on_complex_lookup_end_.emit(StringList());
+               return;
+       }
+
+       if (!channel_ || !source_id_)
+                       return;
+    connect();
+
+       cmd_.reset(new LevCmd("*", word));
+}
+
+const gchar *DictClient::get_word(size_t index) const
+{
+       DefMap::const_iterator it = defmap_.find(index);
+
+       if (it == defmap_.end())
+               return NULL;
+       return it->second.word_.c_str();
+}
+
+const gchar *DictClient::get_word_data(size_t index) const
+{
+       DefMap::const_iterator it = defmap_.find(index);
+
+       if (it == defmap_.end())
+               return NULL;
+       return it->second.data_.c_str();
+}
+
diff --git a/src/lib/dict_client.hpp b/src/lib/dict_client.hpp
new file mode 100644 (file)
index 0000000..b82b36f
--- /dev/null
@@ -0,0 +1,77 @@
+#ifndef _DICT_CLINET_HPP_
+#define _DICT_CLINET_HPP_
+
+#include <glib.h>
+#include <string>
+#include <memory>
+#include <map>
+#include <vector>
+
+#include "sigc++/sigc++.h"
+
+namespace DICT {
+       struct Definition {
+               std::string word_;
+               std::string data_;
+
+               Definition(const gchar *word): word_(word) {}
+       };
+       typedef std::vector<Definition> DefList;
+
+       class Cmd {
+       public:
+               enum State {
+                       START, DATA, FINISH
+               } state_;
+
+               Cmd() : state_(START) {}
+               virtual ~Cmd() {}
+               virtual const std::string& query() { return query_; }
+               virtual bool parse(gchar *str, int code) = 0;
+
+               void send(GIOChannel *channel, GError *&err);
+               const DefList& result() const { return reslist_; }
+       protected:
+               std::string query_;
+               DefList reslist_;
+       };
+};
+
+class DictClient {
+public:
+       typedef std::vector<size_t> IndexList;
+       typedef std::list<std::string> StringList;
+
+       static sigc::signal<void, const std::string&> on_error_;
+       static sigc::signal<void, const IndexList&> on_simple_lookup_end_;
+       static sigc::signal<void, const StringList&> on_complex_lookup_end_;
+
+       DictClient(const char *host, int port = 2628);
+       ~DictClient();
+       void lookup_simple(const gchar *word);
+       void lookup_with_rule(const gchar *word);
+       void lookup_with_fuzzy(const gchar *word);
+       const gchar *get_word(size_t index) const;
+       const gchar *get_word_data(size_t index) const;
+private:
+       int sd_;
+       GIOChannel *channel_;
+       guint source_id_;
+       std::string host_;
+       int port_;
+       bool is_connected_;
+       std::auto_ptr<DICT::Cmd> cmd_;
+       typedef std::map<size_t, DICT::Definition> DefMap;
+       DefMap defmap_;
+       size_t last_index_;
+       bool simple_lookup_;
+
+       void disconnect();
+       static gboolean on_io_event(GIOChannel *, GIOCondition, gpointer);
+       static int get_status_code(gchar *line);
+       void connect();
+    static void on_resolved(gpointer data, struct hostent *ret);
+       bool parse(gchar *line, int status_code);
+};
+
+#endif//!_DICT_CLINET_HPP_
diff --git a/src/lib/dictmask.h b/src/lib/dictmask.h
new file mode 100644 (file)
index 0000000..6af6617
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef _STARDICT_DICTMASK_H_
+#define _STARDICT_DICTMASK_H_
+
+enum InstantDictType {
+       InstantDictType_UNKNOWN = 0,
+       InstantDictType_LOCAL,
+       InstantDictType_VIRTUAL,
+       InstantDictType_NET,
+};
+
+struct InstantDictIndex {
+       InstantDictType type;
+       size_t index;
+};
+
+#endif
diff --git a/src/lib/dictziplib.cpp b/src/lib/dictziplib.cpp
new file mode 100644 (file)
index 0000000..29a6e3a
--- /dev/null
@@ -0,0 +1,500 @@
+/* dictziplib.c --
+ * http://stardict.sourceforge.net
+ * Copyright (C) 2003-2003 Hu Zheng <huzheng_001@163.com>
+ * This file is a modify version of dictd-1.9.7's data.c
+ *
+ * data.c -- 
+ * Created: Tue Jul 16 12:45:41 1996 by faith@dict.org
+ * Revised: Sat Mar 30 10:46:06 2002 by faith@dict.org
+ * Copyright 1996, 1997, 1998, 2000, 2002 Rickard E. Faith (faith@dict.org)
+ * 
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+//#define HAVE_MMAP //it will defined in config.h. this can be done by configure.in with a AC_FUNC_MMAP.
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <cassert>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#ifdef _WIN32
+#  include <io.h>
+#else
+#  include <unistd.h>
+#endif
+#include <limits.h>
+#include <fcntl.h>
+
+#include <sys/stat.h>
+
+
+#include "dictziplib.hpp"
+
+#define USE_CACHE 1
+
+#define BUFFERSIZE 10240
+
+/* 
+ * Output buffer must be greater than or
+ * equal to 110% of input buffer size, plus
+ * 12 bytes. 
+*/
+#define OUT_BUFFER_SIZE 0xffffL
+
+#define IN_BUFFER_SIZE ((unsigned long)((double)(OUT_BUFFER_SIZE - 12) * 0.89))
+
+/* For gzip-compatible header, as defined in RFC 1952 */
+
+                               /* Magic for GZIP (rfc1952)                */
+#define GZ_MAGIC1     0x1f     /* First magic byte                        */
+#define GZ_MAGIC2     0x8b     /* Second magic byte                       */
+
+                               /* FLaGs (bitmapped), from rfc1952         */
+#define GZ_FTEXT      0x01     /* Set for ASCII text                      */
+#define GZ_FHCRC      0x02     /* Header CRC16                            */
+#define GZ_FEXTRA     0x04     /* Optional field (random access index)    */
+#define GZ_FNAME      0x08     /* Original name                           */
+#define GZ_COMMENT    0x10     /* Zero-terminated, human-readable comment */
+#define GZ_MAX           2     /* Maximum compression                     */
+#define GZ_FAST          4     /* Fasted compression                      */
+
+                               /* These are from rfc1952                  */
+#define GZ_OS_FAT        0     /* FAT filesystem (MS-DOS, OS/2, NT/Win32) */
+#define GZ_OS_AMIGA      1     /* Amiga                                   */
+#define GZ_OS_VMS        2     /* VMS (or OpenVMS)                        */
+#define GZ_OS_UNIX       3      /* Unix                                    */
+#define GZ_OS_VMCMS      4      /* VM/CMS                                  */
+#define GZ_OS_ATARI      5      /* Atari TOS                               */
+#define GZ_OS_HPFS       6      /* HPFS filesystem (OS/2, NT)              */
+#define GZ_OS_MAC        7      /* Macintosh                               */
+#define GZ_OS_Z          8      /* Z-System                                */
+#define GZ_OS_CPM        9      /* CP/M                                    */
+#define GZ_OS_TOPS20    10      /* TOPS-20                                 */
+#define GZ_OS_NTFS      11      /* NTFS filesystem (NT)                    */
+#define GZ_OS_QDOS      12      /* QDOS                                    */
+#define GZ_OS_ACORN     13      /* Acorn RISCOS                            */
+#define GZ_OS_UNKNOWN  255      /* unknown                                 */
+
+#define GZ_RND_S1       'R'    /* First magic for random access format    */
+#define GZ_RND_S2       'A'    /* Second magic for random access format   */
+
+#define GZ_ID1           0     /* GZ_MAGIC1                               */
+#define GZ_ID2           1     /* GZ_MAGIC2                               */
+#define GZ_CM            2     /* Compression Method (Z_DEFALTED)         */
+#define GZ_FLG          3      /* FLaGs (see above)                       */
+#define GZ_MTIME         4     /* Modification TIME                       */
+#define GZ_XFL           8     /* eXtra FLags (GZ_MAX or GZ_FAST)         */
+#define GZ_OS            9     /* Operating System                        */
+#define GZ_XLEN         10     /* eXtra LENgth (16bit)                    */
+#define GZ_FEXTRA_START 12     /* Start of extra fields                   */
+#define GZ_SI1          12     /* Subfield ID1                            */
+#define GZ_SI2          13      /* Subfield ID2                            */
+#define GZ_SUBLEN       14     /* Subfield length (16bit)                 */
+#define GZ_VERSION      16      /* Version for subfield format             */
+#define GZ_CHUNKLEN     18     /* Chunk length (16bit)                    */
+#define GZ_CHUNKCNT     20     /* Number of chunks (16bit)                */
+#define GZ_RNDDATA      22     /* Random access data (16bit)              */
+
+#define DICT_UNKNOWN    0
+#define DICT_TEXT       1
+#define DICT_GZIP       2
+#define DICT_DZIP       3
+
+
+int dictData::read_header(const std::string &fname, int computeCRC)
+{
+       FILE          *str;
+       int           id1, id2, si1, si2;
+       char          buffer[BUFFERSIZE];
+       int           extraLength, subLength;
+       int           i;
+       char          *pt;
+       int           c;
+       struct stat   sb;
+       unsigned long crc   = crc32( 0L, Z_NULL, 0 );
+       int           count;
+       unsigned long offset;
+       
+       if (!(str = fopen(fname.c_str(), "rb"))) {
+               //err_fatal_errno( __FUNCTION__,
+               //       "Cannot open data file \"%s\" for read\n", filename );
+       }       
+
+       this->headerLength = GZ_XLEN - 1;
+       this->type         = DICT_UNKNOWN;
+   
+       id1                  = getc( str );
+       id2                  = getc( str );
+       
+       if (id1 != GZ_MAGIC1 || id2 != GZ_MAGIC2) {
+               this->type = DICT_TEXT;
+#if defined(_MSC_VER)
+               fstat( _fileno( str ), &sb );
+#else
+               fstat( fileno( str ), &sb );
+#endif
+               this->compressedLength = this->length = sb.st_size;
+               this->origFilename     = fname;
+               this->mtime            = sb.st_mtime;
+               if (computeCRC) {
+                       rewind( str );
+                       while (!feof( str )) {
+                               if ((count = fread( buffer, 1, BUFFERSIZE, str ))) {
+                                       crc = crc32(crc, (Bytef *)buffer, count);
+                               }
+                       }
+               }
+               this->crc = crc;
+               fclose( str );
+               return 0;
+       }
+       this->type = DICT_GZIP;
+  
+       this->method       = getc( str );
+       this->flags        = getc( str );
+       this->mtime        = getc( str ) <<  0;
+       this->mtime       |= getc( str ) <<  8;
+       this->mtime       |= getc( str ) << 16;
+       this->mtime       |= getc( str ) << 24;
+       this->extraFlags   = getc( str );
+       this->os           = getc( str );
+  
+       if (this->flags & GZ_FEXTRA) {
+               extraLength          = getc( str ) << 0;
+               extraLength         |= getc( str ) << 8;
+               this->headerLength += extraLength + 2;
+               si1                  = getc( str );
+               si2                  = getc( str );
+    
+               if (si1 == GZ_RND_S1 || si2 == GZ_RND_S2) {
+                       subLength            = getc( str ) << 0;
+                       subLength           |= getc( str ) << 8;
+                       this->version      = getc( str ) << 0;
+                       this->version     |= getc( str ) << 8;
+                       
+                       if (this->version != 1) {
+                               //err_internal( __FUNCTION__,
+                               //        "dzip header version %d not supported\n",
+                               //        this->version );
+                       }
+                       
+                       this->chunkLength  = getc( str ) << 0;
+                       this->chunkLength |= getc( str ) << 8;
+                       this->chunkCount   = getc( str ) << 0;
+                       this->chunkCount  |= getc( str ) << 8;
+                       
+                       if (this->chunkCount <= 0) {
+                               fclose( str );
+                               return 5;
+                       }
+                       this->chunks = (int *)malloc(sizeof( this->chunks[0] )
+                                                                                                                                                * this->chunkCount );
+                       for (i = 0; i < this->chunkCount; i++) {
+                               this->chunks[i]  = getc( str ) << 0;
+                               this->chunks[i] |= getc( str ) << 8;
+                       }
+                       this->type = DICT_DZIP;
+               } else {
+                       fseek( str, this->headerLength, SEEK_SET );
+               }
+       }
+       
+       if (this->flags & GZ_FNAME) { /* FIXME! Add checking against header len */
+               pt = buffer;
+               while ((c = getc( str )) && c != EOF)
+                       *pt++ = c;
+               *pt = '\0';
+               
+               this->origFilename = buffer;
+               this->headerLength += this->origFilename.length() + 1;
+       } else {
+               this->origFilename = "";
+       }
+   
+   if (this->flags & GZ_COMMENT) { /* FIXME! Add checking for header len */
+      pt = buffer;
+      while ((c = getc( str )) && c != EOF)
+        *pt++ = c;
+      *pt = '\0';
+      comment = buffer;
+      headerLength += comment.length()+1;
+   } else {
+      comment = "";
+   }
+
+   if (this->flags & GZ_FHCRC) {
+      getc( str );
+      getc( str );
+      this->headerLength += 2;
+   }
+
+   if (ftell( str ) != this->headerLength + 1) {
+      //err_internal( __FUNCTION__,
+               //    "File position (%lu) != header length + 1 (%d)\n",
+                 //  ftell( str ), this->headerLength + 1 );
+   }
+
+   fseek( str, -8, SEEK_END );
+   this->crc     = getc( str ) <<  0;
+   this->crc    |= getc( str ) <<  8;
+   this->crc    |= getc( str ) << 16;
+   this->crc    |= getc( str ) << 24;
+   this->length  = getc( str ) <<  0;
+   this->length |= getc( str ) <<  8;
+   this->length |= getc( str ) << 16;
+   this->length |= getc( str ) << 24;
+   this->compressedLength = ftell( str );
+
+                               /* Compute offsets */
+   this->offsets = (unsigned long *)malloc( sizeof( this->offsets[0] )
+                                                                                                                                                                                       * this->chunkCount );
+   for (offset = this->headerLength + 1, i = 0;
+       i < this->chunkCount;
+       i++) {
+      this->offsets[i] = offset;
+      offset += this->chunks[i];
+   }
+
+   fclose( str );
+   return 0;
+}
+
+bool dictData::open(const std::string& fname, int computeCRC)
+{
+       struct stat sb;
+       int         j;
+       int fd;
+
+       this->initialized = 0;
+       if (!g_file_test(fname.c_str(),
+               GFileTest(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))) {      
+               //err_warning( __FUNCTION__,
+               //   "%s is not a regular file -- ignoring\n", fname );
+               return false;
+       }
+   
+       if (read_header(fname, computeCRC)) {
+               //err_fatal( __FUNCTION__,
+               // "\"%s\" not in text or dzip format\n", fname );
+               return false;
+       }
+
+#if defined(_MSC_VER)
+       if ((fd = ::_open(fname.c_str(), O_RDONLY )) < 0) {
+#else
+       if ((fd = ::open(fname.c_str(), O_RDONLY )) < 0) {
+#endif
+               //err_fatal_errno( __FUNCTION__,
+               //       "Cannot open data file \"%s\"\n", fname );
+               return false;
+   }
+   if (fstat(fd, &sb)) {
+                //err_fatal_errno( __FUNCTION__,
+                //       "Cannot stat data file \"%s\"\n", fname );
+                return false;
+   }
+
+   this->size = sb.st_size;
+#if defined(_MSC_VER)
+       ::_close(fd);
+#else
+       ::close(fd);
+#endif
+        if (!mapfile.open(fname.c_str(), size))
+                return false;          
+
+        this->start=mapfile.begin();
+   this->end = this->start + this->size;
+
+   for (j = 0; j < DICT_CACHE_SIZE; j++) {
+                cache[j].chunk    = -1;
+                cache[j].stamp    = -1;
+                cache[j].inBuffer = NULL;
+                cache[j].count    = 0;
+   }
+   
+   return true;
+}
+
+void dictData::close()
+{
+       int i;   
+       
+       if (this->chunks)
+               free(this->chunks);
+       if (this->offsets)
+               free(this->offsets);
+
+       if (this->initialized) {
+               if (inflateEnd( &this->zStream )) {
+                       //err_internal( __FUNCTION__,
+                       //       "Cannot shut down inflation engine: %s\n",
+                 //     this->zStream.msg );
+         }
+       }
+
+       for (i = 0; i < DICT_CACHE_SIZE; ++i){
+               if (this -> cache [i].inBuffer)
+                       free (this -> cache [i].inBuffer);
+       }
+}
+
+void dictData::read(char *buffer, unsigned long start, unsigned long size)
+{
+       char          *pt;
+       unsigned long end;
+       int           count;
+       char          *inBuffer;
+       char          outBuffer[OUT_BUFFER_SIZE];
+       int           firstChunk, lastChunk;
+       int           firstOffset, lastOffset;
+       int           i, j;
+       int           found, target, lastStamp;
+       static int    stamp = 0;
+       
+       end  = start + size;
+       
+       //buffer = malloc( size + 1 );
+  
+       //PRINTF(DBG_UNZIP,
+       // ("dict_data_read( %p, %lu, %lu )\n",
+       //h, start, size ));
+       
+  
+       switch (this->type) {
+       case DICT_GZIP:
+               //err_fatal( __FUNCTION__,
+               // "Cannot seek on pure gzip format files.\n"
+               // "Use plain text (for performance)"
+               // " or dzip format (for space savings).\n" );
+               break;
+       case DICT_TEXT:
+               memcpy( buffer, this->start + start, size );
+               //buffer[size] = '\0';
+               break;
+       case DICT_DZIP:
+               if (!this->initialized) {
+                       ++this->initialized;
+                       this->zStream.zalloc    = NULL;
+                       this->zStream.zfree     = NULL;
+                       this->zStream.opaque    = NULL;
+                       this->zStream.next_in   = 0;
+                       this->zStream.avail_in  = 0;
+                       this->zStream.next_out  = NULL;
+                       this->zStream.avail_out = 0;
+                       if (inflateInit2( &this->zStream, -15 ) != Z_OK) {
+                               //err_internal( __FUNCTION__,
+                               //  "Cannot initialize inflation engine: %s\n",
+                         //this->zStream.msg );
+                       }
+               }
+               firstChunk  = start / this->chunkLength;
+               firstOffset = start - firstChunk * this->chunkLength;
+               lastChunk   = end / this->chunkLength;
+               lastOffset  = end - lastChunk * this->chunkLength;
+               //PRINTF(DBG_UNZIP,
+               // ("   start = %lu, end = %lu\n"
+               //"firstChunk = %d, firstOffset = %d,"
+               //" lastChunk = %d, lastOffset = %d\n",
+               //start, end, firstChunk, firstOffset, lastChunk, lastOffset ));
+               for (pt = buffer, i = firstChunk; i <= lastChunk; i++) {
+                       
+                       /* Access cache */
+                       found  = 0;
+                       target = 0;
+                       lastStamp = INT_MAX;
+                       for (j = 0; j < DICT_CACHE_SIZE; j++) {
+#if USE_CACHE
+                               if (this->cache[j].chunk == i) {
+                                       found  = 1;
+                                       target = j;
+                                       break;
+                               }
+#endif
+                               if (this->cache[j].stamp < lastStamp) {
+                                       lastStamp = this->cache[j].stamp;
+                                       target = j;
+                               }
+                       }
+                       
+                       this->cache[target].stamp = ++stamp;
+                       if (found) {
+                               count = this->cache[target].count;
+                               inBuffer = this->cache[target].inBuffer;
+                       } else {
+                               this->cache[target].chunk = i;
+                               if (!this->cache[target].inBuffer)
+                                       this->cache[target].inBuffer = (char *)malloc( IN_BUFFER_SIZE );
+                               inBuffer = this->cache[target].inBuffer;
+                               
+                               if (this->chunks[i] >= OUT_BUFFER_SIZE ) {
+                                       //err_internal( __FUNCTION__,
+                                       //    "this->chunks[%d] = %d >= %ld (OUT_BUFFER_SIZE)\n",
+                                       //  i, this->chunks[i], OUT_BUFFER_SIZE );
+                               }
+                               memcpy( outBuffer, this->start + this->offsets[i], this->chunks[i] );
+                               
+                               this->zStream.next_in   = (Bytef *)outBuffer;
+                               this->zStream.avail_in  = this->chunks[i];
+                               this->zStream.next_out  = (Bytef *)inBuffer;
+                               this->zStream.avail_out = IN_BUFFER_SIZE;
+                               if (inflate( &this->zStream,  Z_PARTIAL_FLUSH ) != Z_OK) {
+                                       //err_fatal( __FUNCTION__, "inflate: %s\n", this->zStream.msg );
+                               }
+                               if (this->zStream.avail_in) {
+                                       //err_internal( __FUNCTION__,
+                                       //    "inflate did not flush (%d pending, %d avail)\n",
+                                       //  this->zStream.avail_in, this->zStream.avail_out );
+                               }
+                               
+                               count = IN_BUFFER_SIZE - this->zStream.avail_out;
+                               
+                               this->cache[target].count = count;
+                       }
+                       
+                       if (i == firstChunk) {
+                               if (i == lastChunk) {
+                                       memcpy( pt, inBuffer + firstOffset, lastOffset-firstOffset);
+                                       pt += lastOffset - firstOffset;
+                               } else {
+                                       if (count != this->chunkLength ) {
+                                               //err_internal( __FUNCTION__,
+                                               //      "Length = %d instead of %d\n",
+                                               //count, this->chunkLength );
+                                       }
+                                       memcpy( pt, inBuffer + firstOffset,
+                                                                       this->chunkLength - firstOffset );
+                                       pt += this->chunkLength - firstOffset;
+                               }
+                       } else if (i == lastChunk) {
+                               memcpy( pt, inBuffer, lastOffset );
+                               pt += lastOffset;
+                       } else {
+                               assert( count == this->chunkLength );
+                               memcpy( pt, inBuffer, this->chunkLength );
+                               pt += this->chunkLength;
+                       }
+               }
+               //*pt = '\0';
+               break;
+       case DICT_UNKNOWN:
+               //err_fatal( __FUNCTION__, "Cannot read unknown file type\n" );
+               break;
+       }
+}
diff --git a/src/lib/dictziplib.hpp b/src/lib/dictziplib.hpp
new file mode 100644 (file)
index 0000000..172912d
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef __DICT_ZIP_LIB_H__
+#define __DICT_ZIP_LIB_H__
+
+#include <ctime>
+#include <string>
+#include <zlib.h>
+
+#include "mapfile.hpp"
+
+
+#define DICT_CACHE_SIZE 5
+
+struct dictCache {
+       int           chunk;
+       char          *inBuffer;
+       int           stamp;
+       int           count;
+};
+
+struct dictData {
+       dictData() {}
+       bool open(const std::string& filename, int computeCRC);
+       void close();
+       void read(char *buffer, unsigned long start, unsigned long size);
+       ~dictData() { close(); }
+private:
+       const char    *start;   /* start of mmap'd area */
+       const char    *end;             /* end of mmap'd area */
+       unsigned long size;             /* size of mmap */
+       
+       int           type;
+       z_stream      zStream;
+       int           initialized;
+  
+       int           headerLength;
+       int           method;
+       int           flags;
+       time_t        mtime;
+       int           extraFlags;
+       int           os;
+       int           version;
+       int           chunkLength;
+       int           chunkCount;
+       int           *chunks;
+       unsigned long *offsets; /* Sum-scan of chunks. */
+       std::string    origFilename;
+       std::string    comment;
+       unsigned long crc;
+       unsigned long length;
+       unsigned long compressedLength;
+       dictCache     cache[DICT_CACHE_SIZE];
+       MapFile mapfile;
+
+       int read_header(const std::string &filename, int computeCRC);
+};
+
+#endif//!__DICT_ZIP_LIB_H__
diff --git a/src/lib/distance.cpp b/src/lib/distance.cpp
new file mode 100644 (file)
index 0000000..b764d7c
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+    writer : Opera Wang
+    E-Mail : wangvisual AT sohu DOT com
+    License: GPL
+*/
+
+/* filename: distance.cc */
+/*
+http://www.merriampark.com/ld.htm
+What is Levenshtein Distance?
+
+Levenshtein distance (LD) is a measure of the similarity between two strings, 
+which we will refer to as the source string (s) and the target string (t). 
+The distance is the number of deletions, insertions, or substitutions required
+ to transform s into t. For example,
+
+    * If s is "test" and t is "test", then LD(s,t) = 0, because no transformations are needed. 
+    The strings are already identical.
+    * If s is "test" and t is "tent", then LD(s,t) = 1, because one substitution
+     (change "s" to "n") is sufficient to transform s into t.
+
+The greater the Levenshtein distance, the more different the strings are.
+
+Levenshtein distance is named after the Russian scientist Vladimir Levenshtein,
+ who devised the algorithm in 1965. If you can't spell or pronounce Levenshtein,
+ the metric is also sometimes called edit distance.
+
+The Levenshtein distance algorithm has been used in:
+
+    * Spell checking
+    * Speech recognition
+    * DNA analysis
+    * Plagiarism detection 
+*/
+
+
+#include <stdlib.h>
+#include <string.h>
+//#include <stdio.h>
+
+#include "distance.h"
+
+#define OPTIMIZE_ED
+/*
+Cover transposition, in addition to deletion,
+insertion and substitution. This step is taken from:
+Berghel, Hal ; Roach, David : "An Extension of Ukkonen's 
+Enhanced Dynamic Programming ASM Algorithm"
+(http://www.acm.org/~hlb/publications/asm/asm.html)
+*/
+#define COVER_TRANSPOSITION
+
+/****************************************/
+/*Implementation of Levenshtein distance*/
+/****************************************/
+
+EditDistance::EditDistance()
+{
+    currentelements = 2500; // It's enough for most conditions :-)
+    d = (int*)malloc(sizeof(int)*currentelements);
+}
+
+EditDistance::~EditDistance()
+{
+//    printf("size:%d\n",currentelements);
+    if (d) free(d);
+}
+
+#ifdef OPTIMIZE_ED
+int EditDistance::CalEditDistance(const gunichar *s,const gunichar *t,const int limit)
+/*Compute levenshtein distance between s and t, this is using QUICK algorithm*/
+{
+    int n=0,m=0,iLenDif,k,i,j,cost;
+    // Remove leftmost matching portion of strings
+    while ( *s && (*s==*t) )
+    {
+        s++;
+               t++;
+    }
+
+       while (s[n])
+       {
+               n++;
+       }
+       while (t[m])
+       {
+               m++;
+       }
+       
+    // Remove rightmost matching portion of strings by decrement n and m.
+    while ( n && m && (*(s+n-1)==*(t+m-1)) )
+    {
+        n--;m--;
+    }
+    if ( m==0 || n==0 || d==(int*)0 )
+        return (m+n);
+    if ( m < n )
+    {
+        const gunichar * temp = s;
+        int itemp = n;
+        s = t;
+        t = temp;
+        n = m;
+        m = itemp;
+    }
+    iLenDif = m - n;
+    if ( iLenDif >= limit )
+        return iLenDif;
+    // step 1
+    n++;m++;
+//    d=(int*)malloc(sizeof(int)*m*n);
+    if ( m*n > currentelements )
+    {
+        currentelements = m*n*2;    // double the request
+        d = (int*)realloc(d,sizeof(int)*currentelements);
+        if ( (int*)0 == d )
+            return (m+n);
+    }
+    // step 2, init matrix
+    for (k=0;k<n;k++)
+        d[k] = k;
+    for (k=1;k<m;k++)
+        d[k*n] = k;
+    // step 3
+    for (i=1;i<n;i++)
+    {
+        // first calculate column, d(i,j)
+        for ( j=1;j<iLenDif+i;j++ )
+        {
+            cost = s[i-1]==t[j-1]?0:1;
+            d[j*n+i] = minimum(d[(j-1)*n+i]+1,d[j*n+i-1]+1,d[(j-1)*n+i-1]+cost);
+#ifdef COVER_TRANSPOSITION
+            if ( i>=2 && j>=2 && (d[j*n+i]-d[(j-2)*n+i-2]==2)
+                 && (s[i-2]==t[j-1]) && (s[i-1]==t[j-2]) )
+                d[j*n+i]--;
+#endif
+        }
+        // second calculate row, d(k,j)
+        // now j==iLenDif+i;
+        for ( k=1;k<=i;k++ )
+        {
+            cost = s[k-1]==t[j-1]?0:1;
+            d[j*n+k] = minimum(d[(j-1)*n+k]+1,d[j*n+k-1]+1,d[(j-1)*n+k-1]+cost);
+#ifdef COVER_TRANSPOSITION
+            if ( k>=2 && j>=2 && (d[j*n+k]-d[(j-2)*n+k-2]==2)
+                 && (s[k-2]==t[j-1]) && (s[k-1]==t[j-2]) )
+                d[j*n+k]--;
+#endif
+        }
+        // test if d(i,j) limit gets equal or exceed
+        if ( d[j*n+i] >= limit )
+        {
+            return d[j*n+i];
+        }
+    }
+    // d(n-1,m-1)
+    return d[n*m-1];
+}
+#else
+int EditDistance::CalEditDistance(const char *s,const char *t,const int limit)
+{
+    //Step 1
+    int k,i,j,n,m,cost;
+    n=strlen(s); 
+    m=strlen(t);
+    if( n!=0 && m!=0 && d!=(int*)0 )
+    {
+        m++;n++;
+        if ( m*n > currentelements )
+        {
+            currentelements = m*n*2;
+            d = (int*)realloc(d,sizeof(int)*currentelements);
+            if ( (int*)0 == d )
+                return (m+n);
+        }
+        //Step 2       
+        for(k=0;k<n;k++)
+            d[k]=k;
+        for(k=0;k<m;k++)
+            d[k*n]=k;
+        //Step 3 and 4 
+        for(i=1;i<n;i++)
+            for(j=1;j<m;j++)
+            {
+                //Step 5
+                if(s[i-1]==t[j-1])
+                    cost=0;
+                else
+                    cost=1;
+                //Step 6                        
+                d[j*n+i]=minimum(d[(j-1)*n+i]+1,d[j*n+i-1]+1,d[(j-1)*n+i-1]+cost);
+#ifdef COVER_TRANSPOSITION
+                if ( i>=2 && j>=2 && (d[j*n+i]-d[(j-2)*n+i-2]==2)
+                     && (s[i-2]==t[j-1]) && (s[i-1]==t[j-2]) )
+                    d[j*n+i]--;
+#endif        
+            }
+        return d[n*m-1];
+    }
+    else 
+        return (n+m);
+}
+#endif
diff --git a/src/lib/distance.h b/src/lib/distance.h
new file mode 100644 (file)
index 0000000..9a6f402
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef DISTANCE_H
+#define DISTANCE_H
+
+#include <glib.h>
+
+class EditDistance {
+private:
+    int *d;
+    int currentelements;
+    /*Gets the minimum of three values */
+    inline int minimum( const int a, const int b, const int c )
+    {
+        int min = a;
+        if ( b < min )
+              min = b;
+        if ( c < min )
+              min = c;
+          return min;
+    };
+public:
+    EditDistance(  );
+    ~EditDistance(  );
+    int CalEditDistance( const gunichar *s, const gunichar *t, const int limit );
+};
+
+#endif
diff --git a/src/lib/file.hpp b/src/lib/file.hpp
new file mode 100644 (file)
index 0000000..7da2644
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef _FILE_HPP_
+#define _FILE_HPP_
+
+#include <algorithm>
+#include <glib.h>
+#include <list>
+#include <string>
+
+
+typedef std::list<std::string> List;
+
+template<typename Function>
+void __for_each_file(const std::string& dirname, const std::string& suff,
+                        const List& order_list, const List& disable_list, 
+                        Function f)
+{
+       GDir *dir = g_dir_open(dirname.c_str(), 0, NULL);       
+       if (dir) {
+               const gchar *filename;          
+               while ((filename = g_dir_read_name(dir))!=NULL) {       
+                       std::string fullfilename(dirname+G_DIR_SEPARATOR_S+filename);
+                       if (g_file_test(fullfilename.c_str(), G_FILE_TEST_IS_DIR))
+                               __for_each_file(fullfilename, suff, order_list, disable_list, f);
+                       else if (g_str_has_suffix(filename, suff.c_str()) &&
+                                        std::find(order_list.begin(), order_list.end(), fullfilename)==order_list.end()) { 
+                                bool disable=std::find(disable_list.begin(), disable_list.end(), fullfilename)!=disable_list.end();
+                                f(fullfilename, disable);
+                       }
+               }
+               g_dir_close(dir);
+       }
+}
+
+template<typename Function>
+void for_each_file(const List& dirs_list, const std::string& suff,
+                        const List& order_list, const List& disable_list, 
+                        Function f)
+{
+       List::const_iterator it;
+       for (it=order_list.begin(); it!=order_list.end(); ++it) {
+               bool disable=std::find(disable_list.begin(), disable_list.end(), *it)!=disable_list.end();
+               f(*it, disable);
+       }
+       for (it=dirs_list.begin(); it!=dirs_list.end(); ++it)
+               __for_each_file(*it, suff, order_list, disable_list, f);                        
+}
+
+#endif//!_FILE_HPP_
diff --git a/src/lib/getuint32.h b/src/lib/getuint32.h
new file mode 100644 (file)
index 0000000..81fa4d1
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef _SD_GET_UINT32_H_
+#define _SD_GET_UINT32_H_
+
+#ifdef ARM
+static inline guint32 get_uint32(const gchar *addr)
+{
+       guint32 result;
+       memcpy(&result, addr, sizeof(guint32));
+       return result;
+}
+#else
+#define get_uint32(x) *reinterpret_cast<const guint32 *>(x)
+#endif
+
+#endif
diff --git a/src/lib/http_client.cpp b/src/lib/http_client.cpp
new file mode 100644 (file)
index 0000000..802a469
--- /dev/null
@@ -0,0 +1,212 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "http_client.h"
+#include "sockets.hpp"
+
+sigc::signal<void, HttpClient *, const char *> HttpClient::on_error_;
+sigc::signal<void, HttpClient *> HttpClient::on_response_;
+
+HttpClient::HttpClient()
+{
+       sd_ = -1;
+       channel_ = NULL;
+       in_source_id_ = 0;
+       out_source_id_ = 0;
+       buffer = NULL;
+       buffer_len = 0;
+       callback_func_ = NULL;
+}
+
+HttpClient::~HttpClient()
+{
+       disconnect();
+       g_free(buffer);
+}
+
+void HttpClient::disconnect()
+{
+       if (in_source_id_) {
+               g_source_remove(in_source_id_);
+               in_source_id_ = 0;
+       }
+       if (out_source_id_) {
+               g_source_remove(out_source_id_);
+               out_source_id_ = 0;
+       }
+       if (channel_) {
+               g_io_channel_shutdown(channel_, TRUE, NULL);
+               g_io_channel_unref(channel_);
+               channel_ = NULL;
+       }
+       if (sd_ != -1) {
+               Socket::close(sd_);
+               sd_ = -1;
+       }
+}
+
+void HttpClient::SendHttpGetRequest(const char* shost, const char* sfile, gpointer data)
+{
+       host_ = shost;
+       file_ = sfile;
+       userdata = data;
+       Socket::resolve(host_, this, on_resolved);
+}
+
+void HttpClient::SendHttpGetRequestWithCallback(const char* shost, const char* sfile, get_http_response_func_t callback_func, gpointer data)
+{
+       callback_func_ = callback_func;
+       SendHttpGetRequest(shost, sfile, data);
+}
+
+void HttpClient::on_resolved(gpointer data, bool resolved, in_addr_t sa)
+{
+       HttpClient *oHttpClient = (HttpClient *)data;
+       if (!resolved) {
+               gchar *mes = g_strdup_printf("Can not resolve %s: %s\n",
+                       oHttpClient->host_.c_str(), Socket::get_error_msg().c_str());
+               on_error_.emit(oHttpClient, mes);
+               g_free(mes);
+               return;
+       }
+
+       oHttpClient->sd_ = Socket::socket();
+       if (oHttpClient->sd_ == -1) {
+               std::string str = "Can not create socket: " + Socket::get_error_msg();
+               on_error_.emit(oHttpClient, str.c_str());
+               return;
+       }
+       Socket::connect(oHttpClient->sd_, sa, 80, oHttpClient, on_connected);
+}
+
+void HttpClient::on_connected(gpointer data, bool succeeded)
+{
+       HttpClient *oHttpClient = (HttpClient *)data;
+       if (!succeeded) {
+               gchar *mes = g_strdup_printf("Can not connect to %s: %s\n",
+                       oHttpClient->host_.c_str(), Socket::get_error_msg().c_str());
+               on_error_.emit(oHttpClient, mes);
+               g_free(mes);
+               return;
+       }
+#ifdef _WIN32
+       oHttpClient->channel_ = g_io_channel_win32_new_socket(oHttpClient->sd_);
+#else
+       oHttpClient->channel_ = g_io_channel_unix_new(oHttpClient->sd_);
+#endif
+       g_io_channel_set_encoding(oHttpClient->channel_, NULL, NULL);
+       /* make sure that the channel is non-blocking */
+       int flags = g_io_channel_get_flags(oHttpClient->channel_);
+       flags |= G_IO_FLAG_NONBLOCK;
+       GError *err = NULL;
+       g_io_channel_set_flags(oHttpClient->channel_, GIOFlags(flags), &err);
+       if (err) {
+               gchar *str = g_strdup_printf("Unable to set the channel as non-blocking: %s", err->message);
+               on_error_.emit(oHttpClient, str);
+               g_free(str);
+               g_error_free(err);
+               return;
+       }
+       if (oHttpClient->SendGetRequest())
+               return;
+       oHttpClient->out_source_id_ = g_io_add_watch(oHttpClient->channel_, GIOCondition(G_IO_OUT), on_io_out_event, oHttpClient);
+       oHttpClient->in_source_id_ = g_io_add_watch(oHttpClient->channel_, GIOCondition(G_IO_IN | G_IO_ERR), on_io_in_event, oHttpClient);
+}
+
+void HttpClient::write_str(const char *str, GError **err)
+{
+       int len = strlen(str);
+       int left_byte = len;
+       GIOStatus res;
+       gsize bytes_written;
+       while (left_byte) {
+               res = g_io_channel_write_chars(channel_, str+(len - left_byte), left_byte, &bytes_written, err);
+               if (res == G_IO_STATUS_ERROR) {
+                       return;
+               }
+               left_byte -= bytes_written;
+       }
+       res = g_io_channel_flush(channel_, err);
+}
+
+bool HttpClient::SendGetRequest()
+{
+       std::string request;
+
+       request += "GET HTTP://";
+       request += host_;
+       request += file_;
+       request += " HTTP/1.1\r\n";
+
+       request += "User-Agent: Mozilla/4.0(compatible;MSIE 5.00;Windows 98)\r\n";
+       request += "Accept: */*\r\n";
+
+       request += "Host: ";
+       request += host_;
+       request += "\r\n";
+
+       request += "Connection: close\r\n\r\n";
+       
+       GError *err = NULL;
+       write_str(request.c_str(), &err);
+       if (err) {
+               on_error_.emit(this, err->message);
+               g_error_free(err);
+               return true;
+       }
+       return false;
+}
+
+gboolean HttpClient::on_io_out_event(GIOChannel *ch, GIOCondition cond, gpointer user_data)
+{
+       HttpClient *http_client = static_cast<HttpClient *>(user_data);
+       GError *err = NULL;
+       GIOStatus res = g_io_channel_flush(http_client->channel_, &err);
+       if (res == G_IO_STATUS_AGAIN) {
+               return TRUE;
+       } else if (err) {
+               on_error_.emit(http_client, err->message);
+               g_error_free(err);
+       }
+       return FALSE;
+}
+
+gboolean HttpClient::on_io_in_event(GIOChannel *ch, GIOCondition cond, gpointer user_data)
+{
+       HttpClient *http_client = static_cast<HttpClient *>(user_data);
+       if (cond & G_IO_ERR) {
+               on_error_.emit(http_client, "Http client error!");
+               return FALSE;
+       }
+       if (cond & G_IO_STATUS_EOF) {
+               on_response_.emit(http_client);
+               return FALSE;
+       }
+       GIOStatus res;
+       gchar *str_return = NULL;
+       gsize length;
+       GError *err = NULL;
+
+       res = g_io_channel_read_to_end(http_client->channel_, &str_return, &length, &err);
+       if (err) {
+               gchar *str = g_strdup_printf("Error while reading reply from server: %s", err->message);
+               on_error_.emit(http_client, str);
+               g_free(str);
+               g_error_free(err);
+               return FALSE;
+       }
+       if (str_return) {
+               http_client->buffer = (char *)g_realloc(http_client->buffer, http_client->buffer_len + length);
+               memcpy(http_client->buffer+http_client->buffer_len, str_return, length);
+               http_client->buffer_len += length;
+               g_free(str_return);
+       }
+       if (res == G_IO_STATUS_NORMAL) {
+               http_client->buffer = (char *)g_realloc(http_client->buffer, http_client->buffer_len + 1);
+               http_client->buffer[http_client->buffer_len] = '\0'; // So the text is end by a extra '\0'.
+               on_response_.emit(http_client);
+               return FALSE;
+       }
+       return TRUE;
+}
diff --git a/src/lib/http_client.h b/src/lib/http_client.h
new file mode 100644 (file)
index 0000000..dd4f4bb
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef _STARDICT_HTTP_CLIENT_H_
+#define _STARDICT_HTTP_CLIENT_H_
+
+#include <glib.h>
+#include "sigc++/sigc++.h"
+#include <string>
+#include <vector>
+
+#ifndef _WIN32
+#  include <netdb.h>
+#else
+typedef unsigned long in_addr_t;
+#endif
+
+
+typedef void (*get_http_response_func_t)(char *buffer, size_t buffer_len, gpointer userdata);
+
+class HttpClient {
+public:
+       static sigc::signal<void, HttpClient*, const char *> on_error_;
+       static sigc::signal<void, HttpClient *> on_response_;
+
+       HttpClient();
+       ~HttpClient();
+       void SendHttpGetRequest(const char* shost, const char* sfile, gpointer data);
+       void SendHttpGetRequestWithCallback(const char* shost, const char* sfile, get_http_response_func_t callback_func, gpointer data);
+       char *buffer;
+       size_t buffer_len;
+       gpointer userdata;
+       get_http_response_func_t callback_func_;
+private:
+       std::string host_;
+       std::string file_;
+       int sd_;
+       GIOChannel *channel_;
+       guint in_source_id_;
+       guint out_source_id_;
+       static void on_resolved(gpointer data, bool resolved, in_addr_t sa);
+       static void on_connected(gpointer data, bool succeeded);
+       static gboolean on_io_in_event(GIOChannel *, GIOCondition, gpointer);
+       static gboolean on_io_out_event(GIOChannel *, GIOCondition, gpointer);
+       void disconnect();
+       void write_str(const char *str, GError **err);
+       bool SendGetRequest();
+};
+
+#endif
diff --git a/src/lib/httpmanager.cpp b/src/lib/httpmanager.cpp
new file mode 100644 (file)
index 0000000..c2cd347
--- /dev/null
@@ -0,0 +1,32 @@
+#include "httpmanager.h"
+
+HttpManager::HttpManager()
+{
+}
+
+HttpManager::~HttpManager()
+{
+       for (std::list<HttpClient *>::iterator i = client_list.begin(); i != client_list.end(); ++i) {
+               delete *i;
+       }
+}
+
+void HttpManager::SendHttpGetRequest(const char* shost, const char* sfile, gpointer userdata)
+{
+       HttpClient *client = new HttpClient();
+       client_list.push_back(client);
+       client->SendHttpGetRequest(shost, sfile, userdata);
+}
+
+void HttpManager::SendHttpGetRequestWithCallback(const char* shost, const char* sfile, get_http_response_func_t callback_func, gpointer userdata)
+{
+       HttpClient *client = new HttpClient();
+       client_list.push_back(client);
+       client->SendHttpGetRequestWithCallback(shost, sfile, callback_func, userdata);
+}
+
+void HttpManager::Remove(HttpClient *http_client)
+{
+       client_list.remove(http_client);
+       delete http_client;
+}
diff --git a/src/lib/httpmanager.h b/src/lib/httpmanager.h
new file mode 100644 (file)
index 0000000..1fac6f4
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef _STARDICT_HTTP_MANAGER_H_
+#define _STARDICT_HTTP_MANAGER_H_
+
+#include "http_client.h"
+
+class HttpManager {
+public:
+       HttpManager();
+       ~HttpManager();
+       void SendHttpGetRequest(const char* shost, const char* sfile, gpointer userdata);
+       void SendHttpGetRequestWithCallback(const char* shost, const char* sfile, get_http_response_func_t callback_func, gpointer userdata);
+       void Remove(HttpClient *http_client);
+private:
+       std::list<HttpClient *> client_list;
+};
+
+#endif
diff --git a/src/lib/kmp.cpp b/src/lib/kmp.cpp
new file mode 100644 (file)
index 0000000..d22a61d
--- /dev/null
@@ -0,0 +1,63 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "kmp.h"
+
+static int* prefix = NULL;
+static int max_size = 0;
+
+static void GetPrefixValue(const char* strPattern, int iPatternLen)
+{
+    if (iPatternLen>max_size) {
+        prefix = (int*)realloc(prefix, iPatternLen*sizeof(int));
+        max_size = iPatternLen;
+    }
+   
+    int i, j; /* i runs through the string, j counts the hits*/
+    i = 1; j = 0;
+    prefix[0] = 0;
+   
+    while(i<iPatternLen)
+    {
+        if(strPattern[i] == strPattern[j])
+        {
+            prefix[i] = ++j;
+        }
+        else
+        {
+            j = 0;
+            prefix[i] = j;
+        }
+       
+        i++;
+    }
+}
+
+static int KMPStringMatch(const char* strPattern, int iPatternLen, const char* strTarget, int iTargetLen)
+{
+       int j =0;
+       int i;
+       for (i=0;i<iPatternLen;i++) {
+               while ((strPattern[i] != strTarget[j]) && (j > 0))
+                       j = prefix[j-1];
+               if (strPattern[i] == strTarget[j])
+                       j++;
+               if (j == iTargetLen)
+                       return i - j + 1;
+       }
+       return -1;
+}
+
+int KMP(const char* strPattern, int len, const char* strTarget)
+{
+       GetPrefixValue(strPattern, len);
+       return KMPStringMatch(strPattern, len, strTarget, strlen(strTarget));
+}
+
+void KMP_end()
+{
+       free(prefix);
+       prefix=NULL;
+       max_size=0;
+}
diff --git a/src/lib/kmp.h b/src/lib/kmp.h
new file mode 100644 (file)
index 0000000..1623635
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef _KMP_H_
+#define _KMP_H_
+
+extern int KMP(const char* strPattern, int len, const char* strTarget);
+extern void KMP_end();
+
+#endif
diff --git a/src/lib/lib.cpp b/src/lib/lib.cpp
new file mode 100644 (file)
index 0000000..1583655
--- /dev/null
@@ -0,0 +1,64 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "lib.h"
+
+query_t analyse_query(const char *s, std::string& res)
+{
+       if (!s || !*s) {
+               res="";
+               return qtSIMPLE;
+       }
+       if (*s=='/') {
+               res=s+1;
+               return qtFUZZY;
+       }
+       if (*s==':') {
+               res=s+1;
+               return qtREGEX;
+       }
+
+       if (*s=='|') {
+               res=s+1;
+               return qtDATA;
+       }
+
+       bool pattern=false;
+       const char *p=s;
+       res="";
+       for (; *p; res+=*p, ++p) {
+               if (*p=='\\') {
+                       ++p;
+                       if (!*p)
+                               break;
+                       continue;
+               }
+               if (*p=='*' || *p=='?')
+                       pattern=true;
+       }
+       if (pattern)
+               return qtPATTERN;
+
+       return qtSIMPLE;
+}
+
+void stardict_input_escape(const char *text, std::string &res)
+{
+       res.clear();
+       const char *p = text;
+       if (*p == '/' || *p == '|' || *p == ':') {
+               res = "\\";
+               res += *p;
+               p++;
+       }
+       while (*p) {
+               if (*p == '\\' || *p == '*' || *p == '?') {
+                       res += '\\';
+                       res += *p;
+               } else {
+                       res += *p;
+               }
+               p++;
+       }
+}
diff --git a/src/lib/lib.h b/src/lib/lib.h
new file mode 100644 (file)
index 0000000..2f72819
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef __SD_LIB_H__
+#define __SD_LIB_H__
+
+#include "stardict_libconfig.h"
+
+#include "common.hpp"
+#include "data.hpp"
+#include "stddict.hpp"
+
+#ifdef SD_CLIENT_CODE
+#include "treedict.hpp"
+#endif
+
+static inline gchar* stardict_datadup(gconstpointer mem)
+{
+        return (gchar *)g_memdup(mem, sizeof(guint32) + *reinterpret_cast<const guint32 *>(mem));
+}
+
+typedef enum {
+       qtSIMPLE, qtPATTERN, qtFUZZY, qtREGEX, qtDATA
+} query_t;
+       
+extern query_t analyse_query(const char *s, std::string& res); 
+extern void stardict_input_escape(const char *text, std::string &res);
+
+#endif//!__SD_LIB_H__
diff --git a/src/lib/m_ctype.h b/src/lib/m_ctype.h
new file mode 100644 (file)
index 0000000..ca8f397
--- /dev/null
@@ -0,0 +1,260 @@
+#ifndef _m_ctype_h
+#define _m_ctype_h
+
+namespace stardict_collation {
+
+#define my_wc_t ulong
+
+typedef struct unicase_info_st
+{
+  uint16 toupper;
+  uint16 tolower;
+  uint16 sort;
+} MY_UNICASE_INFO;
+
+extern MY_UNICASE_INFO *my_unicase_default[256];
+//extern MY_UNICASE_INFO *my_unicase_turkish[256];
+
+
+/* wm_wc and wc_mb return codes */
+#define MY_CS_ILSEQ     0     /* Wrong by sequence: wb_wc                   */
+#define MY_CS_ILUNI     0     /* Cannot encode Unicode to charset: wc_mb    */
+#define MY_CS_TOOSMALL  -101  /* Need at least one byte:    wc_mb and mb_wc */
+#define MY_CS_TOOSMALL2 -102  /* Need at least two bytes:   wc_mb and mb_wc */
+#define MY_CS_TOOSMALL3 -103  /* Need at least three bytes: wc_mb and mb_wc */
+/* A helper macros for "need at least n bytes" */
+#define MY_CS_TOOSMALLN(n)    (-100-(n))
+
+        /* My charsets_list flags */
+#define MY_CS_COMPILED  1      /* compiled-in sets               */
+#define MY_CS_CONFIG    2      /* sets that have a *.conf file   */
+#define MY_CS_INDEX     4      /* sets listed in the Index file  */
+#define MY_CS_LOADED    8      /* sets that are currently loaded */
+#define MY_CS_BINSORT   16     /* if binary sort order           */
+#define MY_CS_PRIMARY   32     /* if primary collation           */
+#define MY_CS_STRNXFRM  64     /* if strnxfrm is used for sort   */
+#define MY_CS_UNICODE   128    /* is a charset is full unicode   */
+#define MY_CS_READY     256    /* if a charset is initialized    */
+#define MY_CS_AVAILABLE 512    /* If either compiled-in or loaded*/
+#define MY_CS_CSSORT    1024   /* if case sensitive sort order   */
+#define MY_CS_HIDDEN    2048   /* don't display in SHOW          */
+#define MY_CHARSET_UNDEFINED 0
+
+
+/*typedef struct my_uni_idx_st
+{
+  uint16 from;
+  uint16 to;
+  uchar  *tab;
+} MY_UNI_IDX;
+
+typedef struct
+{
+  uint beg;
+  uint end;
+  uint mblen;
+} my_match_t;*/
+
+struct charset_info_st;
+
+typedef struct my_collation_handler_st
+{
+  my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
+  /* Collation routines */
+  int     (*strnncoll)(struct charset_info_st *,
+                      const uchar *, uint, const uchar *, uint, my_bool);
+  //int     (*strnncollsp)(struct charset_info_st *,
+                         //const uchar *, uint, const uchar *, uint,
+                         //my_bool diff_if_only_endspace_difference);
+  //int     (*strnxfrm)(struct charset_info_st *,
+                     //uchar *, uint, const uchar *, uint);
+  //uint    (*strnxfrmlen)(struct charset_info_st *, uint); 
+  //my_bool (*like_range)(struct charset_info_st *,
+                       //const char *s, uint s_length,
+                       //pchar w_prefix, pchar w_one, pchar w_many, 
+                       //uint res_length,
+                       //char *min_str, char *max_str,
+                       //uint *min_len, uint *max_len);
+  //int     (*wildcmp)(struct charset_info_st *,
+                    //const char *str,const char *str_end,
+                     //const char *wildstr,const char *wildend,
+                     //int escape,int w_one, int w_many);
+
+  //int  (*strcasecmp)(struct charset_info_st *, const char *, const char *);
+  
+  //uint (*instr)(struct charset_info_st *,
+                //const char *b, uint b_length,
+                //const char *s, uint s_length,
+                //my_match_t *match, uint nmatch);
+  
+  /* Hash calculation */
+  //void (*hash_sort)(struct charset_info_st *cs, const uchar *key, uint len,
+                   //ulong *nr1, ulong *nr2); 
+  //my_bool (*propagate)(struct charset_info_st *cs, const uchar *str, uint len);
+} MY_COLLATION_HANDLER;
+
+extern MY_COLLATION_HANDLER my_collation_mb_bin_handler;
+
+typedef struct my_charset_handler_st
+{
+  my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
+  /* Multibyte routines */
+  //int     (*ismbchar)(struct charset_info_st *, const char *, const char *);
+  //int     (*mbcharlen)(struct charset_info_st *, uint);
+  //uint    (*numchars)(struct charset_info_st *, const char *b, const char *e);
+  //uint    (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
+  //uint    (*well_formed_len)(struct charset_info_st *,
+                             //const char *b,const char *e,
+                             //uint nchars, int *error);
+  //uint    (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
+  //uint    (*numcells)(struct charset_info_st *, const char *b, const char *e);
+  
+  /* Unicode convertion */
+  int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc,
+              const unsigned char *s,const unsigned char *e);
+  //int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc,
+              //unsigned char *s,unsigned char *e);
+  
+  /* CTYPE scanner */
+  //int (*ctype)(struct charset_info_st *cs, int *ctype,
+  //             const unsigned char *s, const unsigned char *e);
+  
+  /* Functions for case and sort convertion */
+  //void    (*caseup_str)(struct charset_info_st *, char *);
+  //void    (*casedn_str)(struct charset_info_st *, char *);
+  //uint    (*caseup)(struct charset_info_st *, char *src, uint srclen,
+  //                                            char *dst, uint dstlen);
+  //uint    (*casedn)(struct charset_info_st *, char *src, uint srclen,
+  //                                            char *dst, uint dstlen);
+  
+  /* Charset dependant snprintf() */
+  //int  (*snprintf)(struct charset_info_st *, char *to, uint n, const char *fmt,
+                  //...);
+  //int  (*long10_to_str)(struct charset_info_st *, char *to, uint n, int radix,
+                       //long int val);
+  //int (*longlong10_to_str)(struct charset_info_st *, char *to, uint n,
+                          //int radix, longlong val);
+  
+  //void (*fill)(struct charset_info_st *, char *to, uint len, int fill);
+  
+  /* String-to-number convertion routines */
+  //long        (*strntol)(struct charset_info_st *, const char *s, uint l,
+                        //int base, char **e, int *err);
+  //ulong      (*strntoul)(struct charset_info_st *, const char *s, uint l,
+                        //int base, char **e, int *err);
+  //longlong   (*strntoll)(struct charset_info_st *, const char *s, uint l,
+                        //int base, char **e, int *err);
+  //ulonglong (*strntoull)(struct charset_info_st *, const char *s, uint l,
+                        //int base, char **e, int *err);
+  //double      (*strntod)(struct charset_info_st *, char *s, uint l, char **e,
+                        //int *err);
+  //longlong    (*strtoll10)(struct charset_info_st *cs,
+                           //const char *nptr, char **endptr, int *error);
+  //ulong        (*scan)(struct charset_info_st *, const char *b, const char *e,
+                      //int sq);
+} MY_CHARSET_HANDLER;
+
+typedef struct charset_info_st
+{
+  //uint      number;
+  //uint      primary_number;
+  //uint      binary_number;
+  //uint      state;
+  //const char *csname;
+  //const char *name;
+  //const char *comment;
+  const char *tailoring;
+  //uchar    *ctype;
+  //uchar    *to_lower;
+  //uchar    *to_upper;
+  uchar    *sort_order;
+  uint16   *contractions;
+  uint16   **sort_order_big;
+  //uint16      *tab_to_uni;
+  //MY_UNI_IDX  *tab_from_uni;
+  MY_UNICASE_INFO **caseinfo;
+  //uchar     *state_map;
+  //uchar     *ident_map;
+  //uint      strxfrm_multiply;
+  //uchar     caseup_multiply;
+  //uchar     casedn_multiply;
+  //uint      mbminlen;
+  //uint      mbmaxlen;
+  //uint16    min_sort_char;
+  //uint16    max_sort_char; /* For LIKE optimization */
+  //uchar     pad_char;
+  //my_bool   escape_with_backslash_is_dangerous;
+  
+  MY_CHARSET_HANDLER *cset;
+  MY_COLLATION_HANDLER *coll;
+  
+} CHARSET_INFO;
+
+extern CHARSET_INFO my_charset_utf8_general_ci;
+extern CHARSET_INFO my_charset_utf8_bin;
+
+extern CHARSET_INFO my_charset_utf8_general_uca_ci;
+extern CHARSET_INFO my_charset_utf8_icelandic_uca_ci;
+extern CHARSET_INFO my_charset_utf8_latvian_uca_ci;
+extern CHARSET_INFO my_charset_utf8_romanian_uca_ci;
+extern CHARSET_INFO my_charset_utf8_slovenian_uca_ci;
+extern CHARSET_INFO my_charset_utf8_polish_uca_ci;
+extern CHARSET_INFO my_charset_utf8_estonian_uca_ci;
+extern CHARSET_INFO my_charset_utf8_spanish_uca_ci;
+extern CHARSET_INFO my_charset_utf8_swedish_uca_ci;
+extern CHARSET_INFO my_charset_utf8_turkish_uca_ci;
+extern CHARSET_INFO my_charset_utf8_czech_uca_ci;
+extern CHARSET_INFO my_charset_utf8_danish_uca_ci;
+extern CHARSET_INFO my_charset_utf8_lithuanian_uca_ci;
+extern CHARSET_INFO my_charset_utf8_slovak_uca_ci;
+extern CHARSET_INFO my_charset_utf8_spanish2_uca_ci;
+extern CHARSET_INFO my_charset_utf8_roman_uca_ci;
+extern CHARSET_INFO my_charset_utf8_persian_uca_ci;
+extern CHARSET_INFO my_charset_utf8_esperanto_uca_ci;
+extern CHARSET_INFO my_charset_utf8_hungarian_uca_ci;
+
+
+/*void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill);
+my_bool  my_like_range_mb(CHARSET_INFO *cs,
+                         const char *ptr, uint ptr_length,
+                         pbool escape, pbool w_one, pbool w_many,
+                         uint res_length,
+                         char *min_str, char *max_str,
+                         uint *min_length, uint *max_length);
+uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
+uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
+uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
+uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e,
+                           uint pos, int *error);
+uint my_instr_mb(struct charset_info_st *,
+                 const char *b, uint b_length,
+                 const char *s, uint s_length,
+                 my_match_t *match, uint nmatch);
+int my_mb_ctype_mb(CHARSET_INFO *,int *, const uchar *,const uchar *);
+ulong my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);
+int my_snprintf_8bit(struct charset_info_st *, char *to, uint n,
+                    const char *fmt, ...);
+int  my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
+                          long int val);
+int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix,
+                             longlong val);
+extern uint my_lengthsp_8bit(CHARSET_INFO *cs, const char *ptr, uint length);
+long        my_strntol_8bit(CHARSET_INFO *, const char *s, uint l, int base,
+                           char **e, int *err);
+ulong      my_strntoul_8bit(CHARSET_INFO *, const char *s, uint l, int base,
+                           char **e, int *err);
+longlong   my_strntoll_8bit(CHARSET_INFO *, const char *s, uint l, int base,
+                           char **e, int *err);
+ulonglong my_strntoull_8bit(CHARSET_INFO *, const char *s, uint l, int base,
+                           char **e, int *err);
+double      my_strntod_8bit(CHARSET_INFO *, char *s, uint l,char **e,
+                           int *err);
+longlong my_strtoll10_8bit(CHARSET_INFO *cs,
+                           const char *nptr, char **endptr, int *error);
+
+my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, uint len);*/
+
+}; //namespace
+
+#endif /* _m_ctype_h */
+
diff --git a/src/lib/m_string.h b/src/lib/m_string.h
new file mode 100644 (file)
index 0000000..3272929
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef _m_string_h
+#define _m_string_h
+
+#include <string.h>
+
+#ifdef _WIN32
+#define bzero(p, l) memset(p, 0, l)
+#endif
+
+
+#endif /* m_string_h */
+
diff --git a/src/lib/mapfile.hpp b/src/lib/mapfile.hpp
new file mode 100644 (file)
index 0000000..ac8bb67
--- /dev/null
@@ -0,0 +1,103 @@
+#ifndef _MAPFILE_HPP_
+#define _MAPFILE_HPP_
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef HAVE_MMAP
+#  include <sys/types.h>
+#  include <fcntl.h>
+#  include <sys/mman.h>
+#  include <unistd.h>
+#endif
+#ifdef _WIN32
+#  include <windows.h>
+#endif
+#include <glib.h>
+
+class MapFile {
+public:
+  MapFile(void) : 
+#ifdef HAVE_MMAP
+               mmap_fd(-1),
+#elif defined(_WIN32)
+               hFile(0),
+               hFileMap(0),
+#endif
+               data(NULL)
+       {
+       }
+  ~MapFile();
+  inline bool open(const char *file_name, unsigned long file_size);
+  inline void close();
+  inline gchar *begin(void) { return data; }
+private:
+#ifdef HAVE_MMAP
+  int mmap_fd;
+#elif defined(_WIN32)
+  HANDLE hFile;
+  HANDLE hFileMap;
+#endif
+  char *data;
+  unsigned long size;
+};
+
+inline bool MapFile::open(const char *file_name, unsigned long file_size)
+{
+  size=file_size;
+#ifdef HAVE_MMAP
+  if ((mmap_fd = ::open(file_name, O_RDONLY)) < 0) {
+    //g_print("Open file %s failed!\n",fullfilename);
+    return false;
+  }
+  data = (gchar *)mmap( NULL, file_size, PROT_READ, MAP_SHARED, mmap_fd, 0);
+  if ((void *)data == (void *)(-1)) {
+    //g_print("mmap file %s failed!\n",idxfilename);
+    ::close(mmap_fd);
+    data=NULL;
+    return false;
+  }
+#elif defined( _WIN32)
+  hFile = CreateFile(file_name, GENERIC_READ, 0, NULL, OPEN_ALWAYS, 
+                    FILE_ATTRIBUTE_NORMAL, 0);
+  hFileMap = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0,  
+                              file_size, NULL);
+  data = (gchar *)MapViewOfFile(hFileMap, FILE_MAP_READ, 0, 0, file_size);
+#else
+  gsize read_len;
+  if (!g_file_get_contents(file_name, &data, &read_len, NULL))
+    return false;
+
+  if (read_len!=file_size)
+    return false;              
+#endif
+
+  return true;
+}
+
+inline void MapFile::close()
+{
+  if (!data)
+    return;
+#ifdef HAVE_MMAP
+  munmap(data, size);
+  ::close(mmap_fd);
+#else
+#  ifdef _WIN32
+  UnmapViewOfFile(data);
+  CloseHandle(hFileMap);
+  CloseHandle(hFile);
+#  else
+  g_free(data);
+#  endif
+#endif                 
+  data=NULL;
+}
+
+inline MapFile::~MapFile()
+{
+  close();
+}
+
+#endif//!_MAPFILE_HPP_
diff --git a/src/lib/md5.c b/src/lib/md5.c
new file mode 100644 (file)
index 0000000..74b1274
--- /dev/null
@@ -0,0 +1,252 @@
+/*
+ * This code implements the MD5 message-digest algorithm.
+ * The algorithm is due to Ron Rivest.  This code was
+ * written by Colin Plumb in 1993, no copyright is claimed.
+ * This code is in the public domain; do with it what you wish.
+ *
+ * Equivalent code is available from RSA Data Security, Inc.
+ * This code has been tested against that, and is equivalent,
+ * except that you don't need to include two pages of legalese
+ * with every copy.
+ *
+ * To compute the message digest of a chunk of bytes, declare an
+ * MD5Context structure, pass it to MD5Init, call MD5Update as
+ * needed on buffers full of bytes, and then call MD5Final, which
+ * will fill a supplied 16-byte array with the digest.
+ */
+#include <string.h>            /* for memcpy() */
+#include "md5.h"
+
+#ifndef HIGHFIRST
+#define byteReverse(buf, len)  /* Nothing */
+#else
+void byteReverse(unsigned char *buf, unsigned longs);
+
+#ifndef ASM_MD5
+/*
+ * Note: this code is harmless on little-endian machines.
+ */
+void byteReverse(unsigned char *buf, unsigned longs)
+{
+    uint32 t;
+    do {
+       t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
+           ((unsigned) buf[1] << 8 | buf[0]);
+       *(uint32 *) buf = t;
+       buf += 4;
+    } while (--longs);
+}
+#endif
+#endif
+
+/*
+ * Start MD5 accumulation.  Set bit count to 0 and buffer to mysterious
+ * initialization constants.
+ */
+void MD5Init(struct MD5Context *ctx)
+{
+    ctx->buf[0] = 0x67452301;
+    ctx->buf[1] = 0xefcdab89;
+    ctx->buf[2] = 0x98badcfe;
+    ctx->buf[3] = 0x10325476;
+
+    ctx->bits[0] = 0;
+    ctx->bits[1] = 0;
+}
+
+/*
+ * Update context to reflect the concatenation of another buffer full
+ * of bytes.
+ */
+void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
+{
+    uint32 t;
+
+    /* Update bitcount */
+
+    t = ctx->bits[0];
+    if ((ctx->bits[0] = t + ((uint32) len << 3)) < t)
+       ctx->bits[1]++;         /* Carry from low to high */
+    ctx->bits[1] += len >> 29;
+
+    t = (t >> 3) & 0x3f;       /* Bytes already in shsInfo->data */
+
+    /* Handle any leading odd-sized chunks */
+
+    if (t) {
+       unsigned char *p = (unsigned char *) ctx->in + t;
+
+       t = 64 - t;
+       if (len < t) {
+           memcpy(p, buf, len);
+           return;
+       }
+       memcpy(p, buf, t);
+       byteReverse(ctx->in, 16);
+       MD5Transform(ctx->buf, (uint32 *) ctx->in);
+       buf += t;
+       len -= t;
+    }
+    /* Process data in 64-byte chunks */
+
+    while (len >= 64) {
+       memcpy(ctx->in, buf, 64);
+       byteReverse(ctx->in, 16);
+       MD5Transform(ctx->buf, (uint32 *) ctx->in);
+       buf += 64;
+       len -= 64;
+    }
+
+    /* Handle any remaining bytes of data. */
+
+    memcpy(ctx->in, buf, len);
+}
+
+/*
+ * Final wrapup - pad to 64-byte boundary with the bit pattern 
+ * 1 0* (64-bit count of bits processed, MSB-first)
+ */
+void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
+{
+    unsigned count;
+    unsigned char *p;
+
+    /* Compute number of bytes mod 64 */
+    count = (ctx->bits[0] >> 3) & 0x3F;
+
+    /* Set the first char of padding to 0x80.  This is safe since there is
+       always at least one byte free */
+    p = ctx->in + count;
+    *p++ = 0x80;
+
+    /* Bytes of padding needed to make 64 bytes */
+    count = 64 - 1 - count;
+
+    /* Pad out to 56 mod 64 */
+    if (count < 8) {
+       /* Two lots of padding:  Pad the first block to 64 bytes */
+       memset(p, 0, count);
+       byteReverse(ctx->in, 16);
+       MD5Transform(ctx->buf, (uint32 *) ctx->in);
+
+       /* Now fill the next block with 56 bytes */
+       memset(ctx->in, 0, 56);
+    } else {
+       /* Pad block to 56 bytes */
+       memset(p, 0, count - 8);
+    }
+    byteReverse(ctx->in, 14);
+
+    /* Append length in bits and transform */
+    ((uint32 *) ctx->in)[14] = ctx->bits[0];
+    ((uint32 *) ctx->in)[15] = ctx->bits[1];
+
+    MD5Transform(ctx->buf, (uint32 *) ctx->in);
+    byteReverse((unsigned char *) ctx->buf, 4);
+    memcpy(digest, ctx->buf, 16);
+    memset(ctx, 0, sizeof(ctx));       /* In case it's sensitive */
+}
+
+#ifndef ASM_MD5
+
+/* The four core functions - F1 is optimized somewhat */
+
+/* #define F1(x, y, z) (x & y | ~x & z) */
+#define F1(x, y, z) (z ^ (x & (y ^ z)))
+#define F2(x, y, z) F1(z, x, y)
+#define F3(x, y, z) (x ^ y ^ z)
+#define F4(x, y, z) (y ^ (x | ~z))
+
+/* This is the central step in the MD5 algorithm. */
+#define MD5STEP(f, w, x, y, z, data, s) \
+       ( w += f(x, y, z) + data,  w = w<<s | w>>(32-s),  w += x )
+
+/*
+ * The core of the MD5 algorithm, this alters an existing MD5 hash to
+ * reflect the addition of 16 longwords of new data.  MD5Update blocks
+ * the data and converts bytes into longwords for this routine.
+ */
+void MD5Transform(uint32 buf[4], uint32 const in[16])
+{
+    register uint32 a, b, c, d;
+
+    a = buf[0];
+    b = buf[1];
+    c = buf[2];
+    d = buf[3];
+
+    MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
+    MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
+    MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
+    MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
+    MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
+    MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
+    MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
+    MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
+    MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
+    MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
+    MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
+    MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
+    MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
+    MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
+    MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
+    MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
+
+    MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
+    MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
+    MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
+    MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
+    MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
+    MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
+    MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
+    MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
+    MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
+    MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
+    MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
+    MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
+    MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
+    MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
+    MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
+    MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
+
+    MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
+    MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
+    MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
+    MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
+    MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
+    MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
+    MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
+    MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
+    MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
+    MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
+    MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
+    MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
+    MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
+    MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
+    MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
+    MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
+
+    MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
+    MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
+    MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
+    MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
+    MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
+    MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
+    MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
+    MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
+    MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
+    MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
+    MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
+    MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
+    MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
+    MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
+    MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
+    MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
+
+    buf[0] += a;
+    buf[1] += b;
+    buf[2] += c;
+    buf[3] += d;
+}
+
+#endif
diff --git a/src/lib/md5.h b/src/lib/md5.h
new file mode 100644 (file)
index 0000000..06b676f
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef MD5_H
+#define MD5_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif                          /* __cplusplus */
+
+#ifdef __alpha
+typedef unsigned int uint32;
+#else
+typedef unsigned long uint32;
+#endif
+
+struct MD5Context {
+       uint32 buf[4];
+       uint32 bits[2];
+       unsigned char in[64];
+};
+
+void MD5Init(struct MD5Context *context);
+void MD5Update(struct MD5Context *context, unsigned char const *buf,
+              unsigned len);
+void MD5Final(unsigned char digest[16], struct MD5Context *context);
+void MD5Transform(uint32 buf[4], uint32 const in[16]);
+
+/*
+ * This is needed to make RSAREF happy on some MS-DOS compilers.
+ */
+typedef struct MD5Context MD5_CTX;
+
+#ifdef __cplusplus
+}
+#endif                          /* __cplusplus */
+
+#endif /* !MD5_H */
diff --git a/src/lib/my_global.h b/src/lib/my_global.h
new file mode 100644 (file)
index 0000000..0b2a0cd
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef _global_h
+#define _global_h
+
+typedef unsigned int uint;
+typedef unsigned short  uint16; /* Short for unsigned integer >= 16 bits */
+typedef unsigned long   ulong;            /* Short for unsigned long */
+typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
+typedef long long int   longlong;
+typedef char    pchar;          /* Mixed prototypes can take char */
+typedef char    pbool;          /* Mixed prototypes can take char */
+typedef unsigned char   uchar;  /* Short for unsigned char */
+typedef char            my_bool; /* Small bool */
+
+#ifndef min
+#  define min(a, b)       ((a) < (b) ? (a) : (b))
+#endif
+
+
+#endif /* my_global_h */
+
diff --git a/src/lib/netdictcache.cpp b/src/lib/netdictcache.cpp
new file mode 100644 (file)
index 0000000..f19c19f
--- /dev/null
@@ -0,0 +1,94 @@
+#include "netdictcache.h"
+#include "netdictplugin.h"
+
+#include <string>
+#include <vector>
+#include <map>
+
+class RespCache {
+public:
+       RespCache();
+       ~RespCache();
+       NetDictResponse *get_cache_resp(const char *key);
+       void save_cache_resp(const char *key, NetDictResponse *resp);
+private:
+       static const unsigned int resp_pool_size = 50;
+       struct RespElement {
+               std::string key;
+               NetDictResponse *resp;
+       };
+       std::vector<RespElement *> resp_pool;
+       size_t cur_resp_pool_pos;
+};
+
+static std::map<std::string, RespCache> dictresp_map;
+
+RespCache::RespCache()
+{
+       resp_pool.resize(resp_pool_size);
+       for (size_t i = 0; i< resp_pool_size; i++) {
+               resp_pool[i] = NULL;
+       }
+       cur_resp_pool_pos = 0;
+}
+
+RespCache::~RespCache()
+{
+       for (std::vector<RespElement *>::iterator i = resp_pool.begin(); i != resp_pool.end(); ++i) {
+               if (*i) {
+                       delete (*i)->resp;
+                       delete *i;
+               }
+       }
+}
+
+NetDictResponse *RespCache::get_cache_resp(const char *key)
+{
+       for (std::vector<RespElement *>::iterator i = resp_pool.begin(); i != resp_pool.end(); ++i) {
+               if (*i) {
+                       if ((*i)->key == key) {
+                               return (*i)->resp;
+                       }
+               }
+       }
+       return NULL;
+}
+
+void RespCache::save_cache_resp(const char *key, NetDictResponse *resp)
+{
+       if (resp_pool[cur_resp_pool_pos]) {
+               delete resp_pool[cur_resp_pool_pos]->resp;
+               delete resp_pool[cur_resp_pool_pos];
+       }
+       resp_pool[cur_resp_pool_pos] = new RespElement();
+       resp_pool[cur_resp_pool_pos]->key = key;
+       resp_pool[cur_resp_pool_pos]->resp = resp;
+       cur_resp_pool_pos++;
+       if (cur_resp_pool_pos == resp_pool_size) {
+               cur_resp_pool_pos = 0;
+       }
+}
+
+static RespCache &get_response_cache(const char *dict)
+{
+       std::map<std::string, RespCache>::iterator i = dictresp_map.find(dict);
+       if (i == dictresp_map.end()) {
+               std::pair<std::map<std::string, RespCache>::iterator, bool> result;
+               result = dictresp_map.insert(std::pair<std::string, RespCache>(dict, RespCache()));
+               return result.first->second;
+       } else {
+               return i->second;
+       }
+}
+
+NetDictResponse *netdict_get_cache_resp(const char *dict, const char *key)
+{
+       RespCache &resp_cache = get_response_cache(dict);
+       return resp_cache.get_cache_resp(key);
+}
+
+void netdict_save_cache_resp(const char *dict, const char *key, NetDictResponse *resp)
+{
+       RespCache &resp_cache = get_response_cache(dict);
+       resp_cache.save_cache_resp(key, resp);
+}
diff --git a/src/lib/netdictcache.h b/src/lib/netdictcache.h
new file mode 100644 (file)
index 0000000..a428e4b
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _STARDICT_NETDICT_CACHE_H_
+#define _STARDICT_NETDICT_CACHE_H_
+
+struct NetDictResponse;
+
+extern NetDictResponse *netdict_get_cache_resp(const char *dict, const char *key);
+extern void netdict_save_cache_resp(const char *dict, const char *key, NetDictResponse *resp);
+
+#endif
diff --git a/src/lib/netdictplugin.cpp b/src/lib/netdictplugin.cpp
new file mode 100644 (file)
index 0000000..001b7b6
--- /dev/null
@@ -0,0 +1,13 @@
+#include "netdictplugin.h"
+#include <glib.h>
+
+NetDictResponse::~NetDictResponse()
+{
+       g_free(word);
+       g_free(data);
+}
+
+StarDictNetDictPlugInObject::StarDictNetDictPlugInObject()
+{
+       lookup_func = 0;
+}
diff --git a/src/lib/netdictplugin.h b/src/lib/netdictplugin.h
new file mode 100644 (file)
index 0000000..9d508b8
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef _STARDICT_NETDICT_PLUGIN_H_
+#define _STARDICT_NETDICT_PLUGIN_H_
+
+struct NetDictResponse {
+       ~NetDictResponse();
+       const char *bookname;
+       char *word;
+       char *data;
+};
+
+struct StarDictNetDictPlugInObject{
+       StarDictNetDictPlugInObject();
+
+       typedef void (*lookup_func_t)(const char *word, bool ismainwin);
+       lookup_func_t lookup_func;
+       const char *dict_name;
+       const char *dict_cacheid;
+};
+
+#endif
diff --git a/src/lib/parsedata_plugin.cpp b/src/lib/parsedata_plugin.cpp
new file mode 100644 (file)
index 0000000..50a3328
--- /dev/null
@@ -0,0 +1,27 @@
+#include "parsedata_plugin.h"
+
+ParseResult::~ParseResult()
+{
+       clear();
+}
+
+void ParseResult::clear()
+{
+       for (std::list<ParseResultItem>::iterator i = item_list.begin(); i != item_list.end(); ++i) {
+               if (i->type == ParseResultItemType_mark) {
+                       delete i->mark;
+               } else if (i->type == ParseResultItemType_link) {
+                       delete i->link;
+               } else if (i->type == ParseResultItemType_res) {
+                       delete i->res;
+               } else if (i->type == ParseResultItemType_widget) {
+                       delete i->widget;
+               }
+       }
+       item_list.clear();
+}
+
+StarDictParseDataPlugInObject::StarDictParseDataPlugInObject()
+{
+       parse_func = 0;
+}
diff --git a/src/lib/parsedata_plugin.h b/src/lib/parsedata_plugin.h
new file mode 100644 (file)
index 0000000..967895c
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef _STARDICT_PARSEDATA_PLUGIN_H_
+#define _STARDICT_PARSEDATA_PLUGIN_H_
+
+#include <gtk/gtk.h>
+#include <string>
+#include <list>
+
+enum ParseResultItemType {
+       ParseResultItemType_mark,
+       ParseResultItemType_link,
+       ParseResultItemType_res,
+       ParseResultItemType_widget,
+};
+
+struct ParseResultMarkItem {
+       std::string pango;
+};
+
+struct LinkDesc {
+       std::string::size_type pos_;
+       std::string::size_type len_;
+       std::string link_;
+       LinkDesc(std::string::size_type pos, std::string::size_type len, std::string link):
+               pos_(pos), len_(len), link_(link) {}
+};
+
+typedef std::list<LinkDesc> LinksPosList;
+
+struct ParseResultLinkItem {
+       std::string pango;
+       LinksPosList links_list;
+};
+
+struct ParseResultResItem {
+       std::string type;
+       std::string key;
+};
+
+struct ParseResultWidgetItem {
+       GtkWidget *widget;
+};
+
+struct ParseResultItem {
+       ParseResultItemType type;
+       union {
+               ParseResultMarkItem *mark;
+               ParseResultLinkItem *link;
+               ParseResultResItem *res;
+               ParseResultWidgetItem *widget;
+       };
+};
+
+struct ParseResult {
+       ~ParseResult();
+       void clear();
+       std::list<ParseResultItem> item_list;
+};
+
+struct StarDictParseDataPlugInObject{
+       StarDictParseDataPlugInObject();
+
+       typedef bool (*parse_func_t)(const char *p, unsigned int *parsed_size, ParseResult &result, const char *oword);
+       parse_func_t parse_func;
+};
+
+#endif
diff --git a/src/lib/plugin.cpp b/src/lib/plugin.cpp
new file mode 100644 (file)
index 0000000..c9a0391
--- /dev/null
@@ -0,0 +1,20 @@
+#include "plugin.h"
+
+StarDictPluginSystemInfo oStarDictPluginSystemInfo;
+StarDictPluginSystemService oStarDictPluginSystemService;
+
+
+StarDictPlugInObject::StarDictPlugInObject()
+{
+       version_str = PLUGIN_SYSTEM_VERSION;
+       type = StarDictPlugInType_UNKNOWN;
+       info_xml = NULL;
+       configure_func = NULL;
+       plugin_info = &oStarDictPluginSystemInfo;
+       plugin_service = &oStarDictPluginSystemService;
+}
+
+StarDictPlugInObject::~StarDictPlugInObject()
+{
+       g_free(info_xml);
+}
diff --git a/src/lib/plugin.h b/src/lib/plugin.h
new file mode 100644 (file)
index 0000000..44cf8e1
--- /dev/null
@@ -0,0 +1,70 @@
+#ifndef _STARDICT_PLUGIN_H_
+#define _STARDICT_PLUGIN_H_
+
+#include <gtk/gtk.h>
+#include <string>
+#include <list>
+
+
+#define PLUGIN_SYSTEM_VERSION "3.0.1"
+
+enum StarDictPlugInType {
+       StarDictPlugInType_UNKNOWN,
+       StarDictPlugInType_VIRTUALDICT,
+       StarDictPlugInType_NETDICT,
+       StarDictPlugInType_SPECIALDICT,
+       StarDictPlugInType_TTS,
+       StarDictPlugInType_PARSEDATA,
+       StarDictPlugInType_MISC,
+};
+
+struct NetDictResponse;
+
+struct StarDictPluginSystemService {
+       typedef void (*get_http_response_func_t)(char *buffer, size_t buffer_len, gpointer userdata);
+       typedef void (*send_http_request_func_t)(const char* shost, const char* sfile, get_http_response_func_t callback_func, gpointer userdata);
+       send_http_request_func_t send_http_request;
+       typedef void (*show_url_func_t)(const char *url);
+       show_url_func_t show_url;
+       typedef void (*set_news_func_t)(const char *news, const char *links);
+       set_news_func_t set_news;
+       typedef char *(*encode_uri_string_func_t)(const char *string);
+       encode_uri_string_func_t encode_uri_string;
+       typedef void (*netdict_save_cache_resp_func_t)(const char *dict, const char *key, NetDictResponse *resp);
+       netdict_save_cache_resp_func_t netdict_save_cache_resp;
+       typedef void (*show_netdict_resp_func_t)(NetDictResponse *resp, bool ismainwin);
+       show_netdict_resp_func_t show_netdict_resp;
+       typedef void (*lookup_dict_func_t)(size_t dictid, const char *word, char ****Word, char *****WordData);
+       lookup_dict_func_t lookup_dict;
+       typedef void (*FreeResultData_func_t)(size_t dictmask_size, char ***pppWord, char ****ppppWordData);
+       FreeResultData_func_t FreeResultData;
+       typedef void (*ShowPangoTips_func_t)(const char *word, const char *text);
+       ShowPangoTips_func_t ShowPangoTips;
+};
+
+struct StarDictPluginSystemInfo {
+       const char *datadir;
+       GtkWidget *mainwin;
+       GtkWidget *pluginwin;
+};
+
+// Notice: You need to init these structs' members before creating a StarDictPlugins object.
+extern StarDictPluginSystemInfo oStarDictPluginSystemInfo;
+extern StarDictPluginSystemService oStarDictPluginSystemService;
+
+typedef void (*plugin_configure_func_t)();
+
+struct StarDictPlugInObject {
+       StarDictPlugInObject();
+       ~StarDictPlugInObject();
+
+       const char* version_str;
+       StarDictPlugInType type;
+       char* info_xml;
+       plugin_configure_func_t configure_func;
+
+       const StarDictPluginSystemInfo *plugin_info;
+       const StarDictPluginSystemService *plugin_service;
+};
+
+#endif
diff --git a/src/lib/pluginmanager.cpp b/src/lib/pluginmanager.cpp
new file mode 100644 (file)
index 0000000..de3e92d
--- /dev/null
@@ -0,0 +1,977 @@
+#include "pluginmanager.h"
+#include "file.hpp"
+#include <string>
+
+StarDictPluginBaseObject::StarDictPluginBaseObject(const char *filename, GModule *module_, plugin_configure_func_t configure_func_):
+       plugin_filename(filename), module(module_), configure_func(configure_func_)
+{
+}
+
+StarDictPluginBase::StarDictPluginBase(StarDictPluginBaseObject *baseobj_):
+       baseobj(baseobj_)
+{
+}
+
+typedef void (*stardict_plugin_exit_func_t)(void);
+
+StarDictPluginBase::~StarDictPluginBase()
+{
+       union {
+               stardict_plugin_exit_func_t stardict_plugin_exit;
+               gpointer stardict_plugin_exit_avoid_warning;
+       } func;
+       func.stardict_plugin_exit = 0;
+       if (g_module_symbol (baseobj->module, "stardict_plugin_exit", (gpointer *)&(func.stardict_plugin_exit_avoid_warning))) {
+               func.stardict_plugin_exit();
+       }
+       g_module_close (baseobj->module);
+       delete baseobj;
+}
+
+void StarDictPluginBase::configure()
+{
+       if (baseobj->configure_func != NULL)
+               baseobj->configure_func();
+}
+
+const char *StarDictPluginBase::get_filename()
+{
+       return baseobj->plugin_filename.c_str();
+}
+
+StarDictPlugins::StarDictPlugins(const char *dirpath, const std::list<std::string>& order_list, const std::list<std::string>& disable_list)
+{
+       plugindirpath = dirpath;
+       load(dirpath, order_list, disable_list);
+}
+
+StarDictPlugins::~StarDictPlugins()
+{
+}
+
+class PluginLoader {
+public:
+       PluginLoader(StarDictPlugins& plugins_): plugins(plugins_) {}
+       void operator()(const std::string& url, bool disable) {
+               if (!disable)
+                       plugins.load_plugin(url.c_str());
+       }
+private:
+       StarDictPlugins& plugins;
+};
+
+void StarDictPlugins::load(const char *dirpath, const std::list<std::string>& order_list, const std::list<std::string>& disable_list)
+{
+       std::list<std::string> plugins_dirs;
+       plugins_dirs.push_back(dirpath);
+       for_each_file(plugins_dirs, "."G_MODULE_SUFFIX, order_list, disable_list, PluginLoader(*this));
+}
+
+void StarDictPlugins::reorder(const std::list<std::string>& order_list)
+{
+       VirtualDictPlugins.reorder(order_list);
+       NetDictPlugins.reorder(order_list);
+       SpecialDictPlugins.reorder(order_list);
+       TtsPlugins.reorder(order_list);
+       ParseDataPlugins.reorder(order_list);
+       MiscPlugins.reorder(order_list);
+}
+
+bool StarDictPlugins::get_loaded(const char *filename)
+{
+       bool found = false;
+       for (std::list<std::string>::iterator iter = loaded_plugin_list.begin(); iter != loaded_plugin_list.end(); ++iter) {
+               if (*iter == filename) {
+                       found = true;
+                       break;
+               }
+       }
+       return found;
+}
+
+class PluginInfoLoader {
+public:
+       PluginInfoLoader(StarDictPlugins& plugins_, std::list<StarDictPluginInfo> &virtualdict_pluginlist_, std::list<StarDictPluginInfo> &netdict_pluginlist_, std::list<StarDictPluginInfo> &specialdict_pluginlist_, std::list<StarDictPluginInfo> &tts_pluginlist_, std::list<StarDictPluginInfo> &parsedata_pluginlist_, std::list<StarDictPluginInfo> &misc_pluginlist_): plugins(plugins_), virtualdict_pluginlist(virtualdict_pluginlist_), netdict_pluginlist(netdict_pluginlist_), specialdict_pluginlist(specialdict_pluginlist_), tts_pluginlist(tts_pluginlist_), parsedata_pluginlist(parsedata_pluginlist_), misc_pluginlist(misc_pluginlist_) {}
+       void operator()(const std::string& url, bool disable) {
+               if (!disable) {
+                       StarDictPlugInType plugin_type = StarDictPlugInType_UNKNOWN;
+                       std::string info_xml;
+                       bool can_configure;
+                       plugins.get_plugin_info(url.c_str(), plugin_type, info_xml, can_configure);
+                       if (plugin_type != StarDictPlugInType_UNKNOWN && (!info_xml.empty())) {
+                               StarDictPluginInfo plugin_info;
+                               plugin_info.filename = url;
+                               plugin_info.plugin_type = plugin_type;
+                               plugin_info.info_xml = info_xml;
+                               plugin_info.can_configure = can_configure;
+                               switch (plugin_type) {
+                                       case StarDictPlugInType_VIRTUALDICT:
+                                               virtualdict_pluginlist.push_back(plugin_info);
+                                               break;
+                                       case StarDictPlugInType_NETDICT:
+                                               netdict_pluginlist.push_back(plugin_info);
+                                               break;
+                                       case StarDictPlugInType_SPECIALDICT:
+                                               specialdict_pluginlist.push_back(plugin_info);
+                                               break;
+                                       case StarDictPlugInType_TTS:
+                                               tts_pluginlist.push_back(plugin_info);
+                                               break;
+                                       case StarDictPlugInType_PARSEDATA:
+                                               parsedata_pluginlist.push_back(plugin_info);
+                                               break;
+                                       case StarDictPlugInType_MISC:
+                                               misc_pluginlist.push_back(plugin_info);
+                                               break;
+                                       default:
+                                               break;
+                               }
+                       }
+               }
+       }
+private:
+       StarDictPlugins& plugins;
+       std::list<StarDictPluginInfo> &virtualdict_pluginlist;
+       std::list<StarDictPluginInfo> &netdict_pluginlist;
+       std::list<StarDictPluginInfo> &specialdict_pluginlist;
+       std::list<StarDictPluginInfo> &tts_pluginlist;
+       std::list<StarDictPluginInfo> &parsedata_pluginlist;
+       std::list<StarDictPluginInfo> &misc_pluginlist;
+};
+
+void StarDictPlugins::get_plugin_list(const std::list<std::string>& order_list, std::list<std::pair<StarDictPlugInType, std::list<StarDictPluginInfo> > > &plugin_list)
+{
+       plugin_list.clear();
+       std::list<StarDictPluginInfo> virtualdict_pluginlist;
+       std::list<StarDictPluginInfo> netdict_pluginlist;
+       std::list<StarDictPluginInfo> specialdict_pluginlist;
+       std::list<StarDictPluginInfo> tts_pluginlist;
+       std::list<StarDictPluginInfo> parsedata_pluginlist;
+       std::list<StarDictPluginInfo> misc_pluginlist;
+
+       std::list<std::string> plugins_dirs;
+       plugins_dirs.push_back(plugindirpath);
+       std::list<std::string> disable_list;
+       for_each_file(plugins_dirs, "."G_MODULE_SUFFIX, order_list, disable_list, PluginInfoLoader(*this, virtualdict_pluginlist, netdict_pluginlist, specialdict_pluginlist, tts_pluginlist, parsedata_pluginlist, misc_pluginlist));
+
+       if (!virtualdict_pluginlist.empty()) {
+               plugin_list.push_back(std::pair<StarDictPlugInType, std::list<StarDictPluginInfo> >(StarDictPlugInType_VIRTUALDICT, virtualdict_pluginlist));
+       }
+       if (!netdict_pluginlist.empty()) {
+               plugin_list.push_back(std::pair<StarDictPlugInType, std::list<StarDictPluginInfo> >(StarDictPlugInType_NETDICT, netdict_pluginlist));
+       }
+       if (!specialdict_pluginlist.empty()) {
+               plugin_list.push_back(std::pair<StarDictPlugInType, std::list<StarDictPluginInfo> >(StarDictPlugInType_SPECIALDICT, specialdict_pluginlist));
+       }
+       if (!tts_pluginlist.empty()) {
+               plugin_list.push_back(std::pair<StarDictPlugInType, std::list<StarDictPluginInfo> >(StarDictPlugInType_TTS, tts_pluginlist));
+       }
+       if (!parsedata_pluginlist.empty()) {
+               plugin_list.push_back(std::pair<StarDictPlugInType, std::list<StarDictPluginInfo> >(StarDictPlugInType_PARSEDATA, parsedata_pluginlist));
+       }
+       if (!misc_pluginlist.empty()) {
+               plugin_list.push_back(std::pair<StarDictPlugInType, std::list<StarDictPluginInfo> >(StarDictPlugInType_MISC, misc_pluginlist));
+       }
+}
+
+typedef bool (*stardict_plugin_init_func_t)(StarDictPlugInObject *obj);
+
+void StarDictPlugins::get_plugin_info(const char *filename, StarDictPlugInType &plugin_type, std::string &info_xml, bool &can_configure)
+{
+       GModule *module;
+       module = g_module_open (filename, G_MODULE_BIND_LAZY);
+       if (!module) {
+               g_print("Load %s failed!\n", filename);
+               return;
+       }
+       union {
+               stardict_plugin_init_func_t stardict_plugin_init;
+               gpointer stardict_plugin_init_avoid_warning;
+       } func;
+       func.stardict_plugin_init = 0;
+       if (!g_module_symbol (module, "stardict_plugin_init", (gpointer *)&(func.stardict_plugin_init_avoid_warning))) {
+               g_print("Load %s failed: No stardict_plugin_init func!\n", filename);
+               g_module_close (module);
+               return;
+       }
+       StarDictPlugInObject *plugin_obj = new StarDictPlugInObject();
+       bool failed = func.stardict_plugin_init(plugin_obj);
+       if (failed) {
+               g_print("Load %s failed!\n", filename);
+               g_module_close (module);
+               delete plugin_obj;
+               return;
+       }
+       plugin_type = plugin_obj->type;
+       info_xml = plugin_obj->info_xml;
+       can_configure = (plugin_obj->configure_func != NULL);
+       delete plugin_obj;
+       g_module_close (module);
+}
+
+typedef bool (*stardict_virtualdict_plugin_init_func_t)(StarDictVirtualDictPlugInObject *obj);
+typedef bool (*stardict_netdict_plugin_init_func_t)(StarDictNetDictPlugInObject *obj);
+typedef bool (*stardict_specialdict_plugin_init_func_t)(StarDictSpecialDictPlugInObject *obj);
+typedef bool (*stardict_tts_plugin_init_func_t)(StarDictTtsPlugInObject *obj);
+typedef bool (*stardict_parsedata_plugin_init_func_t)(StarDictParseDataPlugInObject *obj);
+typedef bool (*stardict_misc_plugin_init_func_t)(void);
+
+void StarDictPlugins::load_plugin(const char *filename)
+{
+       bool found = false;
+       for (std::list<std::string>::iterator iter = loaded_plugin_list.begin(); iter != loaded_plugin_list.end(); ++iter) {
+               if (*iter == filename) {
+                       found = true;
+                       break;
+               }
+       }
+       if (found)
+               return;
+       loaded_plugin_list.push_back(filename);
+       GModule *module;
+       module = g_module_open (filename, G_MODULE_BIND_LAZY);
+       if (!module) {
+               g_print("Load %s failed!\n", filename);
+               return;
+       }
+       union {
+               stardict_plugin_init_func_t stardict_plugin_init;
+               gpointer stardict_plugin_init_avoid_warning;
+       } func;
+       func.stardict_plugin_init = 0;
+       if (!g_module_symbol (module, "stardict_plugin_init", (gpointer *)&(func.stardict_plugin_init_avoid_warning))) {
+               g_print("Load %s failed: No stardict_plugin_init func!\n", filename);
+               g_module_close (module);
+               return;
+       }
+       StarDictPlugInObject *plugin_obj = new StarDictPlugInObject();
+       bool failed = func.stardict_plugin_init(plugin_obj);
+       if (failed) {
+               g_print("Load %s failed!\n", filename);
+               g_module_close (module);
+               delete plugin_obj;
+               return;
+       }
+       StarDictPlugInType ptype = plugin_obj->type;
+       StarDictPluginBaseObject *baseobj = new StarDictPluginBaseObject(filename, module, plugin_obj->configure_func);
+       delete plugin_obj;
+       if (ptype == StarDictPlugInType_VIRTUALDICT) {
+               union {
+                       stardict_virtualdict_plugin_init_func_t stardict_virtualdict_plugin_init;
+                       gpointer stardict_virtualdict_plugin_init_avoid_warning;
+               } func2;
+               func2.stardict_virtualdict_plugin_init = 0;
+               if (!g_module_symbol (module, "stardict_virtualdict_plugin_init", (gpointer *)&(func2.stardict_virtualdict_plugin_init_avoid_warning))) {
+                       printf("Load %s failed: No stardict_virtualdict_plugin_init func!\n", filename);
+                       g_module_close (module);
+                       delete baseobj;
+                       return;
+               }
+               StarDictVirtualDictPlugInObject *virtualdict_plugin_obj = new StarDictVirtualDictPlugInObject();
+               failed = func2.stardict_virtualdict_plugin_init(virtualdict_plugin_obj);
+               if (failed) {
+                       g_print("Load %s failed!\n", filename);
+                       g_module_close (module);
+                       delete baseobj;
+                       delete virtualdict_plugin_obj;
+                       return;
+               }
+               VirtualDictPlugins.add(baseobj, virtualdict_plugin_obj);
+       } else if (ptype == StarDictPlugInType_NETDICT) {
+               union {
+                       stardict_netdict_plugin_init_func_t stardict_netdict_plugin_init;
+                       gpointer stardict_netdict_plugin_init_avoid_warning;
+               } func2;
+               func2.stardict_netdict_plugin_init = 0;
+               if (!g_module_symbol (module, "stardict_netdict_plugin_init", (gpointer *)&(func2.stardict_netdict_plugin_init_avoid_warning))) {
+                       printf("Load %s failed: No stardict_netdict_plugin_init func!\n", filename);
+                       g_module_close (module);
+                       delete baseobj;
+                       return;
+               }
+               StarDictNetDictPlugInObject *netdict_plugin_obj = new StarDictNetDictPlugInObject();
+               failed = func2.stardict_netdict_plugin_init(netdict_plugin_obj);
+               if (failed) {
+                       g_print("Load %s failed!\n", filename);
+                       g_module_close (module);
+                       delete baseobj;
+                       delete netdict_plugin_obj;
+                       return;
+               }
+               NetDictPlugins.add(baseobj, netdict_plugin_obj);
+       } else if (ptype == StarDictPlugInType_SPECIALDICT) {
+               union {
+                       stardict_specialdict_plugin_init_func_t stardict_specialdict_plugin_init;
+                       gpointer stardict_specialdict_plugin_init_avoid_warning;
+               } func2;
+               func2.stardict_specialdict_plugin_init = 0;
+               if (!g_module_symbol (module, "stardict_specialdict_plugin_init", (gpointer *)&(func2.stardict_specialdict_plugin_init_avoid_warning))) {
+                       printf("Load %s failed: No stardict_specialdict_plugin_init func!\n", filename);
+                       g_module_close (module);
+                       delete baseobj;
+                       return;
+               }
+               StarDictSpecialDictPlugInObject *specialdict_plugin_obj = new StarDictSpecialDictPlugInObject();
+               failed = func2.stardict_specialdict_plugin_init(specialdict_plugin_obj);
+               if (failed) {
+                       g_print("Load %s failed!\n", filename);
+                       g_module_close (module);
+                       delete baseobj;
+                       delete specialdict_plugin_obj;
+                       return;
+               }
+               SpecialDictPlugins.add(baseobj, specialdict_plugin_obj);
+       } else if (ptype == StarDictPlugInType_TTS) {
+               union {
+                       stardict_tts_plugin_init_func_t stardict_tts_plugin_init;
+                       gpointer stardict_tts_plugin_init_avoid_warning;
+               } func2;
+               func2.stardict_tts_plugin_init = 0;
+               if (!g_module_symbol (module, "stardict_tts_plugin_init", (gpointer *)&(func2.stardict_tts_plugin_init_avoid_warning))) {
+                       printf("Load %s failed: No stardict_tts_plugin_init func!\n", filename);
+                       g_module_close (module);
+                       delete baseobj;
+                       return;
+               }
+               StarDictTtsPlugInObject *tts_plugin_obj = new StarDictTtsPlugInObject();
+               failed = func2.stardict_tts_plugin_init(tts_plugin_obj);
+               if (failed) {
+                       g_print("Load %s failed!\n", filename);
+                       g_module_close (module);
+                       delete baseobj;
+                       delete tts_plugin_obj;
+                       return;
+               }
+               TtsPlugins.add(baseobj, tts_plugin_obj);
+       } else if (ptype == StarDictPlugInType_PARSEDATA) {
+               union {
+                       stardict_parsedata_plugin_init_func_t stardict_parsedata_plugin_init;
+                       gpointer stardict_parsedata_plugin_init_avoid_warning;
+               } func3;
+               func3.stardict_parsedata_plugin_init = 0;
+               if (!g_module_symbol (module, "stardict_parsedata_plugin_init", (gpointer *)&(func3.stardict_parsedata_plugin_init_avoid_warning))) {
+                       printf("Load %s failed: No stardict_parsedata_plugin_init func!\n", filename);
+                       g_module_close (module);
+                       delete baseobj;
+                       return;
+               }
+               StarDictParseDataPlugInObject *parsedata_plugin_obj = new StarDictParseDataPlugInObject();
+               failed = func3.stardict_parsedata_plugin_init(parsedata_plugin_obj);
+               if (failed) {
+                       g_print("Load %s failed!\n", filename);
+                       g_module_close (module);
+                       delete baseobj;
+                       delete parsedata_plugin_obj;
+                       return;
+               }
+               ParseDataPlugins.add(baseobj, parsedata_plugin_obj);
+       } else if (ptype == StarDictPlugInType_MISC) {
+               union {
+                       stardict_misc_plugin_init_func_t stardict_misc_plugin_init;
+                       gpointer stardict_misc_plugin_init_avoid_warning;
+               } func4;
+               func4.stardict_misc_plugin_init = 0;
+               if (!g_module_symbol (module, "stardict_misc_plugin_init", (gpointer *)&(func4.stardict_misc_plugin_init_avoid_warning))) {
+                       printf("Load %s failed: No stardict_misc_plugin_init func!\n", filename);
+                       g_module_close (module);
+                       delete baseobj;
+                       return;
+               }
+               failed = func4.stardict_misc_plugin_init();
+               if (failed) {
+                       g_print("Load %s failed!\n", filename);
+                       g_module_close (module);
+                       delete baseobj;
+                       return;
+               }
+               MiscPlugins.add(baseobj);
+       } else {
+               g_print("Load %s failed: Unknow type plugin!\n", filename);
+               g_module_close (module);
+               delete baseobj;
+               return;
+       }
+}
+
+void StarDictPlugins::unload_plugin(const char *filename, StarDictPlugInType plugin_type)
+{
+       for (std::list<std::string>::iterator iter = loaded_plugin_list.begin(); iter != loaded_plugin_list.end(); ++iter) {
+               if (*iter == filename) {
+                       loaded_plugin_list.erase(iter);
+                       break;
+               }
+       }
+       switch (plugin_type) {
+               case StarDictPlugInType_VIRTUALDICT:
+                       VirtualDictPlugins.unload_plugin(filename);
+                       break;
+               case StarDictPlugInType_NETDICT:
+                       NetDictPlugins.unload_plugin(filename);
+                       break;
+               case StarDictPlugInType_SPECIALDICT:
+                       SpecialDictPlugins.unload_plugin(filename);
+                       break;
+               case StarDictPlugInType_TTS:
+                       TtsPlugins.unload_plugin(filename);
+                       break;
+               case StarDictPlugInType_PARSEDATA:
+                       ParseDataPlugins.unload_plugin(filename);
+                       break;
+               case StarDictPlugInType_MISC:
+                       MiscPlugins.unload_plugin(filename);
+                       break;
+               default:
+                       break;
+       }
+}
+
+void StarDictPlugins::configure_plugin(const char *filename, StarDictPlugInType plugin_type)
+{
+       switch (plugin_type) {
+               case StarDictPlugInType_VIRTUALDICT:
+                       VirtualDictPlugins.configure_plugin(filename);
+                       break;
+               case StarDictPlugInType_NETDICT:
+                       NetDictPlugins.configure_plugin(filename);
+                       break;
+               case StarDictPlugInType_SPECIALDICT:
+                       SpecialDictPlugins.configure_plugin(filename);
+                       break;
+               case StarDictPlugInType_TTS:
+                       TtsPlugins.configure_plugin(filename);
+                       break;
+               case StarDictPlugInType_PARSEDATA:
+                       ParseDataPlugins.configure_plugin(filename);
+                       break;
+               case StarDictPlugInType_MISC:
+                       MiscPlugins.configure_plugin(filename);
+                       break;
+               default:
+                       break;
+       }
+}
+
+//
+// class StarDictVirtualDictPlugins begin.
+//
+
+StarDictVirtualDictPlugins::StarDictVirtualDictPlugins()
+{
+}
+
+StarDictVirtualDictPlugins::~StarDictVirtualDictPlugins()
+{
+       for (std::vector<StarDictVirtualDictPlugin *>::iterator i = oPlugins.begin(); i != oPlugins.end(); ++i) {
+               delete *i;
+       }
+}
+
+void StarDictVirtualDictPlugins::add(StarDictPluginBaseObject *baseobj, StarDictVirtualDictPlugInObject *virtualdict_plugin_obj)
+{
+       StarDictVirtualDictPlugin *plugin = new StarDictVirtualDictPlugin(baseobj, virtualdict_plugin_obj);
+       oPlugins.push_back(plugin);
+}
+
+void StarDictVirtualDictPlugins::unload_plugin(const char *filename)
+{
+       for (std::vector<StarDictVirtualDictPlugin *>::iterator iter = oPlugins.begin(); iter != oPlugins.end(); ++iter) {
+               if (strcmp((*iter)->get_filename(), filename) == 0) {
+                       delete *iter;
+                       oPlugins.erase(iter);
+                       break;
+               }
+       }
+}
+
+void StarDictVirtualDictPlugins::configure_plugin(const char *filename)
+{
+       for (std::vector<StarDictVirtualDictPlugin *>::iterator iter = oPlugins.begin(); iter != oPlugins.end(); ++iter) {
+               if (strcmp((*iter)->get_filename(), filename) == 0) {
+                       (*iter)->configure();
+                       break;
+               }
+       }
+}
+
+void StarDictVirtualDictPlugins::lookup(size_t iPlugin, const gchar *word, char ***pppWord, char ****ppppWordData)
+{
+       oPlugins[iPlugin]->lookup(word, pppWord, ppppWordData);
+}
+
+const char *StarDictVirtualDictPlugins::dict_name(size_t iPlugin)
+{
+       return oPlugins[iPlugin]->dict_name();
+}
+
+const char *StarDictVirtualDictPlugins::dict_id(size_t iPlugin)
+{
+       return oPlugins[iPlugin]->get_filename();
+}
+
+bool StarDictVirtualDictPlugins::find_dict_by_id(const char *id, size_t &iPlugin)
+{
+       for (std::vector<StarDictVirtualDictPlugin *>::size_type i = 0; i < oPlugins.size(); i++) {
+               if (strcmp(oPlugins[i]->get_filename(), id)==0) {
+                       iPlugin = i;
+                       return true;
+               }
+       }
+       return false;
+}
+
+//
+// class StarDictVirtualDictPlugin begin.
+//
+
+StarDictVirtualDictPlugin::StarDictVirtualDictPlugin(StarDictPluginBaseObject *baseobj_, StarDictVirtualDictPlugInObject *virtualdict_plugin_obj):
+       StarDictPluginBase(baseobj_)
+{
+       obj = virtualdict_plugin_obj;
+}
+
+StarDictVirtualDictPlugin::~StarDictVirtualDictPlugin()
+{
+       delete obj;
+}
+
+void StarDictVirtualDictPlugin::lookup(const char *word, char ***pppWord, char ****ppppWordData)
+{
+       obj->lookup_func(word, pppWord, ppppWordData);
+}
+
+const char *StarDictVirtualDictPlugin::dict_name()
+{
+       return obj->dict_name;
+}
+
+//
+// class StarDictNetDictPlugins begin.
+//
+
+StarDictNetDictPlugins::StarDictNetDictPlugins()
+{
+}
+
+StarDictNetDictPlugins::~StarDictNetDictPlugins()
+{
+       for (std::vector<StarDictNetDictPlugin *>::iterator i = oPlugins.begin(); i != oPlugins.end(); ++i) {
+               delete *i;
+       }
+}
+
+void StarDictNetDictPlugins::add(StarDictPluginBaseObject *baseobj, StarDictNetDictPlugInObject *netdict_plugin_obj)
+{
+       StarDictNetDictPlugin *plugin = new StarDictNetDictPlugin(baseobj, netdict_plugin_obj);
+       oPlugins.push_back(plugin);
+}
+
+void StarDictNetDictPlugins::unload_plugin(const char *filename)
+{
+       for (std::vector<StarDictNetDictPlugin *>::iterator iter = oPlugins.begin(); iter != oPlugins.end(); ++iter) {
+               if (strcmp((*iter)->get_filename(), filename) == 0) {
+                       delete *iter;
+                       oPlugins.erase(iter);
+                       break;
+               }
+       }
+}
+
+void StarDictNetDictPlugins::configure_plugin(const char *filename)
+{
+       for (std::vector<StarDictNetDictPlugin *>::iterator iter = oPlugins.begin(); iter != oPlugins.end(); ++iter) {
+               if (strcmp((*iter)->get_filename(), filename) == 0) {
+                       (*iter)->configure();
+                       break;
+               }
+       }
+}
+
+void StarDictNetDictPlugins::lookup(size_t iPlugin, const gchar *word, bool ismainwin)
+{
+       oPlugins[iPlugin]->lookup(word, ismainwin);
+}
+
+const char *StarDictNetDictPlugins::dict_name(size_t iPlugin)
+{
+       return oPlugins[iPlugin]->dict_name();
+}
+
+const char *StarDictNetDictPlugins::dict_id(size_t iPlugin)
+{
+       return oPlugins[iPlugin]->get_filename();
+}
+
+const char *StarDictNetDictPlugins::dict_cacheid(size_t iPlugin)
+{
+       return oPlugins[iPlugin]->dict_cacheid();
+}
+
+bool StarDictNetDictPlugins::find_dict_by_id(const char *id, size_t &iPlugin)
+{
+       for (std::vector<StarDictNetDictPlugin *>::size_type i = 0; i < oPlugins.size(); i++) {
+               if (strcmp(oPlugins[i]->get_filename(), id)==0) {
+                       iPlugin = i;
+                       return true;
+               }
+       }
+       return false;
+}
+
+//
+// class StarDictNetDictPlugin begin.
+//
+
+StarDictNetDictPlugin::StarDictNetDictPlugin(StarDictPluginBaseObject *baseobj_, StarDictNetDictPlugInObject *netdict_plugin_obj):
+       StarDictPluginBase(baseobj_)
+{
+       obj = netdict_plugin_obj;
+}
+
+StarDictNetDictPlugin::~StarDictNetDictPlugin()
+{
+       delete obj;
+}
+
+void StarDictNetDictPlugin::lookup(const char *word, bool ismainwin)
+{
+       obj->lookup_func(word, ismainwin);
+}
+
+const char *StarDictNetDictPlugin::dict_name()
+{
+       return obj->dict_name;
+}
+
+const char *StarDictNetDictPlugin::dict_cacheid()
+{
+       return obj->dict_cacheid;
+}
+
+//
+// class StarDictSpecialDictPlugins begin.
+//
+
+StarDictSpecialDictPlugins::StarDictSpecialDictPlugins()
+{
+}
+
+StarDictSpecialDictPlugins::~StarDictSpecialDictPlugins()
+{
+       for (std::vector<StarDictSpecialDictPlugin *>::iterator i = oPlugins.begin(); i != oPlugins.end(); ++i) {
+               delete *i;
+       }
+}
+
+void StarDictSpecialDictPlugins::add(StarDictPluginBaseObject *baseobj, StarDictSpecialDictPlugInObject *specialdict_plugin_obj)
+{
+       StarDictSpecialDictPlugin *plugin = new StarDictSpecialDictPlugin(baseobj, specialdict_plugin_obj);
+       oPlugins.push_back(plugin);
+}
+
+void StarDictSpecialDictPlugins::unload_plugin(const char *filename)
+{
+       for (std::vector<StarDictSpecialDictPlugin *>::iterator iter = oPlugins.begin(); iter != oPlugins.end(); ++iter) {
+               if (strcmp((*iter)->get_filename(), filename) == 0) {
+                       delete *iter;
+                       oPlugins.erase(iter);
+                       break;
+               }
+       }
+}
+
+void StarDictSpecialDictPlugins::configure_plugin(const char *filename)
+{
+       for (std::vector<StarDictSpecialDictPlugin *>::iterator iter = oPlugins.begin(); iter != oPlugins.end(); ++iter) {
+               if (strcmp((*iter)->get_filename(), filename) == 0) {
+                       (*iter)->configure();
+                       break;
+               }
+       }
+}
+
+void StarDictSpecialDictPlugins::render_widget(size_t iPlugin, bool ismainwin, size_t dictid, const gchar *orig_word, gchar **Word, gchar ***WordData, GtkWidget **widget)
+{
+       oPlugins[iPlugin]->render_widget(ismainwin, dictid, orig_word, Word, WordData, widget);
+}
+
+const char *StarDictSpecialDictPlugins::dict_type(size_t iPlugin)
+{
+       return oPlugins[iPlugin]->dict_type();
+}
+
+//
+// class StarDictSpecialDictPlugin begin.
+//
+
+StarDictSpecialDictPlugin::StarDictSpecialDictPlugin(StarDictPluginBaseObject *baseobj_, StarDictSpecialDictPlugInObject *specialdict_plugin_obj):
+       StarDictPluginBase(baseobj_)
+{
+       obj = specialdict_plugin_obj;
+}
+
+StarDictSpecialDictPlugin::~StarDictSpecialDictPlugin()
+{
+       delete obj;
+}
+
+void StarDictSpecialDictPlugin::render_widget(bool ismainwin, size_t dictid, const gchar *orig_word, gchar **Word, gchar ***WordData, GtkWidget **widget)
+{
+       obj->render_widget_func(ismainwin, dictid, orig_word, Word, WordData, widget);
+}
+
+const char *StarDictSpecialDictPlugin::dict_type()
+{
+       return obj->dict_type;
+}
+
+//
+// class StarDictTtsPlugins begin.
+//
+
+StarDictTtsPlugins::StarDictTtsPlugins()
+{
+}
+
+StarDictTtsPlugins::~StarDictTtsPlugins()
+{
+       for (std::vector<StarDictTtsPlugin *>::iterator i = oPlugins.begin(); i != oPlugins.end(); ++i) {
+               delete *i;
+       }
+}
+
+void StarDictTtsPlugins::add(StarDictPluginBaseObject *baseobj, StarDictTtsPlugInObject *tts_plugin_obj)
+{
+       StarDictTtsPlugin *plugin = new StarDictTtsPlugin(baseobj, tts_plugin_obj);
+       oPlugins.push_back(plugin);
+}
+
+void StarDictTtsPlugins::unload_plugin(const char *filename)
+{
+       for (std::vector<StarDictTtsPlugin *>::iterator iter = oPlugins.begin(); iter != oPlugins.end(); ++iter) {
+               if (strcmp((*iter)->get_filename(), filename) == 0) {
+                       delete *iter;
+                       oPlugins.erase(iter);
+                       break;
+               }
+       }
+}
+
+void StarDictTtsPlugins::configure_plugin(const char *filename)
+{
+       for (std::vector<StarDictTtsPlugin *>::iterator iter = oPlugins.begin(); iter != oPlugins.end(); ++iter) {
+               if (strcmp((*iter)->get_filename(), filename) == 0) {
+                       (*iter)->configure();
+                       break;
+               }
+       }
+}
+
+void StarDictTtsPlugins::saytext(size_t iPlugin, const gchar *text)
+{
+       oPlugins[iPlugin]->saytext(text);
+}
+
+const char *StarDictTtsPlugins::tts_name(size_t iPlugin)
+{
+       return oPlugins[iPlugin]->tts_name();
+}
+
+//
+// class StarDictTtsPlugin begin.
+//
+
+StarDictTtsPlugin::StarDictTtsPlugin(StarDictPluginBaseObject *baseobj_, StarDictTtsPlugInObject *tts_plugin_obj):
+       StarDictPluginBase(baseobj_)
+{
+       obj = tts_plugin_obj;
+}
+
+StarDictTtsPlugin::~StarDictTtsPlugin()
+{
+       delete obj;
+}
+
+void StarDictTtsPlugin::saytext(const char *text)
+{
+       obj->saytext_func(text);
+}
+
+const char *StarDictTtsPlugin::tts_name()
+{
+       return obj->tts_name;
+}
+
+//
+// class StarDictParseDataPlugins begin.
+//
+
+StarDictParseDataPlugins::StarDictParseDataPlugins()
+{
+}
+
+StarDictParseDataPlugins::~StarDictParseDataPlugins()
+{
+       for (std::vector<StarDictParseDataPlugin *>::iterator i = oPlugins.begin(); i != oPlugins.end(); ++i) {
+               delete *i;
+       }
+}
+
+void StarDictParseDataPlugins::add(StarDictPluginBaseObject *baseobj, StarDictParseDataPlugInObject *tts_plugin_obj)
+{
+       StarDictParseDataPlugin *plugin = new StarDictParseDataPlugin(baseobj, tts_plugin_obj);
+       oPlugins.push_back(plugin);
+}
+
+void StarDictParseDataPlugins::unload_plugin(const char *filename)
+{
+       for (std::vector<StarDictParseDataPlugin *>::iterator iter = oPlugins.begin(); iter != oPlugins.end(); ++iter) {
+               if (strcmp((*iter)->get_filename(), filename) == 0) {
+                       delete *iter;
+                       oPlugins.erase(iter);
+                       break;
+               }
+       }
+}
+
+void StarDictParseDataPlugins::configure_plugin(const char *filename)
+{
+       for (std::vector<StarDictParseDataPlugin *>::iterator iter = oPlugins.begin(); iter != oPlugins.end(); ++iter) {
+               if (strcmp((*iter)->get_filename(), filename) == 0) {
+                       (*iter)->configure();
+                       break;
+               }
+       }
+}
+
+bool StarDictParseDataPlugins::parse(size_t iPlugin, const char *p, unsigned int *parsed_size, ParseResult &result, const char *oword)
+{
+       return oPlugins[iPlugin]->parse(p, parsed_size, result, oword);
+}
+
+//
+// class StarDictParseDataPlugin begin.
+//
+
+StarDictParseDataPlugin::StarDictParseDataPlugin(StarDictPluginBaseObject *baseobj_, StarDictParseDataPlugInObject *parsedata_plugin_obj):
+       StarDictPluginBase(baseobj_)
+{
+       obj = parsedata_plugin_obj;
+}
+
+StarDictParseDataPlugin::~StarDictParseDataPlugin()
+{
+       delete obj;
+}
+
+bool StarDictParseDataPlugin::parse(const char *p, unsigned int *parsed_size, ParseResult &result, const char *oword)
+{
+       return obj->parse_func(p, parsed_size, result, oword);
+}
+
+//
+// class StarDictMiscPlugins begin.
+//
+
+StarDictMiscPlugins::StarDictMiscPlugins()
+{
+}
+
+StarDictMiscPlugins::~StarDictMiscPlugins()
+{
+       for (std::vector<StarDictMiscPlugin *>::iterator i = oPlugins.begin(); i != oPlugins.end(); ++i) {
+               delete *i;
+       }
+}
+
+void StarDictMiscPlugins::add(StarDictPluginBaseObject *baseobj)
+{
+       StarDictMiscPlugin *plugin = new StarDictMiscPlugin(baseobj);
+       oPlugins.push_back(plugin);
+}
+
+void StarDictMiscPlugins::unload_plugin(const char *filename)
+{
+       for (std::vector<StarDictMiscPlugin *>::iterator iter = oPlugins.begin(); iter != oPlugins.end(); ++iter) {
+               if (strcmp((*iter)->get_filename(), filename) == 0) {
+                       delete *iter;
+                       oPlugins.erase(iter);
+                       break;
+               }
+       }
+}
+
+void StarDictMiscPlugins::configure_plugin(const char *filename)
+{
+       for (std::vector<StarDictMiscPlugin *>::iterator iter = oPlugins.begin(); iter != oPlugins.end(); ++iter) {
+               if (strcmp((*iter)->get_filename(), filename) == 0) {
+                       (*iter)->configure();
+                       break;
+               }
+       }
+}
+
+//
+// class StarDictMiscPlugin begin.
+//
+
+StarDictMiscPlugin::StarDictMiscPlugin(StarDictPluginBaseObject *baseobj_):
+       StarDictPluginBase(baseobj_)
+{
+}
+
+StarDictMiscPlugin::~StarDictMiscPlugin()
+{
+}
+
+template<typename TV, typename TI>
+void plugins_reorder(TV &oPlugins, const std::list<std::string>& order_list)
+{
+       TV prev(oPlugins);
+       oPlugins.clear();
+       for (std::list<std::string>::const_iterator i = order_list.begin(); i != order_list.end(); ++i) {
+               for (TI j = prev.begin(); j != prev.end(); ++j) {
+                       if (*i == (*j)->get_filename()) {
+                               oPlugins.push_back(*j);
+                       }
+               }
+       }
+       for (TI i=prev.begin(); i!=prev.end(); ++i) {
+               TI j;
+               for (j=oPlugins.begin(); j!=oPlugins.end(); ++j) {
+                       if (*j == *i)
+                               break;
+               }
+               if (j == oPlugins.end())
+                       delete *i;
+       }
+}
+
+void StarDictVirtualDictPlugins::reorder(const std::list<std::string>& order_list)
+{
+       plugins_reorder<std::vector<StarDictVirtualDictPlugin *>, std::vector<StarDictVirtualDictPlugin *>::iterator>(oPlugins, order_list);
+}
+
+void StarDictNetDictPlugins::reorder(const std::list<std::string>& order_list)
+{
+       plugins_reorder<std::vector<StarDictNetDictPlugin *>, std::vector<StarDictNetDictPlugin *>::iterator>(oPlugins, order_list);
+}
+
+void StarDictSpecialDictPlugins::reorder(const std::list<std::string>& order_list)
+{
+       plugins_reorder<std::vector<StarDictSpecialDictPlugin *>, std::vector<StarDictSpecialDictPlugin *>::iterator>(oPlugins, order_list);
+}
+
+void StarDictTtsPlugins::reorder(const std::list<std::string>& order_list)
+{
+       plugins_reorder<std::vector<StarDictTtsPlugin *>, std::vector<StarDictTtsPlugin *>::iterator>(oPlugins, order_list);
+}
+
+void StarDictParseDataPlugins::reorder(const std::list<std::string>& order_list)
+{
+       plugins_reorder<std::vector<StarDictParseDataPlugin *>, std::vector<StarDictParseDataPlugin *>::iterator>(oPlugins, order_list);
+}
+
+void StarDictMiscPlugins::reorder(const std::list<std::string>& order_list)
+{
+       plugins_reorder<std::vector<StarDictMiscPlugin *>, std::vector<StarDictMiscPlugin *>::iterator>(oPlugins, order_list);
+}
diff --git a/src/lib/pluginmanager.h b/src/lib/pluginmanager.h
new file mode 100644 (file)
index 0000000..c864ebb
--- /dev/null
@@ -0,0 +1,215 @@
+#ifndef _STARDICT_PLUG_MANAGER_H_
+#define _STARDICT_PLUG_MANAGER_H_
+
+#include "plugin.h"
+#include "virtualdictplugin.h"
+#include "netdictplugin.h"
+#include "specialdictplugin.h"
+#include "ttsplugin.h"
+#include "parsedata_plugin.h"
+#include <glib.h>
+#include <gmodule.h>
+#include <string>
+#include <vector>
+#include <list>
+#include "dictmask.h"
+
+struct StarDictPluginBaseObject {
+       StarDictPluginBaseObject(const char *filename, GModule *module_, plugin_configure_func_t configure_func_);
+       std::string plugin_filename;
+       GModule *module;
+       plugin_configure_func_t configure_func;
+};
+
+class StarDictPluginBase {
+public:
+       StarDictPluginBase(StarDictPluginBaseObject *baseobj_);
+       ~StarDictPluginBase();
+       const char *get_filename();
+       void configure();
+protected:
+       StarDictPluginBaseObject *baseobj;
+};
+
+class StarDictVirtualDictPlugin : public StarDictPluginBase {
+public:
+       StarDictVirtualDictPlugin(StarDictPluginBaseObject *baseobj, StarDictVirtualDictPlugInObject *virtualdict_plugin_obj);
+       ~StarDictVirtualDictPlugin();
+       void lookup(const char *word, char ***pppWord, char ****ppppWordData);
+       const char *dict_name();
+       const char *dict_id();
+private:
+       StarDictVirtualDictPlugInObject *obj;
+};
+
+class StarDictVirtualDictPlugins {
+public:
+       StarDictVirtualDictPlugins();
+       ~StarDictVirtualDictPlugins();
+       void add(StarDictPluginBaseObject *baseobj, StarDictVirtualDictPlugInObject *virtualdict_plugin_obj);
+       void lookup(size_t iPlugin, const gchar *word, char ***pppWord, char ****ppppWordData);
+       size_t ndicts() { return oPlugins.size(); }
+       const char *dict_name(size_t iPlugin);
+       const char *dict_id(size_t iPlugin);
+       bool find_dict_by_id(const char *id, size_t &iPlugin);
+       void unload_plugin(const char *filename);
+       void configure_plugin(const char *filename);
+       void reorder(const std::list<std::string>& order_list);
+private:
+       std::vector<StarDictVirtualDictPlugin *> oPlugins;
+};
+
+class StarDictNetDictPlugin : public StarDictPluginBase {
+public:
+       StarDictNetDictPlugin(StarDictPluginBaseObject *baseobj, StarDictNetDictPlugInObject *netdict_plugin_obj);
+       ~StarDictNetDictPlugin();
+       void lookup(const char *word, bool ismainwin);
+       const char *dict_name();
+       const char *dict_id();
+       const char *dict_cacheid();
+private:
+       StarDictNetDictPlugInObject *obj;
+};
+
+class StarDictNetDictPlugins {
+public:
+       StarDictNetDictPlugins();
+       ~StarDictNetDictPlugins();
+       void add(StarDictPluginBaseObject *baseobj, StarDictNetDictPlugInObject *netdict_plugin_obj);
+       void lookup(size_t iPlugin, const gchar *word, bool ismainwin);
+       size_t ndicts() { return oPlugins.size(); }
+       const char *dict_name(size_t iPlugin);
+       const char *dict_id(size_t iPlugin);
+       const char *dict_cacheid(size_t iPlugin);
+       bool find_dict_by_id(const char *id, size_t &iPlugin);
+       void unload_plugin(const char *filename);
+       void configure_plugin(const char *filename);
+       void reorder(const std::list<std::string>& order_list);
+private:
+       std::vector<StarDictNetDictPlugin *> oPlugins;
+};
+
+class StarDictSpecialDictPlugin : public StarDictPluginBase {
+public:
+       StarDictSpecialDictPlugin(StarDictPluginBaseObject *baseobj, StarDictSpecialDictPlugInObject *speicaldict_plugin_obj);
+       ~StarDictSpecialDictPlugin();
+       void render_widget(bool ismainwin, size_t dictid, const gchar *orig_word, gchar **Word, gchar ***WordData, GtkWidget **widget);
+       const char *dict_type();
+private:
+       StarDictSpecialDictPlugInObject *obj;
+};
+
+class StarDictSpecialDictPlugins {
+public:
+       StarDictSpecialDictPlugins();
+       ~StarDictSpecialDictPlugins();
+       void add(StarDictPluginBaseObject *baseobj, StarDictSpecialDictPlugInObject *specialdict_plugin_obj);
+       void render_widget(size_t iPlugin, bool ismainwin, size_t dictid, const gchar *orig_word, gchar **Word, gchar ***WordData, GtkWidget **widget);
+       size_t nplugins() { return oPlugins.size(); }
+       const char *dict_type(size_t iPlugin);
+       void unload_plugin(const char *filename);
+       void configure_plugin(const char *filename);
+       void reorder(const std::list<std::string>& order_list);
+private:
+       std::vector<StarDictSpecialDictPlugin *> oPlugins;
+};
+
+class StarDictTtsPlugin : public StarDictPluginBase {
+public:
+       StarDictTtsPlugin(StarDictPluginBaseObject *baseobj, StarDictTtsPlugInObject *tts_plugin_obj);
+       ~StarDictTtsPlugin();
+       void saytext(const gchar *text);
+       const char *tts_name();
+private:
+       StarDictTtsPlugInObject *obj;
+};
+
+class StarDictTtsPlugins {
+public:
+       StarDictTtsPlugins();
+       ~StarDictTtsPlugins();
+       void add(StarDictPluginBaseObject *baseobj, StarDictTtsPlugInObject *tts_plugin_obj);
+       void saytext(size_t iPlugin, const gchar *text);
+       const char* tts_name(size_t iPlugin);
+       size_t nplugins() { return oPlugins.size(); }
+       void unload_plugin(const char *filename);
+       void configure_plugin(const char *filename);
+       void reorder(const std::list<std::string>& order_list);
+private:
+       std::vector<StarDictTtsPlugin *> oPlugins;
+};
+
+class StarDictParseDataPlugin : public StarDictPluginBase {
+public:
+       StarDictParseDataPlugin(StarDictPluginBaseObject *baseobj, StarDictParseDataPlugInObject *parsedata_plugin_obj);
+       ~StarDictParseDataPlugin();
+       bool parse(const char *p, unsigned int *parsed_size, ParseResult &result, const char *oword);
+private:
+       StarDictParseDataPlugInObject *obj;
+};
+
+class StarDictParseDataPlugins {
+public:
+       StarDictParseDataPlugins();
+       ~StarDictParseDataPlugins();
+       void add(StarDictPluginBaseObject *baseobj, StarDictParseDataPlugInObject *parsedata_plugin_obj);
+       bool parse(size_t iPlugin, const char *p, unsigned int *parsed_size, ParseResult &result, const char *oword);
+       size_t nplugins() { return oPlugins.size(); }
+       void unload_plugin(const char *filename);
+       void configure_plugin(const char *filename);
+       void reorder(const std::list<std::string>& order_list);
+private:
+       std::vector<StarDictParseDataPlugin *> oPlugins;
+};
+
+class StarDictMiscPlugin : public StarDictPluginBase {
+public:
+       StarDictMiscPlugin(StarDictPluginBaseObject *baseobj);
+       ~StarDictMiscPlugin();
+};
+
+class StarDictMiscPlugins {
+public:
+       StarDictMiscPlugins();
+       ~StarDictMiscPlugins();
+       void add(StarDictPluginBaseObject *baseobj);
+       void unload_plugin(const char *filename);
+       void configure_plugin(const char *filename);
+       void reorder(const std::list<std::string>& order_list);
+private:
+       std::vector<StarDictMiscPlugin *> oPlugins;
+};
+
+struct StarDictPluginInfo {
+       std::string filename;
+       StarDictPlugInType plugin_type;
+       std::string info_xml;
+       bool can_configure;
+};
+
+class StarDictPlugins {
+public:
+       StarDictPlugins(const char *dirpath, const std::list<std::string>& order_list, const std::list<std::string>& disable_list);
+       ~StarDictPlugins();
+       void get_plugin_list(const std::list<std::string>& order_list, std::list<std::pair<StarDictPlugInType, std::list<StarDictPluginInfo> > > &plugin_list);
+       bool get_loaded(const char *filename);
+       void load_plugin(const char *filename);
+       void configure_plugin(const char *filename, StarDictPlugInType plugin_type);
+       void unload_plugin(const char *filename, StarDictPlugInType plugin_type);
+       void reorder(const std::list<std::string>& order_list);
+       StarDictVirtualDictPlugins VirtualDictPlugins;
+       StarDictNetDictPlugins NetDictPlugins;
+       StarDictSpecialDictPlugins SpecialDictPlugins;
+       StarDictTtsPlugins TtsPlugins;
+       StarDictParseDataPlugins ParseDataPlugins;
+private:
+       StarDictMiscPlugins MiscPlugins;
+       std::string plugindirpath;
+       std::list<std::string> loaded_plugin_list;
+       void load(const char *dirpath, const std::list<std::string>& order_list, const std::list<std::string>& disable_list);
+       void get_plugin_info(const char *filename, StarDictPlugInType &plugin_type, std::string &info_xml, bool &can_configure);
+       friend class PluginLoader;
+       friend class PluginInfoLoader;
+};
+
+#endif
diff --git a/src/lib/sockets.cpp b/src/lib/sockets.cpp
new file mode 100644 (file)
index 0000000..3a9388e
--- /dev/null
@@ -0,0 +1,329 @@
+#ifdef HAVE_CONFIG_H\r
+#  include "config.h"\r
+#endif\r
+\r
+\r
+#include <cstdio>\r
+#include <cstring>\r
+#include <glib.h>\r
+\r
+#if defined(_WIN32)\r
+\r
+# include <winsock2.h>\r
+\r
+#if defined(_MSC_VER)\r
+#pragma comment(lib,"WS2_32.lib")\r
+#endif\r
+\r
+# define EINPROGRESS   WSAEINPROGRESS\r
+# define EWOULDBLOCK   WSAEWOULDBLOCK\r
+# define ETIMEDOUT         WSAETIMEDOUT\r
+# define EAGAIN                        WSAEWOULDBLOCK\r
+# define EINTR                 WSAEINTR\r
+#else\r
+extern "C" {\r
+# include <unistd.h>\r
+# include <sys/types.h>\r
+# include <sys/socket.h>\r
+# include <netinet/in.h>\r
+# include <netdb.h>\r
+# include <cerrno>\r
+# include <fcntl.h>\r
+}\r
+#endif  // _WIN32\r
+\r
+#include "sockets.hpp"\r
+\r
+std::map<std::string, in_addr_t> Socket::dns_map;\r
+\r
+#if defined(_WIN32)\r
+  \r
+static void initWinSock()\r
+{\r
+  static bool wsInit = false;\r
+  if (! wsInit)\r
+  {\r
+    WORD wVersionRequested = MAKEWORD( 2, 0 );\r
+    WSADATA wsaData;\r
+    WSAStartup(wVersionRequested, &wsaData);\r
+    wsInit = true;\r
+  }\r
+}\r
+\r
+#else\r
+\r
+#define initWinSock()\r
+\r
+#endif // _WIN32\r
+\r
+\r
+// These errors are not considered fatal for an IO operation; the operation will be re-tried.\r
+\r
+static inline bool\r
+nonFatalError()\r
+{\r
+  int err = Socket::get_error_code();\r
+  return (err == EINPROGRESS || err == EAGAIN || err == EWOULDBLOCK || err == EINTR);\r
+}\r
+\r
+\r
+\r
+int\r
+Socket::socket()\r
+{\r
+  initWinSock();\r
+  return (int) ::socket(AF_INET, SOCK_STREAM, 0);\r
+}\r
+\r
+\r
+void\r
+Socket::close(int fd)\r
+{\r
+#if defined(_WIN32)\r
+  closesocket(fd);\r
+#else\r
+  ::close(fd);\r
+#endif // _WIN32\r
+}\r
+\r
+\r
+\r
+\r
+bool\r
+Socket::set_non_blocking(int fd)\r
+{\r
+#if defined(_WIN32)\r
+  unsigned long flag = 1;\r
+  return (ioctlsocket((SOCKET)fd, FIONBIO, &flag) == 0);\r
+#else\r
+  return (fcntl(fd, F_SETFL, O_NONBLOCK) == 0);\r
+#endif // _WIN32\r
+}\r
+\r
+\r
+bool\r
+Socket::set_reuse_addr(int fd)\r
+{\r
+  // Allow this port to be re-bound immediately so server re-starts are not delayed\r
+  int sflag = 1;\r
+  return (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const char *)&sflag, sizeof(sflag)) == 0);\r
+}\r
+\r
+\r
+// Bind to a specified port\r
+bool \r
+Socket::bind(int fd, int port)\r
+{\r
+  struct sockaddr_in saddr;\r
+  memset(&saddr, 0, sizeof(saddr));\r
+  saddr.sin_family = AF_INET;\r
+  saddr.sin_addr.s_addr = htonl(INADDR_ANY);\r
+  saddr.sin_port = htons((u_short) port);\r
+  return (::bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) == 0);\r
+}\r
+\r
+\r
+// Set socket in listen mode\r
+bool Socket::listen(int fd, int backlog)\r
+{\r
+  return (::listen(fd, backlog) == 0);\r
+}\r
+\r
+\r
+int Socket::accept(int fd)\r
+{\r
+  struct sockaddr_in addr;\r
+#if defined(_WIN32)\r
+  int\r
+#else\r
+  socklen_t\r
+#endif\r
+    addrlen = sizeof(addr);\r
+\r
+  return (int) ::accept(fd, (struct sockaddr*)&addr, &addrlen);\r
+}\r
+\r
+gboolean Socket::dns_main_thread_cb(gpointer data)\r
+{\r
+    DnsQueryData *query_data = (DnsQueryData *)data;\r
+    if (query_data->resolved) {\r
+               dns_map[query_data->host] = query_data->sa;\r
+       }\r
+    query_data->func(query_data->data, query_data->resolved, query_data->sa);\r
+    delete query_data;\r
+    return FALSE;\r
+}\r
+\r
+gpointer Socket::dns_thread(gpointer data)\r
+{\r
+    DnsQueryData *query_data = (DnsQueryData *)data;\r
+    struct  hostent *phost;\r
+#ifndef _WIN32    \r
+    struct  hostent hostinfo;\r
+    char buf[1024];\r
+    int ret;\r
+    if (!gethostbyname_r(query_data->host.c_str(), &hostinfo, buf,\r
+        sizeof(buf), &phost, &ret)) {\r
+       query_data->sa = ((in_addr*)(hostinfo.h_addr))->s_addr;\r
+        query_data->resolved = true;\r
+    } else {\r
+        query_data->resolved = false;\r
+    }\r
+#else\r
+       //static GStaticMutex mutex = G_STATIC_MUTEX_INIT;\r
+       //g_static_mutex_lock (&mutex);\r
+       if (isalpha(query_data->host[0])) {\r
+               phost = gethostbyname(query_data->host.c_str());\r
+       } else {\r
+               unsigned int addr;\r
+               addr = inet_addr(query_data->host.c_str());\r
+               phost = gethostbyaddr((char *)&addr, 4, AF_INET);\r
+       }\r
+       if (phost) {\r
+               query_data->sa = ((in_addr*)(phost->h_addr))->s_addr;\r
+               query_data->resolved = true;\r
+       } else {\r
+               query_data->resolved = false;\r
+       }\r
+       //g_static_mutex_unlock (&mutex);\r
+#endif                     \r
+    /* back to main thread */\r
+    g_idle_add(dns_main_thread_cb, query_data);\r
+    return NULL;\r
+}\r
+\r
+void Socket::resolve(std::string& host, gpointer data, on_resolved_func func)\r
+{\r
+       initWinSock();\r
+       std::map<std::string, in_addr_t>::iterator iter;\r
+       iter = dns_map.find(host);\r
+       if (iter != dns_map.end()) {\r
+               func(data, true, iter->second);\r
+               return;\r
+       }\r
+       DnsQueryData *query_data = new DnsQueryData();\r
+       query_data->host = host;\r
+       query_data->data = data;\r
+       query_data->func = func;\r
+       g_thread_create(dns_thread, query_data, FALSE, NULL);\r
+}\r
+\r
+void Socket::connect(int socket, in_addr_t sa, int port, gpointer data, on_connected_func func)\r
+{\r
+       ConnectData *connect_data = new ConnectData();\r
+       connect_data->sd = socket;\r
+       connect_data->sa = sa;\r
+       connect_data->port = port;\r
+       connect_data->data = data;\r
+       connect_data->func = func;\r
+       g_thread_create(connect_thread, connect_data, FALSE, NULL);\r
+}\r
+\r
+gpointer Socket::connect_thread(gpointer data)\r
+{\r
+    ConnectData *connect_data = (ConnectData *)data;\r
+       struct sockaddr_in saddr;\r
+       memset(&saddr, 0, sizeof(saddr));\r
+       saddr.sin_family = AF_INET;\r
+       saddr.sin_addr.s_addr = connect_data->sa;\r
+       saddr.sin_port = htons((u_short) connect_data->port);\r
+\r
+       // For asynch operation, this will return EWOULDBLOCK (windows) or\r
+       // EINPROGRESS (linux) and we just need to wait for the socket to be writable...\r
+       int result = ::connect(connect_data->sd, (struct sockaddr *)&saddr, sizeof(saddr));\r
+       connect_data->succeeded = (result == 0);\r
+\r
+    /* back to main thread */\r
+    g_idle_add(connect_main_thread_cb, connect_data);\r
+    return NULL;\r
+}\r
+\r
+gboolean Socket::connect_main_thread_cb(gpointer data)\r
+{\r
+    ConnectData *connect_data = (ConnectData *)data;\r
+       connect_data->func(connect_data->data, connect_data->succeeded);\r
+    delete connect_data;\r
+    return FALSE;\r
+}\r
+    \r
+// Read available text from the specified socket. Returns false on error.\r
+bool Socket::nb_read(int fd, std::string& s, bool *eof)\r
+{\r
+  const int READ_SIZE = 4096;   // Number of bytes to attempt to read at a time\r
+  char readBuf[READ_SIZE];\r
+\r
+  bool wouldBlock = false;\r
+  *eof = false;\r
+\r
+  while ( ! wouldBlock && ! *eof) {\r
+#if defined(_WIN32)\r
+    int n = recv(fd, readBuf, READ_SIZE-1, 0);\r
+#else\r
+    int n = read(fd, readBuf, READ_SIZE-1);\r
+#endif\r
+    g_debug("Socket::nbRead: read/recv returned %d.", n);\r
+\r
+\r
+    if (n > 0) {\r
+      readBuf[n] = 0;\r
+      s.append(readBuf, n);\r
+    } else if (n == 0) {\r
+      *eof = true;\r
+    } else if (nonFatalError()) {\r
+      wouldBlock = true;\r
+    } else {\r
+      return false;   // Error\r
+    }\r
+  }\r
+  return true;\r
+}\r
+\r
+\r
+// Write text to the specified socket. Returns false on error.\r
+bool Socket::nb_write(int fd, std::string& s, int *bytesSoFar)\r
+{\r
+  int nToWrite = int(s.length()) - *bytesSoFar;\r
+  char *sp = const_cast<char*>(s.c_str()) + *bytesSoFar;\r
+  bool wouldBlock = false;\r
+\r
+  while ( nToWrite > 0 && ! wouldBlock ) {\r
+#if defined(_WIN32)\r
+    int n = send(fd, sp, nToWrite, 0);\r
+#else\r
+    int n = write(fd, sp, nToWrite);\r
+#endif\r
+    g_debug("Socket::nbWrite: send/write returned %d.", n);\r
+\r
+    if (n > 0) {\r
+      sp += n;\r
+      *bytesSoFar += n;\r
+      nToWrite -= n;\r
+    } else if (nonFatalError()) {\r
+      wouldBlock = true;\r
+    } else {\r
+      return false;   // Error\r
+    }\r
+  }\r
+  return true;\r
+}\r
+\r
+\r
+// Returns last errno\r
+int Socket::get_error_code()\r
+{\r
+#if defined(_WIN32)\r
+  return WSAGetLastError();\r
+#else\r
+  return errno;\r
+#endif\r
+}\r
+\r
+\r
+// Returns message corresponding to last errno\r
+std::string Socket::get_error_msg()\r
+{\r
+//Actually works on windows, but may be better use FormatMessage?\r
+  return strerror(get_error_code());\r
+\r
+}\r
+\r
diff --git a/src/lib/sockets.hpp b/src/lib/sockets.hpp
new file mode 100644 (file)
index 0000000..25cedfe
--- /dev/null
@@ -0,0 +1,84 @@
+#ifndef _SOCKETS_HPP_\r
+#define _SOCKETS_HPP_\r
+\r
+#include <glib.h>\r
+#include <string>\r
+#include <map>\r
+#ifndef _WIN32\r
+#  include <netdb.h>\r
+#else\r
+#  include <WinSock.h>\r
+typedef unsigned long in_addr_t;\r
+#endif\r
+\r
+//! A platform-independent socket API.\r
+class Socket {\r
+public:\r
+       //! Creates a stream (TCP) socket. Returns -1 on failure.\r
+       static int socket();\r
+\r
+       //! Closes a socket.\r
+       static void close(int socket);\r
+\r
+       //! Sets a stream (TCP) socket to perform non-blocking IO. Returns false on failure.\r
+       static bool set_non_blocking(int socket);\r
+\r
+       //! Read text from the specified socket. Returns false on error.\r
+       static bool nb_read(int socket, std::string& s, bool *eof);\r
+\r
+       //! Write text to the specified socket. Returns false on error.\r
+       static bool nb_write(int socket, std::string& s, int *bytesSoFar);\r
+\r
+       // The next four methods are appropriate for servers.\r
+\r
+       //! Allow the port the specified socket is bound to to be re-bound immediately so \r
+       //! server re-starts are not delayed. Returns false on failure.\r
+       static bool set_reuse_addr(int socket);\r
+\r
+       //! Bind to a specified port\r
+       static bool bind(int socket, int port);\r
+\r
+       //! Set socket in listen mode\r
+       static bool listen(int socket, int backlog);\r
+\r
+       //! Accept a client connection request\r
+       static int accept(int socket);\r
+\r
+       typedef void (*on_resolved_func)(gpointer data, bool resolved, in_addr_t sa);\r
+       static void resolve(std::string& host, gpointer data, on_resolved_func func);\r
+\r
+       //! Connect a socket to a server (from a client)\r
+       typedef void (*on_connected_func)(gpointer data, bool succeeded);\r
+       static void connect(int socket, in_addr_t sa, int port, gpointer data, on_connected_func func);\r
+\r
+\r
+       //! Returns last errno\r
+       static int get_error_code();\r
+\r
+       //! Returns message corresponding to last error\r
+       static std::string get_error_msg();\r
+private:\r
+       struct DnsQueryData {\r
+               std::string host;\r
+               gpointer data;\r
+               on_resolved_func func;\r
+               bool resolved;\r
+               in_addr_t sa;\r
+    };\r
+    static gpointer dns_thread(gpointer data);\r
+    static gboolean dns_main_thread_cb(gpointer data);\r
+       static std::map<std::string, in_addr_t> dns_map;\r
+       struct ConnectData {\r
+               int sd;\r
+               in_addr_t sa;\r
+               int port;\r
+               gpointer data;\r
+               on_connected_func func;\r
+               bool succeeded;\r
+    };\r
+    static gpointer connect_thread(gpointer data);\r
+    static gboolean connect_main_thread_cb(gpointer data);\r
+};\r
+\r
+\r
+#endif//!_SOCKETS_HPP_\r
diff --git a/src/lib/specialdictplugin.cpp b/src/lib/specialdictplugin.cpp
new file mode 100644 (file)
index 0000000..cad5836
--- /dev/null
@@ -0,0 +1,6 @@
+#include "specialdictplugin.h"
+
+StarDictSpecialDictPlugInObject::StarDictSpecialDictPlugInObject()
+{
+       render_widget_func = 0;
+}
diff --git a/src/lib/specialdictplugin.h b/src/lib/specialdictplugin.h
new file mode 100644 (file)
index 0000000..51751b7
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef _STARDICT_SPECIALDICT_PLUGIN_H_
+#define _STARDICT_SPECIALDICT_PLUGIN_H_
+
+#include <gtk/gtk.h>
+
+struct StarDictSpecialDictPlugInObject{
+       StarDictSpecialDictPlugInObject();
+
+       typedef void (*render_widget_func_t)(bool ismainwin, size_t dictid, const gchar *orig_word, gchar **Word, gchar ***WordData, GtkWidget **widget);
+       render_widget_func_t render_widget_func;
+       const char *dict_type;
+};
+
+#endif
diff --git a/src/lib/stardict_client.cpp b/src/lib/stardict_client.cpp
new file mode 100644 (file)
index 0000000..dcae5ce
--- /dev/null
@@ -0,0 +1,1263 @@
+/*
+ * This file part of StarDict - A international dictionary for GNOME.
+ * http://stardict.sourceforge.net
+ * Copyright (C) 2006 Hu Zheng <huzheng_001@163.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <glib.h>
+#include <glib/gi18n.h>
+
+#include "sockets.hpp"
+#include "md5.h"
+#include "getuint32.h"
+
+#include "stardict_client.hpp"
+
+#define PROTOCOL_VERSION "0.3"
+
+#define CODE_HELLO                   220 /* text msg-id */
+#define CODE_GOODBYE                 221 /* Closing Connection */
+#define CODE_OK                      250 /* ok */
+#define CODE_TEMPORARILY_UNAVAILABLE 420 /* server unavailable */
+#define CODE_SYNTAX_ERROR            500 /* syntax, command not recognized */
+#define CODE_DENIED                  521
+#define CODE_DICTMASK_NOTSET         522
+
+unsigned int STARDICT::Cmd::next_seq = 1;
+
+sigc::signal<void, const char *> StarDictClient::on_error_;
+sigc::signal<void, const struct STARDICT::LookupResponse *, unsigned int> StarDictClient::on_lookup_end_;
+sigc::signal<void, const struct STARDICT::LookupResponse *, unsigned int> StarDictClient::on_floatwin_lookup_end_;
+sigc::signal<void, const char *> StarDictClient::on_register_end_;
+sigc::signal<void, const char *> StarDictClient::on_getdictmask_end_;
+sigc::signal<void, const char *> StarDictClient::on_dirinfo_end_;
+sigc::signal<void, const char *> StarDictClient::on_dictinfo_end_;
+sigc::signal<void, int> StarDictClient::on_maxdictcount_end_;
+sigc::signal<void, std::list<char *> *> StarDictClient::on_previous_end_;
+sigc::signal<void, std::list<char *> *> StarDictClient::on_next_end_;
+
+static void arg_escape(std::string &earg, const char *arg)
+{
+    earg.clear();
+    while (*arg) {
+        if (*arg=='\\') {
+            earg+="\\\\";
+        } else if (*arg==' ') {
+            earg+="\\ ";
+        } else if (*arg=='\n') {
+            earg+="\\n";
+        } else {
+            earg+=*arg;
+        }
+        arg++;
+    }
+}
+
+STARDICT::Cmd::Cmd(int cmd, ...)
+{
+       this->seq = this->next_seq;
+       this->next_seq++;
+       this->reading_status = 0;
+       this->command = cmd;
+       va_list    ap;
+       va_start( ap, cmd );
+       switch (cmd) {
+       case CMD_CLIENT:
+       {
+               const char *client_name = va_arg( ap, const char * );
+               std::string earg1, earg2;
+               arg_escape(earg1, PROTOCOL_VERSION);
+               arg_escape(earg2, client_name);
+               this->data = g_strdup_printf("client %s %s\n", earg1.c_str(), earg2.c_str());
+               break;
+       }
+       case CMD_REGISTER:
+       {
+               const char *user = va_arg( ap, const char * );
+               const char *passwd = va_arg( ap, const char * );
+               const char *email = va_arg( ap, const char * );
+               std::string earg1, earg2, earg3;
+               arg_escape(earg1, user);
+               arg_escape(earg2, passwd);
+               arg_escape(earg3, email);
+               this->data = g_strdup_printf("register %s %s %s\n", earg1.c_str(), earg2.c_str(), earg3.c_str());
+               break;
+       }
+       /*case CMD_CHANGE_PASSWD:
+       {
+               const char *user = va_arg( ap, const char * );
+               const char *old_passwd = va_arg( ap, const char * );
+               const char *new_passwd = va_arg( ap, const char * );
+               std::string earg1, earg2, earg3;
+               arg_escape(earg1, user);
+               arg_escape(earg2, old_passwd);
+               arg_escape(earg3, new_passwd);
+               this->data = g_strdup_printf("change_password %s %s %s\n", earg1.c_str(), earg2.c_str(), earg3.c_str());
+               break;
+       }*/
+       case CMD_AUTH:
+        this->auth = new AuthInfo();
+               this->auth->user = va_arg( ap, const char * );
+               this->auth->passwd = va_arg( ap, const char * );
+               break;
+       case CMD_LOOKUP:
+       {
+               std::string earg;
+               arg_escape(earg, va_arg( ap, const char * ));
+               this->data = g_strdup_printf("lookup %s 30\n", earg.c_str());
+               this->lookup_response = NULL;
+               break;
+       }
+       case CMD_PREVIOUS:
+       {
+               std::string earg;
+               arg_escape(earg, va_arg( ap, const char * ));
+               this->data = g_strdup_printf("previous %s 15\n", earg.c_str());
+        this->wordlist_response = NULL;
+               break;
+       }
+       case CMD_NEXT:
+       {
+               std::string earg;
+               arg_escape(earg, va_arg( ap, const char * ));
+               this->data = g_strdup_printf("next %s 30\n", earg.c_str());
+               this->wordlist_response = NULL;
+               break;
+       }
+       /*case CMD_QUERY:
+       {
+               std::string earg;
+               arg_escape(earg, va_arg( ap, const char * ));
+               this->data = g_strdup_printf("query %s\n", earg.c_str());
+               this->lookup_response = NULL;
+               break;
+       }*/
+       case CMD_SELECT_QUERY:
+       {
+               std::string earg;
+               arg_escape(earg, va_arg( ap, const char * ));
+               this->data = g_strdup_printf("selectquery %s\n", earg.c_str());
+               this->lookup_response = NULL;
+               break;
+       }
+       case CMD_SMART_QUERY:
+       {
+               std::string earg;
+               arg_escape(earg, va_arg( ap, const char * ));
+               int BeginPos = va_arg( ap, int );
+               this->data = g_strdup_printf("smartquery %s %d\n", earg.c_str(), BeginPos);
+               this->lookup_response = NULL;
+               break;
+       }
+       case CMD_DEFINE:
+       {
+               std::string earg;
+               arg_escape(earg, va_arg( ap, const char * ));
+               this->data = g_strdup_printf("define %s\n", earg.c_str());
+               this->lookup_response = NULL;
+               break;
+       }
+       case CMD_SET_DICT_MASK:
+       {
+               std::string earg;
+               arg_escape(earg, va_arg( ap, const char * ));
+               this->data = g_strdup_printf("setdictmask %s\n", earg.c_str());
+               break;
+       }
+       case CMD_GET_DICT_MASK:
+               this->data = g_strdup("getdictmask\n");
+               break;
+       /*case CMD_SET_COLLATE_FUNC:
+       {
+               std::string earg;
+               arg_escape(earg, va_arg( ap, const char * ));
+               this->data = g_strdup_printf("setcollatefunc %s\n", earg.c_str());
+               break;
+       }
+       case CMD_GET_COLLATE_FUNC:
+               this->data = g_strdup("getcollatefunc\n");
+               break;
+       case CMD_SET_LANGUAGE:
+       {
+               std::string earg;
+               arg_escape(earg, va_arg( ap, const char * ));
+               this->data = g_strdup_printf("setlanguage %s\n", earg.c_str());
+               break;
+       }
+       case CMD_GET_LANGUAGE:
+               this->data = g_strdup("getlanguage\n");
+               break;
+       case CMD_SET_EMAIL:
+       {
+               std::string earg;
+               arg_escape(earg, va_arg( ap, const char * ));
+               this->data = g_strdup_printf("setemail %s\n", earg.c_str());
+               break;
+       }
+       case CMD_GET_EMAIL:
+               this->data = g_strdup("getemail\n");
+               break;
+       case CMD_GET_USER_LEVEL:
+               this->data = g_strdup("getuserlevel\n");
+               break;*/
+       case CMD_MAX_DICT_COUNT:
+               this->data = g_strdup("maxdictcount\n");
+               break;
+       case CMD_DIR_INFO:
+       {
+               std::string earg;
+               arg_escape(earg, va_arg( ap, const char * ));
+               this->data = g_strdup_printf("dirinfo %s\n", earg.c_str());
+               break;
+       }
+       case CMD_DICT_INFO:
+       {
+               std::string earg;
+               arg_escape(earg, va_arg( ap, const char * ));
+               this->data = g_strdup_printf("dictinfo %s\n", earg.c_str());
+               break;
+       }
+       /*case CMD_USER_LEVEL:
+       {
+               std::string earg1, earg2, earg3;
+               arg_escape(earg1, va_arg( ap, const char * ));
+               arg_escape(earg2, va_arg( ap, const char * ));
+               arg_escape(earg3, va_arg( ap, const char * ));
+               this->data = g_strdup_printf("userlevel %s %s %s\n", earg1.c_str(), earg2.c_str(), earg3.c_str());
+               break;
+       }*/
+       case CMD_QUIT:
+               this->data = g_strdup("quit\n");
+               break;
+       }
+       va_end( ap );
+}
+
+STARDICT::LookupResponse::DictResponse::DictResponse()
+{
+       oword = NULL;
+}
+
+STARDICT::LookupResponse::DictResponse::~DictResponse()
+{
+       g_free(oword);
+       for (std::list<DictResult *>::iterator i = dict_result_list.begin(); i != dict_result_list.end(); ++i) {
+               delete *i;
+       }
+}
+
+STARDICT::LookupResponse::DictResponse::DictResult::DictResult()
+{
+       bookname = NULL;
+}
+
+STARDICT::LookupResponse::DictResponse::DictResult::~DictResult()
+{
+       g_free(bookname);
+       for (std::list<WordResult *>::iterator i = word_result_list.begin(); i != word_result_list.end(); ++i) {
+               delete *i;
+       }
+}
+
+STARDICT::LookupResponse::DictResponse::DictResult::WordResult::WordResult()
+{
+       word = NULL;
+}
+
+STARDICT::LookupResponse::DictResponse::DictResult::WordResult::~WordResult()
+{
+       g_free(word);
+       for (std::list<char *>::iterator i = datalist.begin(); i != datalist.end(); ++i) {
+               g_free(*i);
+       }
+}
+
+STARDICT::LookupResponse::~LookupResponse()
+{
+    if (listtype == ListType_List) {
+       for (std::list<char *>::iterator i = wordlist->begin(); i != wordlist->end(); ++i) {
+               g_free(*i);
+           }
+        delete wordlist;
+    } else if (listtype == ListType_Tree) {
+        for (std::list<WordTreeElement *>::iterator i = wordtree->begin(); i != wordtree->end(); ++i) {
+            g_free((*i)->bookname);
+            for (std::list<char *>::iterator j = (*i)->wordlist.begin(); j != (*i)->wordlist.end(); ++j) {
+                g_free(*j);
+            }
+            delete *i;
+        }
+        delete wordtree;
+    }
+}
+
+STARDICT::Cmd::~Cmd()
+{
+    if (this->command == CMD_AUTH) {
+        delete this->auth;
+    } else {
+        g_free(this->data);
+    }
+    if (this->command == CMD_LOOKUP || this->command == CMD_DEFINE || this->command == CMD_SELECT_QUERY || this->command == CMD_SMART_QUERY) {
+        delete this->lookup_response;
+    } else if (this->command == CMD_PREVIOUS || this->command == CMD_NEXT) {
+        if (this->wordlist_response) {
+            for (std::list<char *>::iterator i = this->wordlist_response->begin(); i != this->wordlist_response->end(); ++i) {
+                g_free(*i);
+            }
+            delete this->wordlist_response;
+        }
+    }
+}
+
+StarDictCache::StarDictCache()
+{
+    str_pool.resize(str_pool_size);
+    for (size_t i = 0; i< str_pool_size; i++) {
+        str_pool[i] = NULL;
+    }
+    cur_str_pool_pos = 0;
+
+    lookup_response_pool.resize(lookup_response_pool_size);
+    for (size_t i = 0; i< lookup_response_pool_size; i++) {
+        lookup_response_pool[i] = NULL;
+    }
+    cur_lookup_response_pool_pos = 0;
+}
+
+StarDictCache::~StarDictCache()
+{
+    clean_all_cache();
+}
+
+void StarDictCache::clean_all_cache()
+{
+    for (std::vector<StrElement *>::iterator i = str_pool.begin(); i != str_pool.end(); ++i) {
+        if (*i) {
+            g_free((*i)->data);
+            delete *i;
+            *i = NULL;
+        }
+    }
+    clean_cache_lookup_response();
+}
+
+void StarDictCache::clean_cache_lookup_response()
+{
+    for (std::vector<LookupResponseElement *>::iterator i = lookup_response_pool.begin(); i != lookup_response_pool.end(); ++i) {
+        if (*i) {
+            delete ((*i)->lookup_response);
+            delete *i;
+            *i = NULL;
+        }
+    }
+}
+
+char *StarDictCache::get_cache_str(const char *key_str)
+{
+    for (std::vector<StrElement *>::iterator i = str_pool.begin(); i != str_pool.end(); ++i) {
+        if (*i) {
+            if ((*i)->key == key_str)
+                return (*i)->data;
+        }
+    }
+    return NULL;
+}
+
+STARDICT::LookupResponse *StarDictCache::get_cache_lookup_response(const char *key_str)
+{
+    for (std::vector<LookupResponseElement *>::iterator i = lookup_response_pool.begin(); i != lookup_response_pool.end(); ++i) {
+        if (*i) {
+            if ((*i)->key == key_str)
+                return (*i)->lookup_response;
+        }
+    }
+    return NULL;
+}
+
+void StarDictCache::clean_cache_str(const char *key_str)
+{
+    for (std::vector<StrElement *>::iterator i = str_pool.begin(); i != str_pool.end(); ++i) {
+        if (*i) {
+            if ((*i)->key == key_str) {
+                g_free((*i)->data);
+                delete *i;
+                *i = NULL;
+                //return;
+            }
+        }
+    }
+}
+
+void StarDictCache::save_cache_str(const char *key_str, char *data)
+{
+    if (str_pool[cur_str_pool_pos]) {
+        g_free(str_pool[cur_str_pool_pos]->data);
+        delete str_pool[cur_str_pool_pos];
+    }
+    str_pool[cur_str_pool_pos] = new StrElement();
+    str_pool[cur_str_pool_pos]->key = key_str;
+    str_pool[cur_str_pool_pos]->data = data;
+    cur_str_pool_pos++;
+    if (cur_str_pool_pos == str_pool_size)
+        cur_str_pool_pos = 0;
+}
+
+void StarDictCache::save_cache_lookup_response(const char *key_str, STARDICT::LookupResponse *lookup_response)
+{
+    if (lookup_response_pool[cur_lookup_response_pool_pos]) {
+        delete lookup_response_pool[cur_lookup_response_pool_pos]->lookup_response;
+        delete lookup_response_pool[cur_lookup_response_pool_pos];
+    }
+    lookup_response_pool[cur_lookup_response_pool_pos] = new LookupResponseElement();
+    lookup_response_pool[cur_lookup_response_pool_pos]->key = key_str;
+    lookup_response_pool[cur_lookup_response_pool_pos]->lookup_response = lookup_response;
+    cur_lookup_response_pool_pos++;
+    if (cur_lookup_response_pool_pos == lookup_response_pool_size)
+        cur_lookup_response_pool_pos = 0;
+}
+
+StarDictClient::StarDictClient()
+{
+       sd_ = -1;
+    channel_ = NULL;
+    in_source_id_ = 0;
+    out_source_id_ = 0;
+    is_connected_ = false;
+}
+
+StarDictClient::~StarDictClient()
+{
+    disconnect();
+}
+
+void StarDictClient::set_server(const char *host, int port)
+{
+    if (host_ != host || port_ != port) {
+        host_ = host;
+        port_ = port;
+       host_resolved = false;
+        clean_all_cache();
+    }
+}
+
+void StarDictClient::set_auth(const char *user, const char *md5passwd)
+{
+    if (user_ != user || md5passwd_ != md5passwd) {
+        user_ = user;
+        md5passwd_ = md5passwd;
+        clean_all_cache();
+    }
+}
+
+bool StarDictClient::try_cache(STARDICT::Cmd *c)
+{
+    if (c->command == STARDICT::CMD_LOOKUP || c->command == STARDICT::CMD_DEFINE || c->command == STARDICT::CMD_SELECT_QUERY || c->command == STARDICT::CMD_SMART_QUERY) {
+        STARDICT::LookupResponse *res = get_cache_lookup_response(c->data);
+        if (res) {
+            if (c->command == STARDICT::CMD_LOOKUP || c->command == STARDICT::CMD_DEFINE)
+                on_lookup_end_.emit(res, 0);
+            else if (c->command == STARDICT::CMD_SELECT_QUERY || c->command == STARDICT::CMD_SMART_QUERY)
+                on_floatwin_lookup_end_.emit(res, 0);
+            delete c;
+            return true;
+        } else {
+            return false;
+        }
+    }
+    if (c->command == STARDICT::CMD_PREVIOUS || c->command == STARDICT::CMD_NEXT) {
+        // Not implemented yet.
+        return false;
+    }
+    char *data = get_cache_str(c->data);
+    if (data) {
+        switch (c->command) {
+            case STARDICT::CMD_DIR_INFO:
+                on_dirinfo_end_.emit(data);
+                break;
+            case STARDICT::CMD_DICT_INFO:
+                on_dictinfo_end_.emit(data);
+                break;
+            case STARDICT::CMD_GET_DICT_MASK:
+                on_getdictmask_end_.emit(data);
+                break;
+            case STARDICT::CMD_MAX_DICT_COUNT:
+                on_maxdictcount_end_.emit(atoi(data));
+                break;
+        }
+        delete c;
+        return true;
+    } else {
+        return false;
+    }
+}
+
+void StarDictClient::send_commands(int num, ...)
+{
+    STARDICT::Cmd *c;
+    if (!is_connected_) {
+#ifdef _WIN32
+        c = new STARDICT::Cmd(STARDICT::CMD_CLIENT, "StarDict Windows");
+#else
+        c = new STARDICT::Cmd(STARDICT::CMD_CLIENT, "StarDict Linux");
+#endif
+        cmdlist.push_back(c);
+        if (!user_.empty() && !md5passwd_.empty()) {
+            c = new STARDICT::Cmd(STARDICT::CMD_AUTH, user_.c_str(), md5passwd_.c_str());
+            cmdlist.push_back(c);
+        }
+    }
+    va_list    ap;
+    va_start( ap, num);
+    for (int i = 0; i< num; i++) {
+        c = va_arg( ap, STARDICT::Cmd *);
+           cmdlist.push_back(c);
+    }
+    va_end( ap );
+    if (!is_connected_) {
+        waiting_banner_ = true;
+        connect();
+    }
+}
+
+void StarDictClient::try_cache_or_send_commands(int num, ...)
+{
+    STARDICT::Cmd *c;
+    std::list<STARDICT::Cmd *> send_cmdlist;
+    va_list    ap;
+    va_start( ap, num);
+    for (int i = 0; i< num; i++) {
+        c = va_arg( ap, STARDICT::Cmd *);
+        if (!try_cache(c)) {
+            send_cmdlist.push_back(c);
+        }
+    }
+    va_end( ap );
+    if (send_cmdlist.empty())
+        return;
+
+    if (!is_connected_) {
+#ifdef _WIN32
+        c = new STARDICT::Cmd(STARDICT::CMD_CLIENT, "StarDict Windows");
+#else
+        c = new STARDICT::Cmd(STARDICT::CMD_CLIENT, "StarDict Linux");
+#endif
+        cmdlist.push_back(c);
+        if (!user_.empty() && !md5passwd_.empty()) {
+            c = new STARDICT::Cmd(STARDICT::CMD_AUTH, user_.c_str(), md5passwd_.c_str());
+            cmdlist.push_back(c);
+        }
+    }
+    for (std::list<STARDICT::Cmd *>::iterator i = send_cmdlist.begin(); i!= send_cmdlist.end(); ++i) {
+           cmdlist.push_back(*i);
+    }
+    if (!is_connected_) {
+        waiting_banner_ = true;
+        connect();
+    }
+}
+
+void StarDictClient::write_str(const char *str, GError **err)
+{
+    int len = strlen(str);
+    int left_byte = len;
+    GIOStatus res;
+    gsize bytes_written;
+    while (left_byte) {
+        res = g_io_channel_write_chars(channel_, str+(len - left_byte), left_byte, &bytes_written, err);
+        if (res == G_IO_STATUS_ERROR) {
+            disconnect();
+            return;
+        }
+        left_byte -= bytes_written;
+    }
+    res = g_io_channel_flush(channel_, err);
+    if (res == G_IO_STATUS_ERROR) {
+        disconnect();
+    }
+       if (out_source_id_ == 0)
+               out_source_id_ = g_io_add_watch(channel_, GIOCondition(G_IO_OUT), on_io_out_event, this);
+}
+
+void StarDictClient::request_command()
+{
+    reading_type_ = READ_LINE;
+    if (cmdlist.empty()) {
+        cmdlist.push_back(new STARDICT::Cmd(STARDICT::CMD_QUIT));
+    }
+    STARDICT::Cmd *c = cmdlist.front();
+       switch (c->command) {
+        case STARDICT::CMD_AUTH:
+               {
+                       struct MD5Context ctx;
+                       unsigned char digest[16];
+                       char hex[33];
+                       int i;
+                       MD5Init(&ctx);
+                       MD5Update(&ctx, (const unsigned char*)cmd_reply.daemonStamp.c_str(), cmd_reply.daemonStamp.length());
+                       MD5Update(&ctx, (const unsigned char*)(c->auth->passwd.c_str()), c->auth->passwd.length());
+                       MD5Final(digest, &ctx );
+                       for (i = 0; i < 16; i++)
+                               sprintf( hex+2*i, "%02x", digest[i] );
+                       hex[32] = '\0';
+                       std::string earg1, earg2;
+                       arg_escape(earg1, c->auth->user.c_str());
+                       arg_escape(earg2, hex);
+                       char *data = g_strdup_printf("auth %s %s\n", earg1.c_str(), earg2.c_str());
+            GError *err = NULL;
+            write_str(data, &err);
+                       g_free(data);
+                       if (err) {
+                on_error_.emit(err->message);
+                g_error_free(err);
+                               return;
+                       }
+                       break;
+               }
+               default:
+        {
+            GError *err = NULL;
+            write_str(c->data, &err);
+                       if (err) {
+                on_error_.emit(err->message);
+                g_error_free(err);
+                               return;
+            }
+                       break;
+        }
+       }
+       return;
+}
+
+void StarDictClient::clean_command()
+{
+       for (std::list<STARDICT::Cmd *>::iterator i=cmdlist.begin(); i!=cmdlist.end(); ++i) {
+               delete *i;
+       }
+       cmdlist.clear();
+}
+
+void StarDictClient::connect()
+{
+    if (host_resolved) {
+           on_resolved(this, true, sa);
+    } else {
+        Socket::resolve(host_, this, on_resolved);
+    }
+}
+
+void StarDictClient::on_resolved(gpointer data, bool resolved, in_addr_t sa_)
+{
+    StarDictClient *oStarDictClient = (StarDictClient *)data;
+    if (!resolved) {
+       static bool showed_once = false;
+       if (!showed_once) {
+               showed_once = true;
+               gchar *mes = g_strdup_printf("Can not reslove %s: %s\n",
+                         oStarDictClient->host_.c_str(), Socket::get_error_msg().c_str());
+               on_error_.emit(mes);
+               g_free(mes);
+       }
+        return;
+    }
+
+    if (oStarDictClient->host_resolved == false) {
+            oStarDictClient->sa = sa_;
+           oStarDictClient->host_resolved = true;
+    }
+
+    oStarDictClient->sd_ = Socket::socket();
+
+    if (oStarDictClient->sd_ == -1) {
+        std::string str = "Can not create socket: " + Socket::get_error_msg();
+        on_error_.emit(str.c_str());
+        return;
+    }
+    Socket::connect(oStarDictClient->sd_, sa_, oStarDictClient->port_, oStarDictClient, on_connected);
+}
+
+void StarDictClient::on_connected(gpointer data, bool succeeded)
+{
+    StarDictClient *oStarDictClient = (StarDictClient *)data;
+    if (!succeeded) {
+       static bool showed_once = false;
+       if (!showed_once) {
+               showed_once = true;
+               gchar *mes = g_strdup_printf("Can not connect to %s: %s\n",
+                         oStarDictClient->host_.c_str(), Socket::get_error_msg().c_str());
+               on_error_.emit(mes);
+               g_free(mes);
+       }
+        return;
+    }
+#ifdef _WIN32
+    oStarDictClient->channel_ = g_io_channel_win32_new_socket(oStarDictClient->sd_);
+#else
+    oStarDictClient->channel_ = g_io_channel_unix_new(oStarDictClient->sd_);
+#endif
+
+    g_io_channel_set_encoding(oStarDictClient->channel_, NULL, NULL);
+
+    /* make sure that the channel is non-blocking */
+    int flags = g_io_channel_get_flags(oStarDictClient->channel_);
+    flags |= G_IO_FLAG_NONBLOCK;
+    GError *err = NULL;
+    g_io_channel_set_flags(oStarDictClient->channel_, GIOFlags(flags), &err);
+    if (err) {
+        g_io_channel_unref(oStarDictClient->channel_);
+        oStarDictClient->channel_ = NULL;
+        gchar *str = g_strdup_printf("Unable to set the channel as non-blocking: %s", err->message);
+        on_error_.emit(str);
+        g_free(str);
+        g_error_free(err);
+        return;
+    }
+
+    oStarDictClient->is_connected_ = true;
+    oStarDictClient->waiting_banner_ = true;
+    oStarDictClient->reading_type_ = READ_LINE;
+    oStarDictClient->in_source_id_ = g_io_add_watch(oStarDictClient->channel_, GIOCondition(G_IO_IN | G_IO_ERR), on_io_in_event, oStarDictClient);
+}
+
+void StarDictClient::disconnect()
+{
+    clean_command();
+    if (in_source_id_) {
+        g_source_remove(in_source_id_);
+        in_source_id_ = 0;
+    }
+    if (out_source_id_) {
+        g_source_remove(out_source_id_);
+        out_source_id_ = 0;
+    }
+
+    if (channel_) {
+        g_io_channel_shutdown(channel_, TRUE, NULL);
+        g_io_channel_unref(channel_);
+        channel_ = NULL;
+    }
+       if (sd_ != -1) {
+               Socket::close(sd_);
+               sd_ = -1;
+       }
+    is_connected_ = false;
+}
+
+gboolean StarDictClient::on_io_out_event(GIOChannel *ch, GIOCondition cond,
+                 gpointer user_data)
+{
+       StarDictClient *stardict_client = static_cast<StarDictClient *>(user_data);
+       GError *err = NULL;
+       GIOStatus res = g_io_channel_flush(stardict_client->channel_, &err);
+       if (res == G_IO_STATUS_AGAIN) {
+               return TRUE;
+       } else if (err) {
+               on_error_.emit(err->message);
+               g_error_free(err);
+       }
+       stardict_client->out_source_id_ = 0;
+       return FALSE;
+}
+
+gboolean StarDictClient::on_io_in_event(GIOChannel *ch, GIOCondition cond,
+                 gpointer user_data)
+{
+    StarDictClient *stardict_client = static_cast<StarDictClient *>(user_data);
+
+    if (!stardict_client->channel_) {
+        //g_warning("No channel available\n");
+        return FALSE;
+    }
+    if (cond & G_IO_ERR) {
+        /*gchar *mes =
+            g_strdup_printf("Connection failed to the dictionary server at %s:%d",
+                    stardict_client->host_.c_str(), stardict_client->port_);
+        on_error_.emit(mes);
+        g_free(mes);*/
+        stardict_client->disconnect();
+        return FALSE;
+    }
+    GError *err = NULL;
+    gsize term, len;
+    gchar *line;
+    GIOStatus res;
+
+    for (;;) {
+        if (!stardict_client->channel_)
+            break;
+        bool result;
+        if (stardict_client->reading_type_ == READ_SIZE) {
+            gsize bytes_read;
+            res = g_io_channel_read_chars(stardict_client->channel_, stardict_client->size_data+(stardict_client->size_count-stardict_client->size_left), stardict_client->size_left, &bytes_read, &err);
+            if (res == G_IO_STATUS_ERROR || res == G_IO_STATUS_EOF) {
+                if (err) {
+                    gchar *str = g_strdup_printf("Error while reading reply from server: %s", err->message);
+                    on_error_.emit(str);
+                    g_free(str);
+                    g_error_free(err);
+                }
+                stardict_client->disconnect();
+
+                return FALSE;
+            }
+            stardict_client->size_left -= bytes_read;
+            if (stardict_client->size_left == 0)
+                result = stardict_client->parse(stardict_client->size_data);
+            else
+                break;
+        } else {
+            if (stardict_client->reading_type_ == READ_LINE)
+                g_io_channel_set_line_term(stardict_client->channel_, "\n", 1);
+            else if (stardict_client->reading_type_ == READ_STRING)
+                g_io_channel_set_line_term(stardict_client->channel_, "", 1);
+
+            res = g_io_channel_read_line(stardict_client->channel_, &line,
+                             &len, &term, &err);
+            if (res == G_IO_STATUS_ERROR || res == G_IO_STATUS_EOF) {
+                if (err) {
+                    gchar *str = g_strdup_printf("Error while reading reply from server: %s", err->message);
+                    on_error_.emit(str);
+                    g_free(str);
+                    g_error_free(err);
+                }
+                stardict_client->disconnect();
+
+                return FALSE;
+            }
+
+            if (!len)
+                break;
+
+            //truncate the line terminator before parsing
+            line[term] = '\0';
+            result = stardict_client->parse(line);
+        }
+        if (!result) {
+            stardict_client->disconnect();
+            return FALSE;
+        }
+    }
+
+    return TRUE;
+}
+
+int StarDictClient::parse_banner(gchar *line)
+{
+    int status;
+    status = atoi(line);
+    if (status != CODE_HELLO) {
+        if (status == CODE_TEMPORARILY_UNAVAILABLE) {
+            printf("Server temporarily unavailable!\n");
+        } else {
+            printf("Unexpected status code %d\n", status);
+        }
+        return 0;
+    }
+    char *p;
+    p = strrchr(line, ' ');
+    if (p) {
+        p++;
+        cmd_reply.daemonStamp = p;
+    }
+    return 1;
+}
+
+int StarDictClient::parse_command_client(gchar *line)
+{
+    int status;
+    status = atoi(line);
+    if (status != CODE_OK) {
+       gchar *str = g_strdup_printf("Client denied: %s", line);
+       on_error_.emit(str);
+       g_free(str);
+        return 0;
+    }
+    return 1;
+}
+
+int StarDictClient::parse_command_auth(gchar *line)
+{
+    int status;
+    status = atoi(line);
+    if (status != CODE_OK) {
+        gchar *str = g_strdup_printf(_("Authentication denied: %s"), line);
+        on_error_.emit(str);
+        g_free(str);
+        return 0;
+    }
+    return 1;
+}
+
+int StarDictClient::parse_command_register(gchar *line)
+{
+    int status;
+    status = atoi(line);
+    if (status != CODE_OK) {
+        gchar *str = g_strdup_printf(_("Register failed: %s"), line);
+        on_error_.emit(str);
+        g_free(str);
+        return 0;
+    }
+    on_register_end_.emit(_("Register success!"));
+    return 1;
+}
+
+int StarDictClient::parse_command_quit(gchar *line)
+{
+    int status;
+    status = atoi(line);
+    if (status != CODE_GOODBYE) {
+    }
+    return 0;
+}
+
+int StarDictClient::parse_command_setdictmask(gchar *line)
+{
+    int status;
+    status = atoi(line);
+    if (status != CODE_OK) {
+        gchar *str = g_strdup_printf("Set Dict Mask failed: %s", line);
+        on_error_.emit(str);
+        g_free(str);
+        return 0;
+    }
+    clean_cache_str("getdictmask\n");
+    clean_cache_lookup_response();
+    return 1;
+}
+
+int StarDictClient::parse_command_getdictmask(STARDICT::Cmd* cmd, gchar *buf)
+{
+    if (cmd->reading_status == 0) {
+        int status;
+        status = atoi(buf);
+        if (status != CODE_OK) {
+           g_free(buf);
+            on_error_.emit(_("You haven't setup the account. Please open the \"Net Dict\" page in the Preferences dialog and register an account first."));
+            return 0;
+        }
+       g_free(buf);
+       cmd->reading_status = 1;
+       reading_type_ = READ_STRING;
+    } else if (cmd->reading_status == 1) {
+        on_getdictmask_end_.emit(buf);
+        save_cache_str(cmd->data, buf);
+        return 1;
+    }
+    return 2;
+}
+
+int StarDictClient::parse_command_dirinfo(STARDICT::Cmd* cmd, gchar *buf)
+{
+    if (cmd->reading_status == 0) {
+        int status;
+        status = atoi(buf);
+        if (status != CODE_OK) {
+            gchar *str = g_strdup_printf("Get dir info failed: %s", buf);
+            g_free(buf);
+            on_error_.emit(str);
+            g_free(str);
+            return 0;
+        }
+        g_free(buf);
+        cmd->reading_status = 1;
+        reading_type_ = READ_STRING;
+    } else if (cmd->reading_status == 1) {
+        on_dirinfo_end_.emit(buf);
+        save_cache_str(cmd->data, buf);
+        return 1;
+    }
+    return 2;
+}
+
+int StarDictClient::parse_command_dictinfo(STARDICT::Cmd* cmd, gchar *buf)
+{
+    if (cmd->reading_status == 0) {
+        int status;
+        status = atoi(buf);
+        if (status != CODE_OK) {
+            gchar *str = g_strdup_printf("Get dict info failed: %s", buf);
+            g_free(buf);
+            on_error_.emit(str);
+            g_free(str);
+            return 0;
+        }
+        g_free(buf);
+        cmd->reading_status = 1;
+        reading_type_ = READ_STRING;
+    } else if (cmd->reading_status == 1) {
+        on_dictinfo_end_.emit(buf);
+        save_cache_str(cmd->data, buf);
+        return 1;
+    }
+    return 2;
+}
+
+int StarDictClient::parse_command_maxdictcount(STARDICT::Cmd* cmd, gchar *buf)
+{
+    if (cmd->reading_status == 0) {
+        int status;
+        status = atoi(buf);
+        if (status != CODE_OK) {
+            gchar *str = g_strdup_printf("Get max dict count failed: %s", buf);
+            g_free(buf);
+            on_error_.emit(str);
+            g_free(str);
+            return 0;
+        }
+        g_free(buf);
+        cmd->reading_status = 1;
+        reading_type_ = READ_STRING;
+    } else if (cmd->reading_status == 1) {
+        on_maxdictcount_end_.emit(atoi(buf));
+        save_cache_str(cmd->data, buf);
+        return 1;
+    }
+    return 2;
+}
+
+int StarDictClient::parse_wordlist(STARDICT::Cmd* cmd, gchar *buf)
+{
+    if (cmd->reading_status == 0) { // Read code.
+        int status;
+        status = atoi(buf);
+        g_free(buf);
+        if (status != CODE_OK) {
+            return 0;
+        }
+        cmd->wordlist_response = new std::list<char *>;
+        cmd->reading_status = 1;
+        reading_type_ = READ_STRING;
+    } else if (cmd->reading_status == 1) {
+        if (*buf == '\0') {
+            g_free(buf);
+            if (cmd->command == STARDICT::CMD_PREVIOUS) {
+                on_previous_end_.emit(cmd->wordlist_response);
+                return 1;
+            } else {
+                on_next_end_.emit(cmd->wordlist_response);
+                return 1;
+            }
+        } else {
+            cmd->wordlist_response->push_back(buf);
+        }
+    }
+    return 2;
+}
+
+int StarDictClient::parse_dict_result(STARDICT::Cmd* cmd, gchar *buf)
+{
+    if (cmd->reading_status == 0) { // Read code.
+        int status;
+        status = atoi(buf);
+        g_free(buf);
+        if (status != CODE_OK) {
+            if (status == CODE_DICTMASK_NOTSET) {
+                on_error_.emit(_("You haven't chosen any dictionaries, please choose some by clicking \"Manage Dict\"->\"Network dictionaries\"->\"Add\"."));
+                return 1;
+            } else {
+                return 0;
+            }
+        }
+        cmd->lookup_response = new STARDICT::LookupResponse();
+        cmd->lookup_response->listtype = STARDICT::LookupResponse::ListType_None;
+        cmd->reading_status = 1;
+        reading_type_ = READ_STRING;
+    } else if (cmd->reading_status == 1) { // Read original word.
+        cmd->lookup_response->dict_response.oword = buf;
+        cmd->reading_status = 2;
+    } else if (cmd->reading_status == 2) { // Read book name.
+        if (*buf == '\0') {
+            g_free(buf);
+            if (cmd->command == STARDICT::CMD_DEFINE) {
+                on_lookup_end_.emit(cmd->lookup_response, cmd->seq);
+                save_cache_lookup_response(cmd->data, cmd->lookup_response);
+                cmd->lookup_response = NULL;
+                return 1;
+            } else if ( cmd->command == STARDICT::CMD_SELECT_QUERY || cmd->command == STARDICT::CMD_SMART_QUERY) {
+                on_floatwin_lookup_end_.emit(cmd->lookup_response, cmd->seq);
+                save_cache_lookup_response(cmd->data, cmd->lookup_response);
+                cmd->lookup_response = NULL;
+                return 1;
+            }
+            cmd->reading_status = 6;
+            reading_type_ = READ_STRING;
+        } else {
+            struct STARDICT::LookupResponse::DictResponse::DictResult *dict_result = new STARDICT::LookupResponse::DictResponse::DictResult();
+            dict_result->bookname = buf;
+            cmd->lookup_response->dict_response.dict_result_list.push_back(dict_result);
+            cmd->reading_status = 3;
+        }
+    } else if (cmd->reading_status == 3) { // Read word.
+        if (*buf == '\0') {
+            g_free(buf);
+            cmd->reading_status = 2;
+        } else {
+            struct STARDICT::LookupResponse::DictResponse::DictResult::WordResult *word_result = new STARDICT::LookupResponse::DictResponse::DictResult::WordResult();
+            word_result->word = buf;
+            cmd->lookup_response->dict_response.dict_result_list.back()->word_result_list.push_back(word_result);;
+            cmd->reading_status = 4;
+            reading_type_ = READ_SIZE;
+           size_data = (char *)g_malloc(sizeof(guint32));
+           size_count = size_left = sizeof(guint32);
+        }
+    } else if (cmd->reading_status == 4) {
+        guint32 datasize = g_ntohl(get_uint32(buf));
+       memcpy(buf, &datasize, sizeof(guint32));
+        if (datasize == 0) {
+           g_free(buf);
+            cmd->reading_status = 3;
+            reading_type_ = READ_STRING;
+        } else {
+           cmd->reading_status = 5;
+           size_data = (char *)g_realloc(buf, datasize + sizeof(guint32));
+           size_count = datasize + sizeof(guint32);
+           size_left = datasize;
+        }
+    } else if (cmd->reading_status == 5) {
+            cmd->lookup_response->dict_response.dict_result_list.back()->word_result_list.back()->datalist.push_back(buf);
+           cmd->reading_status = 4;
+           size_data = (char *)g_malloc(sizeof(guint32));
+           size_count = size_left = sizeof(guint32);
+    } else if (cmd->reading_status == 6) {
+        if (strcmp(buf, "d") == 0) {
+            cmd->reading_status = 8;
+            cmd->lookup_response->listtype = STARDICT::LookupResponse::ListType_Tree;
+            cmd->lookup_response->wordtree = new std::list<STARDICT::LookupResponse::WordTreeElement *>;
+        } else {
+            cmd->reading_status = 7;
+            if (strcmp(buf, "r") == 0)
+                cmd->lookup_response->listtype = STARDICT::LookupResponse::ListType_Rule_List;
+            else if (strcmp(buf, "g") == 0)
+                cmd->lookup_response->listtype = STARDICT::LookupResponse::ListType_Regex_List;
+            else if (strcmp(buf, "f") == 0)
+                cmd->lookup_response->listtype = STARDICT::LookupResponse::ListType_Fuzzy_List;
+            else 
+                cmd->lookup_response->listtype = STARDICT::LookupResponse::ListType_List;
+            cmd->lookup_response->wordlist = new std::list<char *>;
+        }
+        g_free(buf);
+    } else if (cmd->reading_status == 7) {
+        if (*buf == '\0') {
+            g_free(buf);
+            on_lookup_end_.emit(cmd->lookup_response, cmd->seq);
+            save_cache_lookup_response(cmd->data, cmd->lookup_response);
+            cmd->lookup_response = NULL;
+            return 1;
+        } else {
+            cmd->lookup_response->wordlist->push_back(buf);
+        }
+    } else if (cmd->reading_status == 8) {
+        if (*buf == '\0') {
+            g_free(buf);
+            on_lookup_end_.emit(cmd->lookup_response, cmd->seq);
+            save_cache_lookup_response(cmd->data, cmd->lookup_response);
+            cmd->lookup_response = NULL;
+            return 1;
+        } else {
+            STARDICT::LookupResponse::WordTreeElement *element = new STARDICT::LookupResponse::WordTreeElement();
+            element->bookname = buf;
+            cmd->lookup_response->wordtree->push_back(element);
+            cmd->reading_status = 9;
+        }
+    } else if (cmd->reading_status == 9) {
+        if (*buf == '\0') {
+            g_free(buf);
+            cmd->reading_status = 8;
+        } else {
+            cmd->lookup_response->wordtree->back()->wordlist.push_back(buf);
+        }
+    }
+    return 2;
+}
+
+bool StarDictClient::parse(gchar *line)
+{
+    int result;
+    if (waiting_banner_) {
+        waiting_banner_ = false;
+        result = parse_banner(line);
+        g_free(line);
+        if (!result)
+            return false;
+        request_command();
+        return true;
+    }
+    STARDICT::Cmd* cmd = cmdlist.front();
+    switch (cmd->command) {
+        case STARDICT::CMD_CLIENT:
+            result = parse_command_client(line);
+            g_free(line);
+            break;
+        case STARDICT::CMD_AUTH:
+            result = parse_command_auth(line);
+            g_free(line);
+            break;
+        case STARDICT::CMD_REGISTER:
+            result = parse_command_register(line);
+            g_free(line);
+            break;
+        case STARDICT::CMD_GET_DICT_MASK:
+            result = parse_command_getdictmask(cmd, line);
+            break;
+        case STARDICT::CMD_SET_DICT_MASK:
+            result = parse_command_setdictmask(line);
+            break;
+        case STARDICT::CMD_DIR_INFO:
+            result = parse_command_dirinfo(cmd, line);
+            break;
+        case STARDICT::CMD_DICT_INFO:
+            result = parse_command_dictinfo(cmd, line);
+            break;
+        case STARDICT::CMD_MAX_DICT_COUNT:
+            result = parse_command_maxdictcount(cmd, line);
+            break;
+        case STARDICT::CMD_DEFINE:
+        case STARDICT::CMD_LOOKUP:
+        case STARDICT::CMD_SELECT_QUERY:
+        case STARDICT::CMD_SMART_QUERY:
+            result = parse_dict_result(cmd, line);
+            break;
+        case STARDICT::CMD_PREVIOUS:
+        case STARDICT::CMD_NEXT:
+            result = parse_wordlist(cmd, line);
+            break;
+        case STARDICT::CMD_QUIT:
+            result = parse_command_quit(line);
+            g_free(line);
+            break;
+        default:
+            result = 0;
+            g_free(line);
+            break;
+    }
+    if (result == 0)
+        return false;
+    if (result == 1) {
+        delete cmd;
+        cmdlist.pop_front();
+        if (cmdlist.empty()) {
+            cmdlist.push_back(new STARDICT::Cmd(STARDICT::CMD_QUIT));
+        }
+        request_command();
+    }
+    return true;
+}
diff --git a/src/lib/stardict_client.hpp b/src/lib/stardict_client.hpp
new file mode 100644 (file)
index 0000000..fd94d17
--- /dev/null
@@ -0,0 +1,207 @@
+#ifndef _STARDICT_CLIENT_HPP_
+#define _STARDICT_CLIENT_HPP_
+
+#include <glib.h>
+#ifndef _WIN32
+#  include <netdb.h>
+#else
+typedef unsigned long in_addr_t;
+#endif
+
+#include "sigc++/sigc++.h"
+
+#include <list>
+#include <vector>
+
+namespace STARDICT {
+       enum {
+               CMD_CLIENT,
+               CMD_AUTH,
+               CMD_LOOKUP,
+               CMD_PREVIOUS,
+               CMD_NEXT,
+               //CMD_QUERY,
+               CMD_SELECT_QUERY,
+               CMD_SMART_QUERY,
+               CMD_DEFINE,
+               CMD_REGISTER,
+               //CMD_CHANGE_PASSWD,
+               CMD_SET_DICT_MASK,
+               CMD_GET_DICT_MASK,
+               //CMD_SET_COLLATE_FUNC,
+               //CMD_GET_COLLATE_FUNC,
+               //CMD_SET_LANGUAGE,
+               //CMD_GET_LANGUAGE,
+               //CMD_SET_EMAIL,
+               //CMD_GET_EMAIL,
+               CMD_MAX_DICT_COUNT,
+               CMD_DIR_INFO,
+               CMD_DICT_INFO,
+               //CMD_USER_LEVEL,
+               //CMD_GET_USER_LEVEL,
+               CMD_QUIT,
+       };
+    struct LookupResponse {
+        struct DictResponse {
+            DictResponse();
+            ~DictResponse();
+            char *oword;
+            struct DictResult {
+                DictResult();
+                ~DictResult();
+                char *bookname;
+                struct WordResult {
+                    WordResult();
+                    ~WordResult();
+                    char *word;
+                    std::list<char *> datalist;
+                };
+                std::list<struct WordResult *> word_result_list;
+            };
+            std::list<struct DictResult *> dict_result_list;
+        };
+        ~LookupResponse();
+        struct DictResponse dict_response;
+        enum ListType {
+            ListType_None,
+            ListType_List,
+            ListType_Rule_List,
+            ListType_Regex_List,
+            ListType_Fuzzy_List,
+            ListType_Tree,
+        };
+        ListType listtype;
+        struct WordTreeElement {
+            char *bookname;
+            std::list<char *> wordlist;
+        };
+        union {
+            std::list<char *> *wordlist;
+            std::list<WordTreeElement *> *wordtree;
+        };
+    };
+       class Cmd {
+       public:
+               int command;
+               struct AuthInfo {
+            std::string user;
+            std::string passwd;
+               };
+               union {
+                       char *data;
+            AuthInfo *auth;
+               };
+        int reading_status;
+       unsigned int seq;
+        union {
+            struct LookupResponse *lookup_response;
+            std::list<char *> *wordlist_response;
+        };
+               Cmd(int cmd, ...);
+        ~Cmd();
+       private:
+           static unsigned int next_seq;
+       };
+};
+
+class StarDictCache {
+public:
+    StarDictCache();
+    ~StarDictCache();
+    char *get_cache_str(const char *key);
+    void save_cache_str(const char *key, char *str);
+    void clean_cache_str(const char *key);
+    STARDICT::LookupResponse *get_cache_lookup_response(const char *key);
+    void save_cache_lookup_response(const char *key, STARDICT::LookupResponse *lookup_response);
+    void clean_cache_lookup_response();
+    void clean_all_cache();
+private:
+    static const unsigned int str_pool_size = 30;
+    size_t cur_str_pool_pos;
+    struct StrElement {
+        std::string key;
+        char *data;
+    };
+    std::vector<StrElement *> str_pool;
+
+    static const unsigned int lookup_response_pool_size = 60;
+    size_t cur_lookup_response_pool_pos;
+    struct LookupResponseElement {
+        std::string key;
+        struct STARDICT::LookupResponse *lookup_response;
+    };
+    std::vector<LookupResponseElement *> lookup_response_pool;
+};
+
+class StarDictClient : private StarDictCache {
+public:
+    static sigc::signal<void, const char *> on_error_;
+    static sigc::signal<void, const struct STARDICT::LookupResponse *, unsigned int> on_lookup_end_;
+    static sigc::signal<void, const struct STARDICT::LookupResponse *, unsigned int> on_floatwin_lookup_end_;
+    static sigc::signal<void, const char *> on_register_end_;
+    static sigc::signal<void, const char *> on_getdictmask_end_;
+    static sigc::signal<void, const char *> on_dirinfo_end_;
+    static sigc::signal<void, const char *> on_dictinfo_end_;
+    static sigc::signal<void, int> on_maxdictcount_end_;
+    static sigc::signal<void, std::list<char *> *> on_previous_end_;
+    static sigc::signal<void, std::list<char *> *> on_next_end_;
+
+       StarDictClient();
+       ~StarDictClient();
+
+    void set_server(const char *host, int port = 2628);
+    void set_auth(const char *user, const char *md5passwd);
+    bool try_cache(STARDICT::Cmd *c);
+       void send_commands(int num, ...);
+       void try_cache_or_send_commands(int num, ...);
+private:
+       int sd_;
+       GIOChannel *channel_;
+       guint in_source_id_;
+       guint out_source_id_;
+       std::string host_;
+       int port_;
+       bool host_resolved;
+       in_addr_t sa;
+    std::string user_;
+    std::string md5passwd_;
+       bool is_connected_;
+    bool waiting_banner_;
+       std::list<STARDICT::Cmd *> cmdlist;
+    struct reply {
+            std::string daemonStamp;
+    } cmd_reply;
+    enum ReadType {
+        READ_LINE,
+        READ_STRING,
+        READ_SIZE,
+    } reading_type_;
+    char *size_data;
+    gsize size_count;
+    gsize size_left;
+
+       void clean_command();
+       void request_command();
+       void disconnect();
+       static gboolean on_io_in_event(GIOChannel *, GIOCondition, gpointer);
+       static gboolean on_io_out_event(GIOChannel *, GIOCondition, gpointer);
+    void connect();
+    static void on_resolved(gpointer data, bool resolved, in_addr_t sa);
+       static void on_connected(gpointer data, bool succeeded);
+    void write_str(const char *str, GError **err);
+    bool parse(gchar *line);
+    int parse_banner(gchar *line);
+    int parse_command_client(gchar *line);
+    int parse_command_auth(gchar *line);
+    int parse_command_register(gchar *line);
+    int parse_command_setdictmask(gchar *line);
+    int parse_command_getdictmask(STARDICT::Cmd* cmd, gchar *line);
+    int parse_command_dirinfo(STARDICT::Cmd* cmd, gchar *line);
+    int parse_command_dictinfo(STARDICT::Cmd* cmd, gchar *line);
+    int parse_command_maxdictcount(STARDICT::Cmd* cmd, gchar *line);
+    int parse_command_quit(gchar *line);
+    int parse_dict_result(STARDICT::Cmd* cmd, gchar *buf);
+    int parse_wordlist(STARDICT::Cmd* cmd, gchar *buf);
+};
+
+#endif
diff --git a/src/lib/stardict_libconfig.h b/src/lib/stardict_libconfig.h
new file mode 100644 (file)
index 0000000..bf98f79
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef _STARDICT_LIBCONFIG_H_
+#define _STARDICT_LIBCONFIG_H_
+
+//stardict
+#define SD_STANDARD_EDITION
+
+//stardictd
+//#define SD_SERVER_EDITION
+
+
+#ifdef SD_STANDARD_EDITION
+#define SD_CLIENT_CODE
+#undef SD_SERVER_CODE
+#endif
+
+#ifdef SD_SERVER_EDITION
+#undef SD_CLIENT_CODE
+#define SD_SERVER_CODE
+#endif
+
+#endif
diff --git a/src/lib/stddict.cpp b/src/lib/stddict.cpp
new file mode 100644 (file)
index 0000000..feaf793
--- /dev/null
@@ -0,0 +1,3263 @@
+/*
+ * This file part of StarDict - A international dictionary for GNOME.
+ * http://stardict.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * Implementation of class to work with standard StarDict's dictionaries
+ * lookup word, get articles and so on.
+ *
+ * Notice: read doc/DICTFILE_FORMAT for the dictionary
+ * file's format information!
+ */
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <glib/gi18n.h>
+#include <glib/gstdio.h>
+
+#include "common.hpp"
+#include "distance.h"
+#include "kmp.h"
+#include "mapfile.hpp"
+
+#include "stddict.hpp"
+#include <algorithm>
+#include "getuint32.h"
+
+static inline gint stardict_strcmp(const gchar *s1, const gchar *s2)
+{
+  gint a=g_ascii_strcasecmp(s1, s2);
+  if (a == 0)
+    return strcmp(s1, s2);
+  else
+    return a;
+}
+
+static gint stardict_collate(const gchar *str1, const gchar *str2, CollateFunctions func)
+{
+       gint x = utf8_collate(str1, str2, func);
+       if (x == 0)
+               return strcmp(str1, str2);
+       else
+               return x;
+}
+
+gint stardict_server_collate(const gchar *str1, const gchar *str2, int EnableCollationLevel, CollateFunctions func, int servercollatefunc)
+{
+       if (EnableCollationLevel == 0)
+               return stardict_strcmp(str1, str2);
+       if (EnableCollationLevel == 1)
+               return stardict_collate(str1, str2, func);
+       if (servercollatefunc == 0)
+               return stardict_strcmp(str1, str2);
+       return stardict_collate(str1, str2, (CollateFunctions)(servercollatefunc-1));
+}
+
+gint stardict_casecmp(const gchar *s1, const gchar *s2, int EnableCollationLevel, CollateFunctions func, int servercollatefunc)
+{
+       if (EnableCollationLevel == 0)
+               return g_ascii_strcasecmp(s1, s2);
+       if (EnableCollationLevel == 1)
+               return utf8_collate(s1, s2, func);
+       if (servercollatefunc == 0)
+               return g_ascii_strcasecmp(s1, s2);
+       return utf8_collate(s1, s2, (CollateFunctions)(servercollatefunc-1));
+}
+
+static inline gint prefix_match (const gchar *s1, const gchar *s2)
+{
+    gint ret=-1;
+    gunichar u1, u2;
+    do {
+        u1 = g_utf8_get_char(s1);
+        u2 = g_utf8_get_char(s2);
+        s1 = g_utf8_next_char(s1);
+        s2 = g_utf8_next_char(s2);
+        ret++;
+    } while (u1 && g_unichar_tolower(u1) == g_unichar_tolower(u2));
+    return ret;
+}
+
+static inline bool bIsVowel(gchar inputchar)
+{
+  gchar ch = g_ascii_toupper(inputchar);
+  return( ch=='A' || ch=='E' || ch=='I' || ch=='O' || ch=='U' );
+}
+
+
+bool bIsPureEnglish(const gchar *str)
+{
+  // i think this should work even when it is UTF8 string :).
+  for (int i=0; str[i]!=0; i++)
+    //if(str[i]<0)
+    //if(str[i]<32 || str[i]>126) // tab equal 9,so this is not OK.
+    // Better use isascii() but not str[i]<0 while char is default unsigned in arm
+    if (!isascii(str[i]))
+            return false;
+  return true;
+}
+
+class offset_index : public index_file {
+public:
+       offset_index();
+       ~offset_index();
+       bool load(const std::string& url, gulong wc, gulong fsize,
+                 bool CreateCacheFile, int EnableCollationLevel,
+                 CollateFunctions _CollateFunction, show_progress_t *sp);
+       void get_data(glong idx);
+       const gchar *get_key_and_data(glong idx);
+private:
+       const gchar *get_key(glong idx);
+       bool lookup(const char *str, glong &idx, glong &idx_suggest);
+
+       static const gint ENTR_PER_PAGE=32;
+
+       cache_file oft_file;
+       FILE *idxfile;
+       gulong npages;
+
+       gchar wordentry_buf[256+sizeof(guint32)*2]; // The length of "word_str" should be less than 256. See doc/DICTFILE_FORMAT.
+       struct index_entry {
+               glong idx;
+               std::string keystr;
+               void assign(glong i, const std::string& str) {
+                       idx=i;
+                       keystr.assign(str);
+               }
+       };
+       index_entry first, last, middle, real_last;
+
+       struct page_entry {
+               gchar *keystr;
+               guint32 off, size;
+       };
+       std::vector<gchar> page_data;
+       struct page_t {
+               glong idx;
+               page_entry entries[ENTR_PER_PAGE];
+
+               page_t(): idx(-1) {}
+               void fill(gchar *data, gint nent, glong idx_);
+       } page;
+       gulong load_page(glong page_idx);
+       const gchar *read_first_on_page_key(glong page_idx);
+       const gchar *get_first_on_page_key(glong page_idx);
+};
+
+class wordlist_index : public index_file {
+public:
+       wordlist_index();
+       ~wordlist_index();
+       bool load(const std::string& url, gulong wc, gulong fsize,
+                 bool CreateCacheFile, int EnableCollationLevel,
+                 CollateFunctions _CollateFunction, show_progress_t *sp);
+       void get_data(glong idx);
+       const gchar *get_key_and_data(glong idx);
+private:
+       const gchar *get_key(glong idx);
+       bool lookup(const char *str, glong &idx, glong &idx_suggest);
+
+       gchar *idxdatabuf;
+       std::vector<gchar *> wordlist;
+};
+
+offset_index::offset_index() : oft_file(CacheFileType_oft)
+{
+       clt_file = NULL;
+       idxfile = NULL;
+}
+
+offset_index::~offset_index()
+{
+       delete clt_file;
+       if (idxfile)
+               fclose(idxfile);
+}
+
+void offset_index::page_t::fill(gchar *data, gint nent, glong idx_)
+{
+       idx=idx_;
+       gchar *p=data;
+       glong len;
+       for (gint i=0; i<nent; ++i) {
+               entries[i].keystr=p;
+               len=strlen(p);
+               p+=len+1;
+               entries[i].off=g_ntohl(get_uint32(p));
+               p+=sizeof(guint32);
+               entries[i].size=g_ntohl(get_uint32(p));
+               p+=sizeof(guint32);
+       }
+}
+
+inline const gchar *offset_index::read_first_on_page_key(glong page_idx)
+{
+       fseek(idxfile, oft_file.wordoffset[page_idx], SEEK_SET);
+       guint32 page_size=oft_file.wordoffset[page_idx+1]-oft_file.wordoffset[page_idx];
+       gulong minsize = sizeof(wordentry_buf);
+       if (page_size < minsize)
+               minsize = page_size;
+       fread(wordentry_buf, minsize, 1, idxfile); //TODO: check returned values, deal with word entry that strlen>255.
+       return wordentry_buf;
+}
+
+inline const gchar *offset_index::get_first_on_page_key(glong page_idx)
+{
+       if (page_idx<middle.idx) {
+               if (page_idx==first.idx)
+                       return first.keystr.c_str();
+               return read_first_on_page_key(page_idx);
+       } else if (page_idx>middle.idx) {
+               if (page_idx==last.idx)
+                       return last.keystr.c_str();
+               return read_first_on_page_key(page_idx);
+       } else
+               return middle.keystr.c_str();
+}
+
+cache_file::cache_file(CacheFileType _cachefiletype)
+{
+       wordoffset = NULL;
+       mf = NULL;
+       cachefiletype = _cachefiletype;
+}
+
+
+cache_file::~cache_file()
+{
+       if (mf)
+               delete mf;
+       else
+               g_free(wordoffset);
+}
+
+#define OFFSETFILE_MAGIC_DATA "StarDict's oft file\nversion=2.4.8\n"
+#define COLLATIONFILE_MAGIC_DATA "StarDict's clt file\nversion=2.4.8\n"
+
+MapFile* cache_file::get_cache_loadfile(const gchar *filename, const std::string &url, const std::string &saveurl, CollateFunctions cltfunc, glong filedatasize, int next)
+{
+       struct stat cachestat;
+       if (g_stat(filename, &cachestat)!=0)
+               return NULL;
+       MapFile *mf = new MapFile;
+       if (!mf->open(filename, cachestat.st_size)) {
+               delete mf;
+               return NULL;
+       }
+
+       gchar *p = mf->begin();
+       gboolean has_prefix;
+       if (cachefiletype == CacheFileType_oft)
+               has_prefix = g_str_has_prefix(p, OFFSETFILE_MAGIC_DATA);
+       else
+               has_prefix = g_str_has_prefix(p, COLLATIONFILE_MAGIC_DATA);
+       if (!has_prefix) {
+               delete mf;
+               return NULL;
+       }
+       if (cachefiletype == CacheFileType_oft)
+               p+= sizeof(OFFSETFILE_MAGIC_DATA)-1-1;
+       else
+               p+= sizeof(COLLATIONFILE_MAGIC_DATA)-1-1;
+       gchar *p2;
+       p2 = strstr(p, "\nurl=");
+       if (!p2) {
+               delete mf;
+               return NULL;
+       }
+       p2+=sizeof("\nurl=")-1;
+       gchar *p3;
+       p3 = strchr(p2, '\n');
+       if (!p3) {
+               delete mf;
+               return NULL;
+       }
+       gchar *tmpstr;
+       tmpstr = (gchar *)g_memdup(p2, p3-p2+1);
+       tmpstr[p3-p2] = '\0';
+       if (saveurl == tmpstr) {
+               g_free(tmpstr);
+               if (cachefiletype == CacheFileType_clt) {
+                       p2 = strstr(p, "\nfunc=");
+                       if (!p2) {
+                               delete mf;
+                               return NULL;
+                       }
+                       p2+=sizeof("\nfunc=")-1;
+                       p3 = strchr(p2, '\n');
+                       if (!p3) {
+                               delete mf;
+                               return NULL;
+                       }
+                       tmpstr = (gchar *)g_memdup(p2, p3-p2+1);
+                       tmpstr[p3-p2] = '\0';
+                       if (atoi(tmpstr)!=cltfunc) {
+                               g_free(tmpstr);
+                               delete mf;
+                               return NULL;
+                       }
+                       g_free(tmpstr);
+               }
+               if (cachestat.st_size!=glong(filedatasize + strlen(mf->begin()) +1)) {
+                       delete mf;
+                       return NULL;
+               }
+               struct stat idxstat;
+               if (g_stat(url.c_str(), &idxstat)!=0) {
+                       delete mf;
+                       return NULL;
+               }
+               if (cachestat.st_mtime<idxstat.st_mtime) {
+                       delete mf;
+                       return NULL;
+               }
+               //g_print("Using map file: %s\n", filename);
+               return mf;
+       }
+       g_free(tmpstr);
+       delete mf;
+       gchar *basename = g_path_get_basename(saveurl.c_str());
+       p = strrchr(basename, '.');
+       if (!p) {
+               g_free(basename);
+               return NULL;
+       }
+       *p='\0';
+       gchar *extendname = p+1;
+       gchar *dirname = g_path_get_dirname(filename);
+       gchar *nextfilename;
+       if (cachefiletype == CacheFileType_oft)
+               nextfilename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s(%d).%s.oft", dirname, basename, next, extendname);
+       else if (cachefiletype == CacheFileType_clt)
+               nextfilename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s(%d).%s.clt", dirname, basename, next, extendname);
+       else
+               nextfilename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s(%d).%s.%d.clt", dirname, basename, next, extendname, cltfunc);
+       MapFile *out = get_cache_loadfile(nextfilename, url, saveurl, cltfunc, filedatasize, next+1);
+       g_free(basename);
+       g_free(dirname);
+       g_free(nextfilename);
+       return out;
+}
+
+bool cache_file::load_cache(const std::string& url, const std::string& saveurl, CollateFunctions cltfunc, glong filedatasize)
+{
+       std::string oftfilename;
+       if (cachefiletype == CacheFileType_oft)
+               oftfilename=saveurl+".oft";
+       else if (cachefiletype == CacheFileType_clt)
+               oftfilename=saveurl+".clt";
+       else {
+               gchar *func = g_strdup_printf("%d", cltfunc);
+               oftfilename=saveurl+'.'+func+".clt";
+               g_free(func);
+       }
+       for (int i=0;i<2;i++) {
+               if (i==1) {
+                       if (!get_cache_filename(saveurl, oftfilename, false, cltfunc))
+                               break;
+               }
+               mf = get_cache_loadfile(oftfilename.c_str(), url, saveurl, cltfunc, filedatasize, 2);
+               if (!mf)
+                       continue;
+               wordoffset = (guint32 *)(mf->begin()+strlen(mf->begin())+1);
+               return true;
+       }
+       return false;
+}
+
+bool cache_file::get_cache_filename(const std::string& url, std::string &cachefilename, bool create, CollateFunctions cltfunc)
+{
+       if (create) {
+               if (!g_file_test(g_get_user_cache_dir(), G_FILE_TEST_EXISTS) &&
+                   g_mkdir(g_get_user_cache_dir(), 0700)==-1)
+                       return false;
+       }
+
+       std::string cache_dir=g_get_user_cache_dir();
+       cache_dir += G_DIR_SEPARATOR_S "stardict";
+
+       if (create) {
+               if (!g_file_test(cache_dir.c_str(), G_FILE_TEST_EXISTS)) {
+                       if (g_mkdir(cache_dir.c_str(), 0700)==-1)
+                               return false;
+               } else if (!g_file_test(cache_dir.c_str(), G_FILE_TEST_IS_DIR))
+                       return false;
+       }
+
+       gchar *base=g_path_get_basename(url.c_str());
+       if (cachefiletype == CacheFileType_oft) {
+               cachefilename = cache_dir+G_DIR_SEPARATOR_S+base+".oft";
+       } else if (cachefiletype == CacheFileType_clt) {
+               cachefilename = cache_dir+G_DIR_SEPARATOR_S+base+".clt";
+       } else {
+               gchar *func = g_strdup_printf("%d", cltfunc);
+               cachefilename = cache_dir+G_DIR_SEPARATOR_S+base+'.'+func+".clt";
+               g_free(func);
+       }
+       g_free(base);
+       return true;
+}
+
+FILE* cache_file::get_cache_savefile(const gchar *filename, const std::string &url, int next, std::string &cfilename, CollateFunctions cltfunc)
+{
+       cfilename = filename;
+       struct stat oftstat;
+       if (g_stat(filename, &oftstat)!=0) {
+               return fopen(filename, "wb");
+       }
+       MapFile mf;
+       if (!mf.open(filename, oftstat.st_size)) {
+               return fopen(filename, "wb");
+       }
+       gchar *p = mf.begin();
+       bool has_prefix;
+       if (cachefiletype == CacheFileType_oft)
+               has_prefix = g_str_has_prefix(p, OFFSETFILE_MAGIC_DATA);
+       else
+               has_prefix = g_str_has_prefix(p, COLLATIONFILE_MAGIC_DATA);
+       if (!has_prefix) {
+               mf.close();
+               return fopen(filename, "wb");
+       }
+       if (cachefiletype == CacheFileType_oft)
+               p+= sizeof(OFFSETFILE_MAGIC_DATA)-1-1;
+       else
+               p+= sizeof(COLLATIONFILE_MAGIC_DATA)-1-1;
+       gchar *p2;
+       p2 = strstr(p, "\nurl=");
+       if (!p2) {
+               mf.close();
+               return fopen(filename, "wb");
+       }
+       p2+=sizeof("\nurl=")-1;
+       gchar *p3;
+       p3 = strchr(p2, '\n');
+       if (!p3) {
+               mf.close();
+               return fopen(filename, "wb");
+       }
+       gchar *tmpstr;
+       tmpstr = (gchar *)g_memdup(p2, p3-p2+1);
+       tmpstr[p3-p2] = '\0';
+       if (url == tmpstr) {
+               g_free(tmpstr);
+               mf.close();
+               return fopen(filename, "wb");
+       }
+       g_free(tmpstr);
+       mf.close();
+       gchar *basename = g_path_get_basename(url.c_str());
+       p = strrchr(basename, '.');
+       if (!p) {
+               g_free(basename);
+               return NULL;
+       }
+       *p='\0';
+       gchar *extendname = p+1;
+       gchar *dirname = g_path_get_dirname(filename);
+       gchar *nextfilename;
+       if (cachefiletype == CacheFileType_oft)
+               nextfilename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s(%d).%s.oft", dirname, basename, next, extendname);
+       else if (cachefiletype == CacheFileType_clt)
+               nextfilename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s(%d).%s.clt", dirname, basename, next, extendname);
+       else
+               nextfilename = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s(%d).%s.%d.clt", dirname, basename, next, extendname, cltfunc);
+       FILE *out = get_cache_savefile(nextfilename, url, next+1, cfilename, cltfunc);
+       g_free(basename);
+       g_free(dirname);
+       g_free(nextfilename);
+       return out;
+}
+
+bool cache_file::save_cache(const std::string& url, CollateFunctions cltfunc, gulong npages)
+{
+       std::string oftfilename;
+       if (cachefiletype == CacheFileType_oft) {
+               oftfilename=url+".oft";
+       } else if (cachefiletype == CacheFileType_clt) {
+               oftfilename=url+".clt";
+       } else {
+               gchar *func = g_strdup_printf("%d", cltfunc);
+               oftfilename=url+'.'+func+".clt";
+               g_free(func);
+       }
+       for (int i=0;i<2;i++) {
+               if (i==1) {
+                       if (!get_cache_filename(url, oftfilename, true, cltfunc))
+                               break;
+               }
+               std::string cfilename;
+               FILE *out= get_cache_savefile(oftfilename.c_str(), url, 2, cfilename, cltfunc);
+               if (!out)
+                       continue;
+               if (cachefiletype == CacheFileType_oft)
+                       fwrite(OFFSETFILE_MAGIC_DATA, 1, sizeof(OFFSETFILE_MAGIC_DATA)-1, out);
+               else
+                       fwrite(COLLATIONFILE_MAGIC_DATA, 1, sizeof(COLLATIONFILE_MAGIC_DATA)-1, out);
+               fwrite("url=", 1, sizeof("url=")-1, out);
+               fwrite(url.c_str(), 1, url.length(), out);
+               if (cachefiletype == CacheFileType_clt) {
+#ifdef _MSC_VER
+                       fprintf_s(out, "\nfunc=%d", cltfunc);
+#else
+                       fprintf(out, "\nfunc=%d", cltfunc);
+#endif
+               }
+               fwrite("\n", 1, 2, out);
+               fwrite(wordoffset, sizeof(guint32), npages, out);
+               fclose(out);
+               g_print("Save cache file: %s\n", cfilename.c_str());
+               return true;
+       }
+       return false;
+}
+
+collation_file::collation_file(idxsyn_file *_idx_file, CacheFileType _cachefiletype) : cache_file(_cachefiletype)
+{
+       idx_file = _idx_file;
+}
+
+const gchar *collation_file::GetWord(glong idx)
+{
+       return idx_file->get_key(wordoffset[idx]);
+}
+
+glong collation_file::GetOrigIndex(glong cltidx)
+{
+       return wordoffset[cltidx];
+}
+
+bool collation_file::lookup(const char *sWord, glong &idx, glong &idx_suggest)
+{
+       bool bFound=false;
+       glong iTo=idx_file->wordcount-1;
+       if (stardict_collate(sWord, GetWord(0), CollateFunction)<0) {
+               idx = 0;
+               idx_suggest = 0;
+       } else if (stardict_collate(sWord, GetWord(iTo), CollateFunction) >0) {
+               idx = INVALID_INDEX;
+               idx_suggest = iTo;
+       } else {
+               glong iThisIndex=0;
+               glong iFrom=0;
+               gint cmpint;
+               while (iFrom<=iTo) {
+                       iThisIndex=(iFrom+iTo)/2;
+                       cmpint = stardict_collate(sWord, GetWord(iThisIndex), CollateFunction);
+                       if (cmpint>0)
+                               iFrom=iThisIndex+1;
+                       else if (cmpint<0)
+                               iTo=iThisIndex-1;
+                       else {
+                               bFound=true;
+                               break;
+                       }
+               }
+               if (!bFound) {
+                       idx = iFrom;    //next
+                       idx_suggest = iFrom;
+                       gint best, back;
+                       best = prefix_match (sWord, GetWord(idx_suggest));
+                       for (;;) {
+                               if ((iTo=idx_suggest-1) < 0)
+                                       break;
+                               back = prefix_match (sWord, GetWord(iTo));
+                               if (!back || back < best)
+                                       break;
+                               best = back;
+                               idx_suggest = iTo;
+                       }
+               } else {
+                       idx = iThisIndex;
+                       idx_suggest = iThisIndex;
+               }
+       }
+       return bFound;
+}
+
+struct sort_collation_index_user_data {
+       idxsyn_file *idx_file;
+       CollateFunctions cltfunc;
+};
+
+static gint sort_collation_index(gconstpointer a, gconstpointer b, gpointer user_data)
+{
+       sort_collation_index_user_data *data = (sort_collation_index_user_data*)user_data;
+       gchar *str1 = g_strdup(data->idx_file->get_key(*((guint32 *)a)));
+       const gchar *str2 = data->idx_file->get_key(*((guint32 *)b));
+       gint x = stardict_collate(str1, str2, data->cltfunc);
+       g_free(str1);
+       if (x==0)
+               return *((guint32 *)a) - *((guint32 *)b);
+       else
+               return x;
+}
+
+idxsyn_file::idxsyn_file()
+{
+       memset(clt_files, 0, sizeof(clt_files));
+}
+
+const gchar *idxsyn_file::getWord(glong idx, int EnableCollationLevel, int servercollatefunc)
+{
+       if (EnableCollationLevel == 0)
+               return get_key(idx);
+       if (EnableCollationLevel == 1)
+               return clt_file->GetWord(idx);
+       if (servercollatefunc == 0)
+               return get_key(idx);
+       collate_load((CollateFunctions)(servercollatefunc-1));
+       return clt_files[servercollatefunc-1]->GetWord(idx);
+}
+
+bool idxsyn_file::Lookup(const char *str, glong &idx, glong &idx_suggest, int EnableCollationLevel, int servercollatefunc)
+{
+       if (EnableCollationLevel == 0)
+               return lookup(str, idx, idx_suggest);
+       if (EnableCollationLevel == 1)
+               return clt_file->lookup(str, idx, idx_suggest);
+       if (servercollatefunc == 0)
+               return lookup(str, idx, idx_suggest);
+       collate_load((CollateFunctions)(servercollatefunc-1));
+       return clt_files[servercollatefunc-1]->lookup(str, idx, idx_suggest);
+}
+
+void idxsyn_file::collate_sort(const std::string& url,
+                              const std::string& saveurl,
+                              CollateFunctions collf,
+                              show_progress_t *sp)
+{
+       clt_file = new collation_file(this, CacheFileType_clt);
+       clt_file->CollateFunction = collf;
+       if (!clt_file->load_cache(url, saveurl, collf, wordcount*sizeof(guint32))) {
+               sp->notify_about_start(_("Sorting, please wait..."));
+               clt_file->wordoffset = (guint32 *)g_malloc(wordcount*sizeof(guint32));
+               for (glong i=0; i<wordcount; i++)
+                       clt_file->wordoffset[i] = i;
+               sort_collation_index_user_data data;
+               data.idx_file = this;
+               data.cltfunc = collf;
+               g_qsort_with_data(clt_file->wordoffset, wordcount, sizeof(guint32), sort_collation_index, &data);
+               if (!clt_file->save_cache(saveurl, collf, wordcount))
+                       g_printerr("Cache update failed.\n");
+       }
+}
+
+void idxsyn_file::collate_save_info(const std::string& _url, const std::string& _saveurl)
+{
+       url = _url;
+       saveurl = _saveurl;
+}
+
+void idxsyn_file::collate_load(CollateFunctions collf)
+{
+       if (clt_files[collf])
+               return;
+       clt_files[collf] = new collation_file(this, CacheFileType_server_clt);
+       clt_files[collf]->CollateFunction = collf;
+       if (!clt_files[collf]->load_cache(url, saveurl, collf, wordcount*sizeof(guint32))) {
+               clt_files[collf]->wordoffset = (guint32 *)g_malloc(wordcount*sizeof(guint32));
+               for (glong i=0; i<wordcount; i++)
+                       clt_files[collf]->wordoffset[i] = i;
+               sort_collation_index_user_data data;
+               data.idx_file = this;
+               data.cltfunc = collf;
+               g_qsort_with_data(clt_files[collf]->wordoffset, wordcount, sizeof(guint32), sort_collation_index, &data);
+               if (!clt_files[collf]->save_cache(saveurl, collf, wordcount))
+                       g_printerr("Cache update failed.\n");
+       }
+}
+
+bool offset_index::load(const std::string& url, gulong wc, gulong fsize,
+                       bool CreateCacheFile, int EnableCollationLevel,
+                       CollateFunctions _CollateFunction, show_progress_t *sp)
+{
+       wordcount=wc;
+       npages=(wc-1)/ENTR_PER_PAGE+2;
+       if (!oft_file.load_cache(url, url, _CollateFunction, npages*sizeof(guint32))) {
+               MapFile map_file;
+               if (!map_file.open(url.c_str(), fsize))
+                       return false;
+               const gchar *idxdatabuffer=map_file.begin();
+               oft_file.wordoffset = (guint32 *)g_malloc(npages*sizeof(guint32));
+               const gchar *p1 = idxdatabuffer;
+               gulong index_size;
+               guint32 j=0;
+               for (guint32 i=0; i<wc; i++) {
+                       index_size=strlen(p1) +1 + 2*sizeof(guint32);
+                       if (i % ENTR_PER_PAGE==0) {
+                               oft_file.wordoffset[j]=p1-idxdatabuffer;
+                               ++j;
+                       }
+                       p1 += index_size;
+               }
+               oft_file.wordoffset[j]=p1-idxdatabuffer;
+               map_file.close();
+               if (CreateCacheFile) {
+                       if (!oft_file.save_cache(url, _CollateFunction, npages))
+                               g_printerr("Cache update failed.\n");
+               }
+       }
+
+       if (!(idxfile = fopen(url.c_str(), "rb"))) {
+               return false;
+       }
+
+       first.assign(0, read_first_on_page_key(0));
+       last.assign(npages-2, read_first_on_page_key(npages-2));
+       middle.assign((npages-2)/2, read_first_on_page_key((npages-2)/2));
+       real_last.assign(wc-1, get_key(wc-1));
+
+       if (EnableCollationLevel == 0) {
+       } else if (EnableCollationLevel == 1) {
+               collate_sort(url, url, _CollateFunction, sp);
+       } else if (EnableCollationLevel == 2) {
+               collate_save_info(url, url);
+       }
+
+       return true;
+}
+
+inline gulong offset_index::load_page(glong page_idx)
+{
+       gulong nentr=ENTR_PER_PAGE;
+       if (page_idx==glong(npages-2))
+               if ((nentr=wordcount%ENTR_PER_PAGE)==0)
+                       nentr=ENTR_PER_PAGE;
+
+
+       if (page_idx!=page.idx) {
+               page_data.resize(oft_file.wordoffset[page_idx+1]-oft_file.wordoffset[page_idx]);
+               fseek(idxfile, oft_file.wordoffset[page_idx], SEEK_SET);
+               fread(&page_data[0], 1, page_data.size(), idxfile);
+               page.fill(&page_data[0], nentr, page_idx);
+       }
+
+       return nentr;
+}
+
+const gchar *offset_index::get_key(glong idx)
+{
+       load_page(idx/ENTR_PER_PAGE);
+       glong idx_in_page=idx%ENTR_PER_PAGE;
+       wordentry_offset=page.entries[idx_in_page].off;
+       wordentry_size=page.entries[idx_in_page].size;
+
+       return page.entries[idx_in_page].keystr;
+}
+
+void offset_index::get_data(glong idx)
+{
+       get_key(idx);
+}
+
+const gchar *offset_index::get_key_and_data(glong idx)
+{
+       return get_key(idx);
+}
+
+bool offset_index::lookup(const char *str, glong &idx, glong &idx_suggest)
+{
+       bool bFound=false;
+       glong iFrom;
+       glong iTo=npages-2;
+       gint cmpint;
+       glong iThisIndex;
+       if (stardict_strcmp(str, first.keystr.c_str())<0) {
+               idx = 0;
+               idx_suggest = 0;
+               return false;
+       } else if (stardict_strcmp(str, real_last.keystr.c_str()) >0) {
+               idx = INVALID_INDEX;
+               idx_suggest = iTo;
+               return false;
+       } else {
+               iFrom=0;
+               iThisIndex=0;
+               while (iFrom<=iTo) {
+                       iThisIndex=(iFrom+iTo)/2;
+                       cmpint = stardict_strcmp(str, get_first_on_page_key(iThisIndex));
+                       if (cmpint>0)
+                               iFrom=iThisIndex+1;
+                       else if (cmpint<0)
+                               iTo=iThisIndex-1;
+                       else {
+                               bFound=true;
+                               break;
+                       }
+               }
+               if (!bFound) {
+                       idx = iTo;    //prev
+               } else {
+                       idx = iThisIndex;
+               }
+       }
+       if (!bFound) {
+               gulong netr=load_page(idx);
+               iFrom=1; // Needn't search the first word anymore.
+               iTo=netr-1;
+               iThisIndex=0;
+               while (iFrom<=iTo) {
+                       iThisIndex=(iFrom+iTo)/2;
+                       cmpint = stardict_strcmp(str, page.entries[iThisIndex].keystr);
+                       if (cmpint>0)
+                               iFrom=iThisIndex+1;
+                       else if (cmpint<0)
+                               iTo=iThisIndex-1;
+                       else {
+                               bFound=true;
+                               break;
+                       }
+               }
+               idx*=ENTR_PER_PAGE;
+               if (!bFound) {
+                       idx += iFrom;    //next
+                       idx_suggest = idx;
+                       gint best, back;
+                       best = prefix_match (str, page.entries[idx_suggest % ENTR_PER_PAGE].keystr);
+                       for (;;) {
+                               if ((iTo=idx_suggest-1) < 0)
+                                       break;
+                               if (idx_suggest % ENTR_PER_PAGE == 0)
+                                       load_page(iTo / ENTR_PER_PAGE);
+                               back = prefix_match (str, page.entries[iTo % ENTR_PER_PAGE].keystr);
+                               if (!back || back < best)
+                                       break;
+                               best = back;
+                               idx_suggest = iTo;
+                       }
+               } else {
+                       idx += iThisIndex;
+                       idx_suggest = idx;
+               }
+       } else {
+               idx*=ENTR_PER_PAGE;
+               idx_suggest = idx;
+       }
+       return bFound;
+}
+
+wordlist_index::wordlist_index()
+{
+       clt_file = NULL;
+       idxdatabuf = NULL;
+}
+
+wordlist_index::~wordlist_index()
+{
+       delete clt_file;
+       g_free(idxdatabuf);
+}
+
+bool wordlist_index::load(const std::string& url, gulong wc, gulong fsize,
+                         bool CreateCacheFile, int EnableCollationLevel,
+                         CollateFunctions _CollateFunction, show_progress_t *sp)
+{
+       wordcount=wc;
+       gzFile in = gzopen(url.c_str(), "rb");
+       if (in == NULL)
+               return false;
+
+       idxdatabuf = (gchar *)g_malloc(fsize);
+
+       gulong len = gzread(in, idxdatabuf, fsize);
+       gzclose(in);
+       if (len < 0)
+               return false;
+
+       if (len != fsize)
+               return false;
+
+       wordlist.resize(wc+1);
+       gchar *p1 = idxdatabuf;
+       guint32 i;
+       for (i=0; i<wc; i++) {
+               wordlist[i] = p1;
+               p1 += strlen(p1) +1 + 2*sizeof(guint32);
+       }
+       wordlist[wc] = p1;
+
+       if (EnableCollationLevel == 0) {
+       } else {
+               std::string saveurl = url;
+               saveurl.erase(saveurl.length()-sizeof(".gz")+1, sizeof(".gz")-1);
+               if (EnableCollationLevel == 1) {
+                       collate_sort(url, saveurl, _CollateFunction, sp);
+               } else if (EnableCollationLevel == 2) {
+                       collate_save_info(url, saveurl);
+               }
+       }
+       return true;
+}
+
+const gchar *wordlist_index::get_key(glong idx)
+{
+       return wordlist[idx];
+}
+
+void wordlist_index::get_data(glong idx)
+{
+       gchar *p1 = wordlist[idx]+strlen(wordlist[idx])+sizeof(gchar);
+       wordentry_offset = g_ntohl(get_uint32(p1));
+       p1 += sizeof(guint32);
+       wordentry_size = g_ntohl(get_uint32(p1));
+}
+
+const gchar *wordlist_index::get_key_and_data(glong idx)
+{
+       get_data(idx);
+       return get_key(idx);
+}
+
+bool wordlist_index::lookup(const char *str, glong &idx, glong &idx_suggest)
+{
+       bool bFound=false;
+       glong iTo=wordlist.size()-2;
+
+       if (stardict_strcmp(str, get_key(0))<0) {
+               idx = 0;
+               idx_suggest = 0;
+       } else if (stardict_strcmp(str, get_key(iTo)) >0) {
+               idx = INVALID_INDEX;
+               idx_suggest = iTo;
+       } else {
+               glong iThisIndex=0;
+               glong iFrom=0;
+               gint cmpint;
+               while (iFrom<=iTo) {
+                       iThisIndex=(iFrom+iTo)/2;
+                       cmpint = stardict_strcmp(str, get_key(iThisIndex));
+                       if (cmpint>0)
+                               iFrom=iThisIndex+1;
+                       else if (cmpint<0)
+                               iTo=iThisIndex-1;
+                       else {
+                               bFound=true;
+                               break;
+                       }
+               }
+               if (!bFound) {
+                       idx = iFrom;    //next
+                       idx_suggest = iFrom;
+                       gint best, back;
+                       best = prefix_match (str, get_key(idx_suggest));
+                       for (;;) {
+                               if ((iTo=idx_suggest-1) < 0)
+                                       break;
+                               back = prefix_match (str, get_key(iTo));
+                               if (!back || back < best)
+                                       break;
+                               best = back;
+                               idx_suggest = iTo;
+                       }
+               } else {
+                       idx = iThisIndex;
+                       idx_suggest = iThisIndex;
+               }
+       }
+       return bFound;
+}
+
+//===================================================================
+void synonym_file::page_t::fill(gchar *data, gint nent, glong idx_)
+{
+       idx=idx_;
+       gchar *p=data;
+       glong len;
+       for (gint i=0; i<nent; ++i) {
+               entries[i].keystr=p;
+               len=strlen(p);
+               p+=len+1;
+               entries[i].index=g_ntohl(get_uint32(p));
+               p+=sizeof(guint32);
+       }
+}
+
+synonym_file::synonym_file() : oft_file(CacheFileType_oft)
+{
+       clt_file = NULL;
+}
+
+synonym_file::~synonym_file()
+{
+       delete clt_file;
+       if (synfile)
+               fclose(synfile);
+}
+
+inline const gchar *synonym_file::read_first_on_page_key(glong page_idx)
+{
+       fseek(synfile, oft_file.wordoffset[page_idx], SEEK_SET);
+       guint32 page_size=oft_file.wordoffset[page_idx+1]-oft_file.wordoffset[page_idx];
+       gulong minsize = sizeof(wordentry_buf);
+        if (page_size < minsize)
+                minsize = page_size;
+       fread(wordentry_buf, minsize, 1, synfile); //TODO: check returned values, deal with word entry that strlen>255.
+       return wordentry_buf;
+}
+
+inline const gchar *synonym_file::get_first_on_page_key(glong page_idx)
+{
+       if (page_idx<middle.idx) {
+               if (page_idx==first.idx)
+                       return first.keystr.c_str();
+               return read_first_on_page_key(page_idx);
+       } else if (page_idx>middle.idx) {
+               if (page_idx==last.idx)
+                       return last.keystr.c_str();
+               return read_first_on_page_key(page_idx);
+       } else
+               return middle.keystr.c_str();
+}
+
+bool synonym_file::load(const std::string& url, gulong wc, bool CreateCacheFile,
+                       int EnableCollationLevel, CollateFunctions _CollateFunction,
+                       show_progress_t *sp)
+{
+       wordcount=wc;
+       npages=(wc-1)/ENTR_PER_PAGE+2;
+       if (!oft_file.load_cache(url, url, _CollateFunction, npages*sizeof(guint32))) {
+               struct stat stats;
+               if (stat (url.c_str(), &stats) == -1)
+                       return false;
+               MapFile map_file;
+               if (!map_file.open(url.c_str(), stats.st_size))
+                       return false;
+               const gchar *syndatabuffer=map_file.begin();
+               oft_file.wordoffset = (guint32 *)g_malloc(npages*sizeof(guint32));
+               const gchar *p1 = syndatabuffer;
+               gulong index_size;
+               guint32 j=0;
+               for (guint32 i=0; i<wc; i++) {
+                       index_size=strlen(p1) +1 + sizeof(guint32);
+                       if (i % ENTR_PER_PAGE==0) {
+                               oft_file.wordoffset[j]=p1-syndatabuffer;
+                               ++j;
+                       }
+                       p1 += index_size;
+               }
+               oft_file.wordoffset[j]=p1-syndatabuffer;
+               map_file.close();
+               if (CreateCacheFile) {
+                       if (!oft_file.save_cache(url, _CollateFunction, npages))
+                               g_printerr("Cache update failed.\n");
+               }
+       }
+
+       if (!(synfile = fopen(url.c_str(), "rb"))) {
+               return false;
+       }
+
+       first.assign(0, read_first_on_page_key(0));
+       last.assign(npages-2, read_first_on_page_key(npages-2));
+       middle.assign((npages-2)/2, read_first_on_page_key((npages-2)/2));
+       real_last.assign(wc-1, get_key(wc-1));
+
+       if (EnableCollationLevel == 0) {
+       } else if (EnableCollationLevel == 1)
+               collate_sort(url, url, _CollateFunction, sp);
+       else if (EnableCollationLevel == 2) {
+               collate_save_info(url, url);
+       }
+
+       return true;
+}
+
+inline gulong synonym_file::load_page(glong page_idx)
+{
+       gulong nentr=ENTR_PER_PAGE;
+       if (page_idx==glong(npages-2))
+               if ((nentr=wordcount%ENTR_PER_PAGE)==0)
+                       nentr=ENTR_PER_PAGE;
+
+
+       if (page_idx!=page.idx) {
+               page_data.resize(oft_file.wordoffset[page_idx+1]-oft_file.wordoffset[page_idx]);
+               fseek(synfile, oft_file.wordoffset[page_idx], SEEK_SET);
+               fread(&page_data[0], 1, page_data.size(), synfile);
+               page.fill(&page_data[0], nentr, page_idx);
+       }
+
+       return nentr;
+}
+
+const gchar *synonym_file::get_key(glong idx)
+{
+       load_page(idx/ENTR_PER_PAGE);
+       glong idx_in_page=idx%ENTR_PER_PAGE;
+       wordentry_index=page.entries[idx_in_page].index;
+
+       return page.entries[idx_in_page].keystr;
+}
+
+bool synonym_file::lookup(const char *str, glong &idx, glong &idx_suggest)
+{
+       bool bFound=false;
+       glong iFrom;
+       glong iTo=npages-2;
+       gint cmpint;
+       glong iThisIndex;
+       if (stardict_strcmp(str, first.keystr.c_str())<0) {
+               idx = 0;
+               idx_suggest = 0;
+               return false;
+       } else if (stardict_strcmp(str, real_last.keystr.c_str()) >0) {
+               idx = INVALID_INDEX;
+               idx_suggest = iTo;
+               return false;
+       } else {
+               iFrom=0;
+               iThisIndex=0;
+               while (iFrom<=iTo) {
+                       iThisIndex=(iFrom+iTo)/2;
+                       cmpint = stardict_strcmp(str, get_first_on_page_key(iThisIndex));
+                       if (cmpint>0)
+                               iFrom=iThisIndex+1;
+                       else if (cmpint<0)
+                               iTo=iThisIndex-1;
+                       else {
+                               bFound=true;
+                               break;
+                       }
+               }
+               if (!bFound)
+                       idx = iTo;    //prev
+               else
+                       idx = iThisIndex;
+       }
+       if (!bFound) {
+               gulong netr=load_page(idx);
+               iFrom=1; // Needn't search the first word anymore.
+               iTo=netr-1;
+               iThisIndex=0;
+               while (iFrom<=iTo) {
+                       iThisIndex=(iFrom+iTo)/2;
+                       cmpint = stardict_strcmp(str, page.entries[iThisIndex].keystr);
+                       if (cmpint>0)
+                               iFrom=iThisIndex+1;
+                       else if (cmpint<0)
+                               iTo=iThisIndex-1;
+                       else {
+                               bFound=true;
+                               break;
+                       }
+               }
+               idx*=ENTR_PER_PAGE;
+               if (!bFound) {
+                       idx += iFrom;    //next
+                       idx_suggest = idx;
+                       gint best, back;
+                       best = prefix_match (str, page.entries[idx_suggest % ENTR_PER_PAGE].keystr);
+                       for (;;) {
+                               if ((iTo=idx_suggest-1) < 0)
+                                       break;
+                               if (idx_suggest % ENTR_PER_PAGE == 0)
+                                       load_page(iTo / ENTR_PER_PAGE);
+                               back = prefix_match (str, page.entries[iTo % ENTR_PER_PAGE].keystr);
+                               if (!back || back < best)
+                                       break;
+                               best = back;
+                               idx_suggest = iTo;
+                       }
+               } else {
+                       idx += iThisIndex;
+                       idx_suggest = idx;
+               }
+       } else {
+               idx*=ENTR_PER_PAGE;
+               idx_suggest = idx;
+       }
+       return bFound;
+}
+
+//===================================================================
+Dict::Dict()
+{
+       storage = NULL;
+}
+
+Dict::~Dict()
+{
+       delete storage;
+}
+
+bool Dict::load(const std::string& ifofilename, bool CreateCacheFile,
+               int EnableCollationLevel, CollateFunctions CollateFunction,
+               show_progress_t *sp)
+{
+       gulong idxfilesize;
+       glong wordcount, synwordcount;
+       if (!load_ifofile(ifofilename, idxfilesize, wordcount, synwordcount))
+               return false;
+       sp->notify_about_start(_("Loading..."));
+       std::string fullfilename(ifofilename);
+       fullfilename.replace(fullfilename.length()-sizeof("ifo")+1, sizeof("ifo")-1, "dict.dz");
+
+       if (g_file_test(fullfilename.c_str(), G_FILE_TEST_EXISTS)) {
+               dictdzfile.reset(new dictData);
+               if (!dictdzfile->open(fullfilename, 0)) {
+                       //g_print("open file %s failed!\n",fullfilename);
+                       return false;
+               }
+       } else {
+               fullfilename.erase(fullfilename.length()-sizeof(".dz")+1, sizeof(".dz")-1);
+               dictfile = fopen(fullfilename.c_str(),"rb");
+               if (!dictfile) {
+                       //g_print("open file %s failed!\n",fullfilename);
+                       return false;
+               }
+       }
+
+       fullfilename=ifofilename;
+       fullfilename.replace(fullfilename.length()-sizeof("ifo")+1, sizeof("ifo")-1, "idx.gz");
+
+       if (g_file_test(fullfilename.c_str(), G_FILE_TEST_EXISTS)) {
+               idx_file.reset(new wordlist_index);
+       } else {
+               fullfilename.erase(fullfilename.length()-sizeof(".gz")+1, sizeof(".gz")-1);
+               idx_file.reset(new offset_index);
+       }
+
+       if (!idx_file->load(fullfilename, wordcount, idxfilesize,
+                           CreateCacheFile, EnableCollationLevel,
+                           CollateFunction, sp))
+               return false;
+
+       if (synwordcount) {
+               fullfilename=ifofilename;
+               fullfilename.replace(fullfilename.length()-sizeof("ifo")+1, sizeof("ifo")-1, "syn");
+               if (g_file_test(fullfilename.c_str(), G_FILE_TEST_EXISTS)) {
+                       syn_file.reset(new synonym_file);
+                       if (!syn_file->load(fullfilename, synwordcount,
+                                           CreateCacheFile, EnableCollationLevel,
+                                           CollateFunction, sp))
+                               return false;
+               }
+       }
+
+       bool has_res = false;
+       gchar *dirname = g_path_get_dirname(ifofilename.c_str());
+       fullfilename = dirname;
+       fullfilename += G_DIR_SEPARATOR_S "res";
+       if (g_file_test(fullfilename.c_str(), G_FILE_TEST_IS_DIR)) {
+               has_res = true;
+       } else {
+               fullfilename = dirname;
+               fullfilename += G_DIR_SEPARATOR_S "res.rifo";
+               if (g_file_test(fullfilename.c_str(), G_FILE_TEST_EXISTS)) {
+                       has_res = true;
+               }
+       }
+       if (has_res) {
+               storage = new ResourceStorage();
+               bool failed = storage->load(dirname);
+               if (failed) {
+                       delete storage;
+                       storage = NULL;
+               }
+       }
+       g_free(dirname);
+
+       g_print("bookname: %s , wordcount %lu\n", bookname.c_str(), wordcount);
+       return true;
+}
+
+bool Dict::load_ifofile(const std::string& ifofilename, gulong &idxfilesize, glong &wordcount, glong &synwordcount)
+{
+       DictInfo dict_info;
+       if (!dict_info.load_from_ifo_file(ifofilename, false))
+               return false;
+       if (dict_info.wordcount==0)
+               return false;
+
+       ifo_file_name=dict_info.ifo_file_name;
+       bookname=dict_info.bookname;
+
+       idxfilesize=dict_info.index_file_size;
+       wordcount=dict_info.wordcount;
+       synwordcount=dict_info.synwordcount;
+
+       sametypesequence=dict_info.sametypesequence;
+       dicttype=dict_info.dicttype;
+
+       return true;
+}
+
+glong Dict::nsynarticles()
+{
+       if (syn_file.get() == NULL)
+               return 0;
+       return syn_file->wordcount;
+}
+
+bool Dict::GetWordPrev(glong idx, glong &pidx, bool isidx, int EnableCollationLevel, int servercollatefunc)
+{
+       idxsyn_file *is_file;
+       if (isidx)
+               is_file = idx_file.get();
+       else
+               is_file = syn_file.get();
+       if (idx==INVALID_INDEX) {
+               pidx = is_file->wordcount-1;
+               return true;
+       }
+       pidx = idx;
+       gchar *cWord = g_strdup(is_file->getWord(pidx, EnableCollationLevel, servercollatefunc));
+       const gchar *pWord;
+       bool found=false;
+       while (pidx>0) {
+               pWord = is_file->getWord(pidx-1, EnableCollationLevel, servercollatefunc);
+               if (strcmp(pWord, cWord)!=0) {
+                       found=true;
+                       break;
+               }
+               pidx--;
+       }
+       g_free(cWord);
+       if (found) {
+               pidx--;
+               return true;
+       } else {
+               return false;
+       }
+}
+
+void Dict::GetWordNext(glong &idx, bool isidx, int EnableCollationLevel, int servercollatefunc)
+{
+       idxsyn_file *is_file;
+       if (isidx)
+               is_file = idx_file.get();
+       else
+               is_file = syn_file.get();
+       gchar *cWord = g_strdup(is_file->getWord(idx, EnableCollationLevel, servercollatefunc));
+       const gchar *pWord;
+       bool found=false;
+       while (idx < is_file->wordcount-1) {
+               pWord = is_file->getWord(idx+1, EnableCollationLevel, servercollatefunc);
+               if (strcmp(pWord, cWord)!=0) {
+                       found=true;
+                       break;
+               }
+               idx++;
+       }
+       g_free(cWord);
+       if (found)
+               idx++;
+       else
+               idx=INVALID_INDEX;
+}
+
+gint Dict::GetOrigWordCount(glong& idx, bool isidx)
+{
+       idxsyn_file *is_file;
+       if (isidx)
+               is_file = idx_file.get();
+       else
+               is_file = syn_file.get();
+       gchar *cWord = g_strdup(is_file->get_key(idx));
+       const gchar *pWord;
+       gint count = 1;
+       glong idx1 = idx;
+       while (idx1>0) {
+               pWord = is_file->get_key(idx1-1);
+               if (strcmp(pWord, cWord)!=0)
+                       break;
+               count++;
+               idx1--;
+       }
+       glong idx2=idx;
+       while (idx2<is_file->wordcount-1) {
+               pWord = is_file->get_key(idx2+1);
+               if (strcmp(pWord, cWord)!=0)
+                       break;
+               count++;
+               idx2++;
+       }
+       idx=idx1;
+       g_free(cWord);
+       return count;
+}
+
+bool Dict::LookupSynonym(const char *str, glong &synidx, glong &synidx_suggest, int EnableCollationLevel, int servercollatefunc)
+{
+       if (syn_file.get() == NULL) {
+               synidx = UNSET_INDEX;
+               synidx_suggest = UNSET_INDEX;
+               return false;
+       }
+       return syn_file->Lookup(str, synidx, synidx_suggest, EnableCollationLevel, servercollatefunc);
+}
+
+bool Dict::LookupWithRule(GPatternSpec *pspec, glong *aIndex, int iBuffLen)
+{
+       int iIndexCount=0;
+       for (glong i=0; i<narticles() && iIndexCount<iBuffLen-1; i++)
+               // Need to deal with same word in index? But this will slow down processing in most case.
+               if (g_pattern_match_string(pspec, idx_file->getWord(i, 0, 0)))
+                       aIndex[iIndexCount++]=i;
+       aIndex[iIndexCount]= -1; // -1 is the end.
+       return (iIndexCount>0);
+}
+
+bool Dict::LookupWithRuleSynonym(GPatternSpec *pspec, glong *aIndex, int iBuffLen)
+{
+       if (syn_file.get() == NULL)
+               return false;
+       int iIndexCount=0;
+       for (glong i=0; i<nsynarticles() && iIndexCount<iBuffLen-1; i++)
+               // Need to deal with same word in index? But this will slow down processing in most case.
+               if (g_pattern_match_string(pspec, syn_file->getWord(i, 0, 0)))
+                       aIndex[iIndexCount++]=i;
+       aIndex[iIndexCount]= -1; // -1 is the end.
+       return (iIndexCount>0);
+}
+
+bool Dict::LookupWithRegex(GRegex *regex, glong *aIndex, int iBuffLen)
+{
+       int iIndexCount=0;
+       for (glong i=0; i<narticles() && iIndexCount<iBuffLen-1; i++)
+               // Need to deal with same word in index? But this will slow down processing in most case.
+               if (g_regex_match(regex, idx_file->getWord(i, 0, 0), (GRegexMatchFlags)0, NULL))
+                       aIndex[iIndexCount++]=i;
+       aIndex[iIndexCount]= -1; // -1 is the end.
+       return (iIndexCount>0);
+}
+
+bool Dict::LookupWithRegexSynonym(GRegex *regex, glong *aIndex, int iBuffLen)
+{
+       if (syn_file.get() == NULL)
+               return false;
+       int iIndexCount=0;
+       for (glong i=0; i<nsynarticles() && iIndexCount<iBuffLen-1; i++)
+               // Need to deal with same word in index? But this will slow down processing in most case.
+               if (g_regex_match(regex, syn_file->getWord(i, 0, 0), (GRegexMatchFlags)0, NULL))
+                       aIndex[iIndexCount++]=i;
+       aIndex[iIndexCount]= -1; // -1 is the end.
+       return (iIndexCount>0);
+}
+
+//===================================================================
+show_progress_t Libs::default_show_progress;
+
+Libs::Libs(show_progress_t *sp, bool create, int enablelevel, int function)
+{
+#ifdef SD_SERVER_CODE
+       root_info_item = NULL;
+#endif
+       set_show_progress(sp);
+       CreateCacheFile = create;
+       EnableCollationLevel = enablelevel;
+       CollateFunction = (CollateFunctions)function;
+       iMaxFuzzyDistance  = MAX_FUZZY_DISTANCE; //need to read from cfg.
+       if (EnableCollationLevel == 0) {
+       } else if (EnableCollationLevel == 1) {
+               if (utf8_collate_init(CollateFunction))
+                       printf("Init collate function failed!\n");
+       } else if (EnableCollationLevel == 2){
+               if (utf8_collate_init_all())
+                       printf("Init collate functions failed!\n");
+       }
+}
+
+Libs::~Libs()
+{
+#ifdef SD_SERVER_CODE
+       if (root_info_item)
+               delete root_info_item;
+#endif
+       for (std::vector<Dict *>::iterator p=oLib.begin(); p!=oLib.end(); ++p)
+               delete *p;
+       utf8_collate_end();
+}
+
+bool Libs::load_dict(const std::string& url, show_progress_t *sp)
+{
+       Dict *lib=new Dict;
+       if (lib->load(url, CreateCacheFile, EnableCollationLevel,
+                     CollateFunction, sp)) {
+               oLib.push_back(lib);
+               return true;
+       } else {
+               delete lib;
+               return false;
+       }
+}
+
+#ifdef SD_SERVER_CODE
+void Libs::LoadFromXML()
+{
+       root_info_item = new DictInfoItem();
+       root_info_item->isdir = 1;
+       root_info_item->dir = new DictInfoDirItem();
+       root_info_item->dir->name='/';
+       LoadXMLDir("/usr/share/stardict/dic", root_info_item);
+       GenLinkDict(root_info_item);
+}
+
+void Libs::GenLinkDict(DictInfoItem *info_item)
+{
+       std::list<std::list<DictInfoItem *>::iterator> eraselist;
+       for (std::list<DictInfoItem *>::iterator i = info_item->dir->info_item_list.begin(); i!= info_item->dir->info_item_list.end(); ++i) {
+               if ((*i)->isdir == 1) {
+                       GenLinkDict(*i);
+               } else if ((*i)->isdir == 2) {
+                       std::map<std::string, DictInfoDictItem *>::iterator uid_iter;
+                       uid_iter = uidmap.find(*((*i)->linkuid));
+                       if (uid_iter!=uidmap.end()) {
+                               delete (*i)->linkuid;
+                               (*i)->dict = uid_iter->second;
+                       } else {
+                               g_print("Error, linkdict uid not found! %s\n", (*i)->linkuid->c_str());
+                               delete (*i)->linkuid;
+                               eraselist.push_back(i);
+                       }
+               }
+       }
+       for (std::list<std::list<DictInfoItem *>::iterator>::iterator i = eraselist.begin(); i!= eraselist.end(); ++i) {
+               info_item->dir->info_item_list.erase(*i);
+       }
+}
+
+void Libs::func_parse_start_element(GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer user_data, GError **error)
+{
+       if (strcmp(element_name, "dict")==0) {
+               ParseUserData *Data = (ParseUserData *)user_data;
+               Data->indict = true;
+               Data->path.clear();
+               Data->uid.clear();
+               Data->level.clear();
+               Data->download.clear();
+               Data->from.clear();
+               Data->to.clear();
+       } else if (strcmp(element_name, "linkdict")==0) {
+               ParseUserData *Data = (ParseUserData *)user_data;
+               Data->inlinkdict = true;
+               Data->linkuid.clear();
+       }
+}
+
+void Libs::func_parse_end_element(GMarkupParseContext *context, const gchar *element_name, gpointer user_data, GError **error)
+{
+       if (strcmp(element_name, "dict")==0) {
+               ParseUserData *Data = (ParseUserData *)user_data;
+               Data->indict = false;
+               if (!Data->path.empty() && !Data->uid.empty()) {
+                       std::string url;
+                       url = Data->dir;
+                       url += G_DIR_SEPARATOR;
+                       url += Data->path;
+                       if (Data->oLibs->load_dict(url, Data->oLibs->show_progress)) {
+                               DictInfoItem *sub_info_item = new DictInfoItem();
+                               sub_info_item->isdir = 0;
+                               sub_info_item->dict = new DictInfoDictItem();
+                               sub_info_item->dict->uid = Data->uid;
+                               sub_info_item->dict->download = Data->download;
+                               sub_info_item->dict->from = Data->from;
+                               sub_info_item->dict->to = Data->to;
+                               if (Data->level.empty())
+                                       sub_info_item->dict->level = 0;
+                               else
+                                       sub_info_item->dict->level = atoi(Data->level.c_str());
+                               sub_info_item->dict->id = Data->oLibs->oLib.size()-1;
+                               Data->info_item->dir->info_item_list.push_back(sub_info_item);
+                               Data->oLibs->uidmap[Data->uid] = sub_info_item->dict;
+                       }
+               }
+       } else if (strcmp(element_name, "linkdict")==0) {
+               ParseUserData *Data = (ParseUserData *)user_data;
+               Data->inlinkdict = false;
+               if (!Data->linkuid.empty()) {
+                       DictInfoItem *sub_info_item = new DictInfoItem();
+                       sub_info_item->isdir = 2;
+                       sub_info_item->linkuid = new std::string(Data->linkuid);
+                       Data->info_item->dir->info_item_list.push_back(sub_info_item);
+               }
+       }
+}
+
+void Libs::func_parse_text(GMarkupParseContext *context, const gchar *text, gsize text_len, gpointer user_data, GError **error)
+{
+       const gchar *element = g_markup_parse_context_get_element(context);
+       if (!element)
+               return;
+       ParseUserData *Data = (ParseUserData *)user_data;
+       if (strcmp(element, "subdir")==0) {
+               std::string subdir;
+               subdir = Data->dir;
+               subdir += G_DIR_SEPARATOR;
+               subdir.append(text, text_len);
+               DictInfoItem *sub_info_item = new DictInfoItem();
+               sub_info_item->isdir = 1;
+               sub_info_item->dir = new DictInfoDirItem();
+               sub_info_item->dir->name.assign(text, text_len);
+               Data->oLibs->LoadXMLDir(subdir.c_str(), sub_info_item);
+               Data->info_item->dir->info_item_list.push_back(sub_info_item);
+       } else if (strcmp(element, "dirname")==0) {
+               Data->info_item->dir->dirname.assign(text, text_len);
+       } else if (strcmp(element, "path")==0) {
+               Data->path.assign(text, text_len);
+       } else if (strcmp(element, "uid")==0) {
+               if (Data->indict) {
+                       std::string uid(text, text_len);
+                       if (uid.find_first_of(' ')!=std::string::npos) {
+                               g_print("Error: uid contains space! %s: %s\n", Data->dir, uid.c_str());
+                       } else {
+                               std::map<std::string, DictInfoDictItem *>::iterator uid_iter;
+                               uid_iter = Data->oLibs->uidmap.find(uid);
+                               if (uid_iter!=Data->oLibs->uidmap.end()) {
+                                       g_print("Error: uid duplicated! %s: %s\n", Data->dir, uid.c_str());
+                               } else {
+                                       Data->uid = uid;
+                               }
+                       }
+               } else if (Data->inlinkdict) {
+                       Data->linkuid.assign(text, text_len);
+               }
+       } else if (strcmp(element, "level")==0) {
+               Data->level.assign(text, text_len);
+       } else if (strcmp(element, "download")==0) {
+               Data->download.assign(text, text_len);
+       } else if (strcmp(element, "from")==0) {
+               Data->from.assign(text, text_len);
+       } else if (strcmp(element, "to")==0) {
+               Data->to.assign(text, text_len);
+       }
+}
+
+void Libs::LoadXMLDir(const char *dir, DictInfoItem *info_item)
+{
+       std::string filename;
+       filename = dir;
+       filename += G_DIR_SEPARATOR_S "stardictd.xml";
+       struct stat filestat;
+       if (g_stat(filename.c_str(), &filestat)!=0)
+               return;
+       MapFile mf;
+       if (!mf.open(filename.c_str(), filestat.st_size))
+               return;
+       ParseUserData Data;
+       Data.oLibs = this;
+       Data.dir = dir;
+       Data.info_item = info_item;
+       Data.indict = false;
+       Data.inlinkdict = false;
+       GMarkupParser parser;
+       parser.start_element = func_parse_start_element;
+       parser.end_element = func_parse_end_element;
+       parser.text = func_parse_text;
+       parser.passthrough = NULL;
+       parser.error = NULL;
+       GMarkupParseContext* context = g_markup_parse_context_new(&parser, (GMarkupParseFlags)0, &Data, NULL);
+       g_markup_parse_context_parse(context, mf.begin(), filestat.st_size, NULL);
+       g_markup_parse_context_end_parse(context, NULL);
+       g_markup_parse_context_free(context);
+       mf.close();
+       info_item->dir->dictcount = 0;
+       for (std::list<DictInfoItem *>::iterator i = info_item->dir->info_item_list.begin(); i!= info_item->dir->info_item_list.end(); ++i) {
+               if ((*i)->isdir == 1) {
+                       info_item->dir->dictcount += (*i)->dir->dictcount;
+               } else if ((*i)->isdir == 0) {
+                       info_item->dir->dictcount++;
+               }
+       }
+}
+
+const std::string &Libs::get_fromto_info() {
+       if(cache_fromto.empty()){
+               std::map<std::string, std::list<FromTo> > map_fromto;
+               gen_fromto_info(root_info_item, map_fromto);
+               cache_fromto+="<lang>";
+               for (std::map<std::string, std::list<FromTo> >::iterator map_it = map_fromto.begin(); map_it != map_fromto.end(); ++map_it){
+                       cache_fromto+="<from lang=\"";
+                       cache_fromto+=map_it->first;
+                       cache_fromto+="\">";
+                       std::list<FromTo> &fromTo = map_it->second;
+                       for (std::list<FromTo>::iterator i = fromTo.begin() ; i!= fromTo.end(); ++i){
+                               cache_fromto+="<to lang=\"";
+                               cache_fromto+= i->to;
+                               cache_fromto+="\">";
+                               std::list<FromToInfo> &fromtoinfo = i->fromto_info;
+                               for (std::list<FromToInfo>::iterator j = fromtoinfo.begin() ; j!= fromtoinfo.end(); ++j){
+                                       cache_fromto+="<dict><uid>";
+                                       cache_fromto+=j->uid;
+                                       cache_fromto+="</uid><bookname>";
+                                       cache_fromto+= j->bookname;
+                                       cache_fromto+="</bookname></dict>";
+                               }
+                               cache_fromto+="</to>";
+                       }
+                       cache_fromto+="</from>";
+               }
+               cache_fromto+="</lang>";
+       }
+       return cache_fromto;
+}
+
+void Libs::gen_fromto_info(struct DictInfoItem *info_item, std::map<std::string, std::list<FromTo> > &map_fromto) {
+       gchar *etext;
+       for(std::list<DictInfoItem *>::iterator i = info_item->dir->info_item_list.begin() ; i!= info_item->dir->info_item_list.end(); ++i){
+               if ((*i)->isdir == 1) {
+                       gen_fromto_info((*i), map_fromto);
+               } else {
+                       std::string from_str     = (*i)->dict->from;
+                       std::string to_str       = (*i)->dict->to;
+                       if(from_str.empty() || to_str.empty()){
+                               continue;
+                       }
+                       std::string uid_str      = (*i)->dict->uid;
+                       etext = g_markup_escape_text(oLib[(*i)->dict->id]->dict_name().c_str(), -1);
+                       std::string bookname_str = etext;
+                       g_free(etext);
+                       std::map<std::string, std::list<FromTo> >::iterator fromto1 = map_fromto.find(from_str);
+                       if (fromto1==map_fromto.end()) {
+                               //if an from_str element not already in map,  add new from_str to map
+                               FromToInfo fromtoinfo;
+                               fromtoinfo.uid = uid_str;
+                               fromtoinfo.bookname = bookname_str;
+                               std::list<FromToInfo> list_fromtoinfo ;
+                               list_fromtoinfo.push_back(fromtoinfo);
+                               FromTo new_fromTo;
+                               new_fromTo.to = to_str;
+                               new_fromTo.fromto_info = list_fromtoinfo;
+                               std::list<FromTo> list_fromTo;
+                               list_fromTo.push_back(new_fromTo);
+                               map_fromto[from_str] = list_fromTo;
+                       } else {
+                               // else if from_str already in map, so comparison to_str and from_to1 , then choose insert.
+                               std::list<FromTo> &fromTo_list = fromto1->second;
+                               std::string from_name1 = fromto1->first;
+                               bool found = false;
+                               for (std::list<FromTo>::iterator new_fromTo = fromTo_list.begin(); new_fromTo != fromTo_list.end(); ++new_fromTo) {
+                                       if(to_str == new_fromTo->to) {
+                                               std::list<FromToInfo> &fromtoinfo1 = new_fromTo->fromto_info;
+                                               FromToInfo fromtoinfo;
+                                               fromtoinfo.uid = uid_str;
+                                               fromtoinfo.bookname = bookname_str;
+                                               fromtoinfo1.push_back(fromtoinfo);
+                                               found = true;
+                                               break;
+                                       }
+                               }
+                               if(!found){
+                                       FromToInfo fromtoinfo;
+                                       fromtoinfo.uid = uid_str;
+                                       fromtoinfo.bookname = bookname_str;
+                                       std::list<FromToInfo> fromtoinfo1;
+                                       fromtoinfo1.push_back(fromtoinfo);
+                                       FromTo fromTo;
+                                       fromTo.to = to_str;
+                                       fromTo.fromto_info = fromtoinfo1;
+                                       fromTo_list.push_back(fromTo);
+                               }                               
+                       }
+               }
+       }
+}
+
+const std::string *Libs::get_dir_info(const char *path)
+{
+       if (path[0]!='/')
+               return NULL;
+       DictInfoItem *info_item = root_info_item;
+       std::string item;
+       const char *p = path+1;
+       const char *p1;
+       bool found;
+       do {
+               p1 = strchr(p, '/');
+               if (p1) {
+                       item.assign(p, p1-p);
+                       if (!item.empty()) {
+                               found = false;
+                               for (std::list<DictInfoItem *>::iterator i = info_item->dir->info_item_list.begin(); i!= info_item->dir->info_item_list.end(); ++i) {
+                                       if ((*i)->isdir == 1) {
+                                               if ((*i)->dir->name == item) {
+                                                       info_item = (*i);
+                                                       found = true;
+                                                       break;
+                                               }
+                                       }
+                               }
+                               if (!found)
+                                       return NULL;
+                       }
+                       p = p1+1;
+               }
+       } while (p1);
+       if (*p)
+               return NULL; // Not end by '/'.
+       DictInfoDirItem *dir = info_item->dir;
+       if (dir->info_string.empty()) {
+               dir->info_string += "<parent>";
+               dir->info_string += path;
+               dir->info_string += "</parent>";
+               gchar *etext;
+               for (std::list<DictInfoItem *>::iterator i = info_item->dir->info_item_list.begin(); i!= info_item->dir->info_item_list.end(); ++i) {
+                       if ((*i)->isdir == 1) {
+                               dir->info_string += "<dir><name>";
+                               dir->info_string += (*i)->dir->name;
+                               dir->info_string += "</name><dirname>";
+                               dir->info_string += (*i)->dir->dirname;
+                               dir->info_string += "</dirname><dictcount>";
+                               gchar *dictcount = g_strdup_printf("%u", (*i)->dir->dictcount);
+                               dir->info_string += dictcount;
+                               g_free(dictcount);
+                               dir->info_string += "</dictcount></dir>";
+                       } else {
+                               dir->info_string += "<dict>";
+                               if ((*i)->isdir == 2)
+                                       dir->info_string += "<islink>1</islink>";
+                               if ((*i)->dict->level != 0) {
+                                       dir->info_string += "<level>";
+                                       gchar *level = g_strdup_printf("%u", (*i)->dict->level);
+                                       dir->info_string += level;
+                                       g_free(level);
+                                       dir->info_string += "</level>";
+                               }
+                               dir->info_string += "<uid>";
+                               dir->info_string += (*i)->dict->uid;
+                               dir->info_string += "</uid><bookname>";
+                               etext = g_markup_escape_text(oLib[(*i)->dict->id]->dict_name().c_str(), -1);
+                               dir->info_string += etext;
+                               g_free(etext);
+                               dir->info_string += "</bookname><wordcount>";
+                               gchar *wc = g_strdup_printf("%ld", oLib[(*i)->dict->id]->narticles());
+                               dir->info_string += wc;
+                               g_free(wc);
+                               dir->info_string += "</wordcount></dict>";
+                       }
+               }
+       }
+       return &(dir->info_string);
+}
+
+int Libs::get_dict_level(const char *uid)
+{
+       std::map<std::string, DictInfoDictItem *>::iterator uid_iter;
+       uid_iter = uidmap.find(uid);
+       if (uid_iter==uidmap.end())
+               return -1;
+       return uid_iter->second->level;
+}
+
+std::string Libs::get_dicts_list(const char *dictmask, int max_dict_count, int userLevel)
+{
+       std::list<std::string> uid_list;
+       std::string uid;
+       const char *p, *p1;
+       p = dictmask;
+       do {
+               p1 = strchr(p, ' ');
+               if (p1) {
+                       uid.assign(p, p1-p);
+                       if (!uid.empty())
+                               uid_list.push_back(uid);
+                       p = p1+1;
+               }
+       } while (p1);
+       uid = p;
+       if (!uid.empty())
+               uid_list.push_back(uid);
+
+       std::string dictmask_str;
+       int count = 0;
+       const std::string *info_string;
+       int level;
+       for (std::list<std::string>::iterator i = uid_list.begin(); i!= uid_list.end(); ++i) {
+               level = get_dict_level((*i).c_str());
+               if (level < 0 || level > userLevel)
+                       continue;
+               info_string = get_dict_info(i->c_str(), true);
+               if (info_string) {
+                       if (count>=max_dict_count)
+                               break;
+                       dictmask_str += info_string->c_str();
+                       count++;
+               }
+       }
+       return dictmask_str;
+}
+
+const std::string *Libs::get_dict_info(const char *uid, bool is_short)
+{
+       std::map<std::string, DictInfoDictItem *>::iterator uid_iter;
+       uid_iter = uidmap.find(uid);
+       if (uid_iter==uidmap.end())
+               return NULL;
+       DictInfoDictItem *dict;
+       dict = uid_iter->second;
+       if (is_short) {
+               if (dict->short_info_string.empty()) {
+                       gchar *etext;
+                       dict->short_info_string += "<dict><uid>";
+                       dict->short_info_string += uid;
+                       dict->short_info_string += "</uid><bookname>";
+                       etext = g_markup_escape_text(oLib[dict->id]->dict_name().c_str(), -1);
+                       dict->short_info_string += etext;
+                       g_free(etext);
+                       dict->short_info_string += "</bookname><wordcount>";
+                       gchar *wc = g_strdup_printf("%ld", oLib[dict->id]->narticles());
+                       dict->short_info_string += wc;
+                       g_free(wc);
+                       dict->short_info_string += "</wordcount></dict>";
+               }
+               return &(dict->short_info_string);
+       } else {
+               if (dict->info_string.empty()) {
+                       gchar *etext;
+                       DictInfo dict_info;
+                       if (!dict_info.load_from_ifo_file(oLib[dict->id]->ifofilename(), false))
+                               return NULL;
+                       dict->info_string += "<dictinfo><bookname>";
+                       etext = g_markup_escape_text(dict_info.bookname.c_str(), -1);
+                       dict->info_string += etext;
+                       g_free(etext);
+                       dict->info_string += "</bookname><wordcount>";
+                       gchar *wc = g_strdup_printf("%u", dict_info.wordcount);
+                       dict->info_string += wc;
+                       g_free(wc);
+                       dict->info_string += "</wordcount>";
+                       if (dict_info.synwordcount!=0) {
+                               dict->info_string += "<synwordcount>";
+                               wc = g_strdup_printf("%u", dict_info.synwordcount);
+                               dict->info_string += wc;
+                               g_free(wc);
+                               dict->info_string += "</synwordcount>";
+                       }
+                       dict->info_string += "<author>";
+                       etext = g_markup_escape_text(dict_info.author.c_str(), -1);
+                       dict->info_string += etext;
+                       g_free(etext);
+                       dict->info_string += "</author><email>";
+                       etext = g_markup_escape_text(dict_info.email.c_str(), -1);
+                       dict->info_string += etext;
+                       g_free(etext);
+                       dict->info_string += "</email><website>";
+                       etext = g_markup_escape_text(dict_info.website.c_str(), -1);
+                       dict->info_string += etext;
+                       g_free(etext);
+                       dict->info_string += "</website><description>";
+                       etext = g_markup_escape_text(dict_info.description.c_str(), -1);
+                       dict->info_string += etext;
+                       g_free(etext);
+                       dict->info_string += "</description><date>";
+                       etext = g_markup_escape_text(dict_info.date.c_str(), -1);
+                       dict->info_string += etext;
+                       g_free(etext);
+                       dict->info_string += "</date><download>";
+                       etext = g_markup_escape_text(dict->download.c_str(), -1);
+                       dict->info_string += etext;
+                       g_free(etext);
+                       dict->info_string += "</download></dictinfo>";
+               }
+               return &(dict->info_string);
+       }
+}
+
+void Libs::SetServerDictMask(std::vector<InstantDictIndex> &dictmask, const char *dicts, int max, int userLevel)
+{
+       InstantDictIndex instance_dict_index;
+       instance_dict_index.type = InstantDictType_LOCAL;
+       dictmask.clear();
+       std::list<std::string> uid_list;
+       std::string uid;
+       const char *p, *p1;
+       p = dicts;
+       do {
+               p1 = strchr(p, ' ');
+               if (p1) {
+                       uid.assign(p, p1-p);
+                       if (!uid.empty())
+                               uid_list.push_back(uid);
+                       p = p1+1;
+               }
+       } while (p1);
+       uid = p;
+       if (!uid.empty())
+               uid_list.push_back(uid);
+       int count = 0;
+       std::map<std::string, DictInfoDictItem *>::iterator uid_iter;
+       for (std::list<std::string>::iterator i = uid_list.begin(); i!= uid_list.end(); ++i) {
+               uid_iter = uidmap.find(*i);
+               if (uid_iter!=uidmap.end()) {
+                       if (max>=0 && count >= max)
+                               break;
+                       if (userLevel>=0 && (unsigned int)userLevel< uid_iter->second->level)
+                               continue;
+                       instance_dict_index.index = uid_iter->second->id;
+                       dictmask.push_back(instance_dict_index);
+                       count++;
+               }
+       }
+}
+
+void Libs::LoadCollateFile(std::vector<InstantDictIndex> &dictmask, CollateFunctions cltfuc)
+{
+       for (std::vector<InstantDictIndex>::iterator i = dictmask.begin(); i!=dictmask.end(); ++i) {
+               if ((*i).type == InstantDictType_LOCAL) {
+                       oLib[(*i).index]->idx_file->collate_load(cltfuc);
+                       if (oLib[(*i).index]->syn_file.get() != NULL)
+                               oLib[(*i).index]->syn_file->collate_load(cltfuc);
+               }
+       }
+}
+#endif
+
+#ifdef SD_CLIENT_CODE
+bool Libs::find_lib_by_filename(const char *filename, size_t &iLib)
+{
+       for (std::vector<Dict *>::size_type i =0; i < oLib.size(); i++) {
+               if (oLib[i]->ifofilename() == filename) {
+                       iLib = i;
+                       return true;
+               }
+       }
+       return false;
+}
+
+void Libs::load(std::list<std::string> &load_list)
+{
+       for (std::list<std::string>::iterator i = load_list.begin(); i != load_list.end(); ++i) {
+               load_dict(*i, show_progress);
+       }
+}
+
+void Libs::reload(std::list<std::string> &load_list, int is_coll_enb, int collf)
+{
+       if (is_coll_enb == EnableCollationLevel && collf == CollateFunction) {
+               std::vector<Dict *> prev(oLib);
+               oLib.clear();
+               for (std::list<std::string>::iterator i = load_list.begin(); i != load_list.end(); ++i) {
+                       std::vector<Dict *>::iterator it;
+                       for (it=prev.begin(); it!=prev.end(); ++it) {
+                               if ((*it)->ifofilename()==*i)
+                                       break;
+                       }
+                       if (it==prev.end()) {
+                               load_dict(*i, show_progress);
+                       } else {
+                               Dict *res=*it;
+                               prev.erase(it);
+                               oLib.push_back(res);
+                       }
+               }
+               for (std::vector<Dict *>::iterator it=prev.begin(); it!=prev.end(); ++it) {
+                       delete *it;
+               }
+       } else {
+               for (std::vector<Dict *>::iterator it = oLib.begin(); it != oLib.end(); ++it)
+                       delete *it;
+               oLib.clear();
+               EnableCollationLevel = is_coll_enb;
+               CollateFunction = CollateFunctions(collf);
+               if (EnableCollationLevel == 0) {
+               } else if (EnableCollationLevel == 1) {
+                       if (utf8_collate_init(CollateFunction))
+                               printf("Init collate function failed!\n");
+               } else if (EnableCollationLevel == 2) {
+                       if (utf8_collate_init_all())
+                               printf("Init collate functions failed!\n");
+               }
+               load(load_list);
+       }
+}
+#endif
+
+glong Libs::CltIndexToOrig(glong cltidx, size_t iLib, int servercollatefunc)
+{
+       if (EnableCollationLevel == 0)
+               return cltidx;
+       if (EnableCollationLevel == 1) {
+               if (cltidx == INVALID_INDEX)
+                       return cltidx;
+               return oLib[iLib]->idx_file->clt_file->GetOrigIndex(cltidx);
+       }
+       if (servercollatefunc == 0)
+               return cltidx;
+       if (cltidx == INVALID_INDEX)
+               return cltidx;
+       oLib[iLib]->idx_file->collate_load((CollateFunctions)(servercollatefunc-1));
+       return oLib[iLib]->idx_file->clt_files[servercollatefunc-1]->GetOrigIndex(cltidx);
+}
+
+glong Libs::CltSynIndexToOrig(glong cltidx, size_t iLib, int servercollatefunc)
+{
+       if (EnableCollationLevel == 0)
+               return cltidx;
+       if (EnableCollationLevel == 1) {
+               if (cltidx == UNSET_INDEX || cltidx == INVALID_INDEX)
+                       return cltidx;
+               return oLib[iLib]->syn_file->clt_file->GetOrigIndex(cltidx);
+       }
+       if (servercollatefunc == 0)
+               return cltidx;
+       if (cltidx == UNSET_INDEX || cltidx == INVALID_INDEX)
+               return cltidx;
+       oLib[iLib]->syn_file->collate_load((CollateFunctions)(servercollatefunc-1));
+       return oLib[iLib]->syn_file->clt_files[servercollatefunc-1]->GetOrigIndex(cltidx);
+}
+
+const gchar *Libs::GetSuggestWord(const gchar *sWord, CurrentIndex *iCurrent, std::vector<InstantDictIndex> &dictmask, int servercollatefunc)
+{
+       const gchar *poCurrentWord = NULL;
+       const gchar *word;
+       gint best =0;
+       gint back;
+       std::vector<InstantDictIndex>::size_type iLib;
+       std::vector<Dict *>::size_type iRealLib;
+       for (iLib=0; iLib < dictmask.size(); iLib++) {
+               if (dictmask[iLib].type != InstantDictType_LOCAL)
+                       continue;
+               iRealLib = dictmask[iLib].index;
+               if ( poCurrentWord == NULL ) {
+                       poCurrentWord = poGetWord(iCurrent[iLib].idx_suggest, iRealLib, servercollatefunc);
+                       best = prefix_match (sWord, poCurrentWord);
+               } else {
+                       word = poGetWord(iCurrent[iLib].idx_suggest, iRealLib, servercollatefunc);
+                       back = prefix_match (sWord, word);
+                       if (back > best) {
+                               best = back;
+                               poCurrentWord = word;
+                       } else if (back == best) {
+                               gint x = stardict_server_collate(poCurrentWord, word, EnableCollationLevel, CollateFunction, servercollatefunc);
+                               if (x > 0) {
+                                       poCurrentWord = word;
+                               }
+                       }
+               }
+       }
+       for (iLib=0; iLib<dictmask.size(); iLib++) {
+               if (dictmask[iLib].type != InstantDictType_LOCAL)
+                       continue;
+               if (iCurrent[iLib].synidx_suggest==UNSET_INDEX)
+                       continue;
+               iRealLib = dictmask[iLib].index;
+               if ( poCurrentWord == NULL ) {
+                       poCurrentWord = poGetSynonymWord(iCurrent[iLib].synidx_suggest, iRealLib, servercollatefunc);
+                       best = prefix_match (sWord, poCurrentWord);
+               } else {
+                       word = poGetSynonymWord(iCurrent[iLib].synidx_suggest, iRealLib, servercollatefunc);
+                       back = prefix_match (sWord, word);
+                       if (back > best) {
+                               best = back;
+                               poCurrentWord = word;
+                       } else if (back == best) {
+                               gint x = stardict_server_collate(poCurrentWord, word, EnableCollationLevel, CollateFunction, servercollatefunc);
+                               if (x > 0) {
+                                       poCurrentWord = word;
+                               }
+                       }
+               }
+       }
+       return poCurrentWord;
+}
+
+const gchar *Libs::poGetCurrentWord(CurrentIndex * iCurrent, std::vector<InstantDictIndex> &dictmask, int servercollatefunc)
+{
+       const gchar *poCurrentWord = NULL;
+       const gchar *word;
+       std::vector<InstantDictIndex>::size_type iLib;
+       std::vector<Dict *>::size_type iRealLib;
+       for (iLib=0; iLib < dictmask.size(); iLib++) {
+               if (dictmask[iLib].type != InstantDictType_LOCAL)
+                       continue;
+               iRealLib = dictmask[iLib].index;
+               if (iCurrent[iLib].idx==INVALID_INDEX)
+                       continue;
+               if ( iCurrent[iLib].idx>=narticles(iRealLib) || iCurrent[iLib].idx<0)
+                       continue;
+               if ( poCurrentWord == NULL ) {
+                       poCurrentWord = poGetWord(iCurrent[iLib].idx, iRealLib, servercollatefunc);
+               } else {
+                       word = poGetWord(iCurrent[iLib].idx, iRealLib, servercollatefunc);
+                       gint x = stardict_server_collate(poCurrentWord, word, EnableCollationLevel, CollateFunction, servercollatefunc);
+                       if (x > 0) {
+                               poCurrentWord = word;
+                       }
+               }
+       }
+       for (iLib=0; iLib<dictmask.size(); iLib++) {
+               if (dictmask[iLib].type != InstantDictType_LOCAL)
+                       continue;
+               iRealLib = dictmask[iLib].index;
+               if (iCurrent[iLib].synidx==UNSET_INDEX)
+                       continue;
+               if (iCurrent[iLib].synidx==INVALID_INDEX)
+                       continue;
+               if ( iCurrent[iLib].synidx>=nsynarticles(iRealLib) || iCurrent[iLib].synidx<0)
+                       continue;
+               if ( poCurrentWord == NULL ) {
+                       poCurrentWord = poGetSynonymWord(iCurrent[iLib].synidx, iRealLib, servercollatefunc);
+               } else {
+                       word = poGetSynonymWord(iCurrent[iLib].synidx, iRealLib, servercollatefunc);
+                       gint x = stardict_server_collate(poCurrentWord, word, EnableCollationLevel, CollateFunction, servercollatefunc);
+                       if (x > 0) {
+                               poCurrentWord = word;
+                       }
+               }
+       }
+       return poCurrentWord;
+}
+
+const gchar *
+Libs::poGetNextWord(const gchar *sWord, CurrentIndex *iCurrent, std::vector<InstantDictIndex> &dictmask, int servercollatefunc)
+{
+       // the input can be:
+       // (word,iCurrent),read word,write iNext to iCurrent,and return next word. used by TopWin::NextCallback();
+       // (NULL,iCurrent),read iCurrent,write iNext to iCurrent,and return next word. used by AppCore::ListWords();
+       const gchar *poCurrentWord = NULL;
+       std::vector<Dict *>::size_type iCurrentLib=0, iCurrentRealLib=0;
+       bool isLib = false;
+       const gchar *word;
+
+       std::vector<InstantDictIndex>::size_type iLib;
+       std::vector<Dict *>::size_type iRealLib;
+       for (iLib=0; iLib < dictmask.size(); iLib++) {
+               if (dictmask[iLib].type != InstantDictType_LOCAL)
+                       continue;
+               iRealLib = dictmask[iLib].index;
+               if (sWord) {
+                       oLib[iRealLib]->Lookup(sWord, iCurrent[iLib].idx, iCurrent[iLib].idx_suggest, EnableCollationLevel, servercollatefunc);
+               }
+               if (iCurrent[iLib].idx==INVALID_INDEX)
+                       continue;
+               if (iCurrent[iLib].idx>=narticles(iRealLib) || iCurrent[iLib].idx<0)
+                       continue;
+               if (poCurrentWord == NULL ) {
+                       poCurrentWord = poGetWord(iCurrent[iLib].idx, iRealLib, servercollatefunc);
+                       iCurrentLib = iLib;
+                       iCurrentRealLib = iRealLib;
+                       isLib=true;
+               } else {
+                       gint x;
+                       word = poGetWord(iCurrent[iLib].idx, iRealLib, servercollatefunc);
+                       x = stardict_server_collate(poCurrentWord, word, EnableCollationLevel, CollateFunction, servercollatefunc);
+                       if (x > 0) {
+                               poCurrentWord = word;
+                               iCurrentLib = iLib;
+                               iCurrentRealLib = iRealLib;
+                               isLib=true;
+                       }
+               }
+       }
+       for (iLib=0; iLib < dictmask.size(); iLib++) {
+               if (dictmask[iLib].type != InstantDictType_LOCAL)
+                       continue;
+               iRealLib = dictmask[iLib].index;
+               if (sWord) {
+                       oLib[iRealLib]->LookupSynonym(sWord, iCurrent[iLib].synidx, iCurrent[iLib].synidx_suggest, EnableCollationLevel, servercollatefunc);
+               }
+               if (iCurrent[iLib].synidx==UNSET_INDEX)
+                       continue;
+               if (iCurrent[iLib].synidx==INVALID_INDEX)
+                       continue;
+               if (iCurrent[iLib].synidx>=nsynarticles(iRealLib) || iCurrent[iLib].synidx<0)
+                       continue;
+               if (poCurrentWord == NULL ) {
+                       poCurrentWord = poGetSynonymWord(iCurrent[iLib].synidx, iRealLib, servercollatefunc);
+                       iCurrentLib = iLib;
+                       iCurrentRealLib = iRealLib;
+                       isLib=false;
+               } else {
+                       gint x;
+                       word = poGetSynonymWord(iCurrent[iLib].synidx, iRealLib, servercollatefunc);
+                       x = stardict_server_collate(poCurrentWord, word, EnableCollationLevel, CollateFunction, servercollatefunc);
+                       if (x > 0 ) {
+                               poCurrentWord = word;
+                               iCurrentLib = iLib;
+                               iCurrentRealLib = iRealLib;
+                               isLib=false;
+                       }
+               }
+       }
+       if (poCurrentWord) {
+               for (iLib=0; iLib < dictmask.size(); iLib++) {
+                       if (dictmask[iLib].type != InstantDictType_LOCAL)
+                               continue;
+                       iRealLib = dictmask[iLib].index;
+                       if (isLib && (iLib == iCurrentLib))
+                               continue;
+                       if (iCurrent[iLib].idx==INVALID_INDEX)
+                               continue;
+                       if (iCurrent[iLib].idx>=narticles(iRealLib) || iCurrent[iLib].idx<0)
+                               continue;
+                       word = poGetWord(iCurrent[iLib].idx, iRealLib, servercollatefunc);
+                       if (strcmp(poCurrentWord, word) == 0) {
+                               GetWordNext(iCurrent[iLib].idx, iRealLib, true, servercollatefunc);
+                       }
+               }
+               for (iLib=0; iLib < dictmask.size(); iLib++) {
+                       if (dictmask[iLib].type != InstantDictType_LOCAL)
+                               continue;
+                       iRealLib = dictmask[iLib].index;
+                       if ((!isLib) && (iLib == iCurrentLib))
+                               continue;
+                       if (iCurrent[iLib].synidx==UNSET_INDEX)
+                               continue;
+                       if (iCurrent[iLib].synidx==INVALID_INDEX)
+                               continue;
+                       if (iCurrent[iLib].synidx>=nsynarticles(iRealLib) || iCurrent[iLib].synidx<0)
+                               continue;
+                       word = poGetSynonymWord(iCurrent[iLib].synidx, iRealLib, servercollatefunc);
+                       if (strcmp(poCurrentWord, word) == 0) {
+                               GetWordNext(iCurrent[iLib].synidx, iRealLib, false, servercollatefunc);
+                       }
+               }
+               //GetWordNext will change poCurrentWord's content, so do it at the last.
+               if (isLib) {
+                       GetWordNext(iCurrent[iCurrentLib].idx, iCurrentRealLib, true, servercollatefunc);
+               } else {
+                       GetWordNext(iCurrent[iCurrentLib].synidx, iCurrentRealLib, false, servercollatefunc);
+               }
+               poCurrentWord = poGetCurrentWord(iCurrent, dictmask, servercollatefunc);
+       }
+       return poCurrentWord;
+}
+
+const gchar *
+Libs::poGetPreWord(const gchar *sWord, CurrentIndex* iCurrent, std::vector<InstantDictIndex> &dictmask, int servercollatefunc)
+{
+       // used by TopWin::PreviousCallback(); the iCurrent is cached by AppCore::TopWinWordChange();
+       const gchar *poCurrentWord = NULL;
+       std::vector<Dict *>::size_type iCurrentLib=0, iCurrentRealLib=0;
+       bool isLib = false;
+
+       const gchar *word;
+       glong pidx;
+       std::vector<InstantDictIndex>::size_type iLib;
+       std::vector<Dict *>::size_type iRealLib;
+       for (iLib=0;iLib<dictmask.size();iLib++) {
+               if (dictmask[iLib].type != InstantDictType_LOCAL)
+                       continue;
+               iRealLib = dictmask[iLib].index;
+               if (sWord) {
+                       oLib[iRealLib]->Lookup(sWord, iCurrent[iLib].idx, iCurrent[iLib].idx_suggest, EnableCollationLevel, servercollatefunc);
+               }
+               if (iCurrent[iLib].idx!=INVALID_INDEX) {
+                       if ( iCurrent[iLib].idx>=narticles(iRealLib) || iCurrent[iLib].idx<=0)
+                               continue;
+               }
+               if ( poCurrentWord == NULL ) {
+                       if (GetWordPrev(iCurrent[iLib].idx, pidx, iRealLib, true, servercollatefunc)) {
+                               poCurrentWord = poGetWord(pidx, iRealLib, servercollatefunc);
+                               iCurrentLib = iLib;
+                               iCurrentRealLib = iRealLib;
+                               isLib=true;
+                       }
+               } else {
+                       if (GetWordPrev(iCurrent[iLib].idx, pidx, iRealLib, true, servercollatefunc)) {
+                               gint x;
+                               word = poGetWord(pidx, iRealLib, servercollatefunc);
+                               x = stardict_server_collate(poCurrentWord, word, EnableCollationLevel, CollateFunction, servercollatefunc);
+                               if (x < 0 ) {
+                                       poCurrentWord = word;
+                                       iCurrentLib = iLib;
+                                       iCurrentRealLib = iRealLib;
+                                       isLib=true;
+                               }
+                       }
+               }
+       }
+       for (iLib=0;iLib<dictmask.size();iLib++) {
+               if (dictmask[iLib].type != InstantDictType_LOCAL)
+                       continue;
+               iRealLib = dictmask[iLib].index;
+               if (sWord) {
+                       oLib[iRealLib]->LookupSynonym(sWord, iCurrent[iLib].synidx, iCurrent[iLib].synidx_suggest, EnableCollationLevel, servercollatefunc);
+               }
+               if (iCurrent[iLib].synidx==UNSET_INDEX)
+                       continue;
+               if (iCurrent[iLib].synidx!=INVALID_INDEX) {
+                       if ( iCurrent[iLib].synidx>=nsynarticles(iRealLib) || iCurrent[iLib].synidx<=0)
+                               continue;
+               }
+               if ( poCurrentWord == NULL ) {
+                       if (GetWordPrev(iCurrent[iLib].synidx, pidx, iRealLib, false, servercollatefunc)) {
+                               poCurrentWord = poGetSynonymWord(pidx, iRealLib, servercollatefunc);
+                               iCurrentLib = iLib;
+                               iCurrentRealLib = iRealLib;
+                               isLib=false;
+                       }
+               } else {
+                       if (GetWordPrev(iCurrent[iLib].synidx, pidx, iRealLib, false, servercollatefunc)) {
+                               gint x;
+                               word = poGetSynonymWord(pidx,iRealLib, servercollatefunc);
+                               x = stardict_server_collate(poCurrentWord, word, EnableCollationLevel, CollateFunction, servercollatefunc);
+                               if (x < 0 ) {
+                                       poCurrentWord = word;
+                                       iCurrentLib = iLib;
+                                       iCurrentRealLib = iRealLib;
+                                       isLib=false;
+                               }
+                       }
+               }
+       }
+       if (poCurrentWord) {
+               for (iLib=0;iLib<dictmask.size();iLib++) {
+                       if (dictmask[iLib].type != InstantDictType_LOCAL)
+                               continue;
+                       iRealLib = dictmask[iLib].index;
+                       if (isLib && (iLib == iCurrentLib))
+                               continue;
+                       if (iCurrent[iLib].idx!=INVALID_INDEX) {
+                               if (iCurrent[iLib].idx>=narticles(iRealLib) || iCurrent[iLib].idx<=0)
+                                       continue;
+                       }
+                       if (GetWordPrev(iCurrent[iLib].idx, pidx, iRealLib, true, servercollatefunc)) {
+                               word = poGetWord(pidx, iRealLib, servercollatefunc);
+                               if (strcmp(poCurrentWord, word) == 0) {
+                                       iCurrent[iLib].idx=pidx;
+                               }
+                       }
+               }
+               for (iLib=0;iLib<dictmask.size();iLib++) {
+                       if (dictmask[iLib].type != InstantDictType_LOCAL)
+                               continue;
+                       iRealLib = dictmask[iLib].index;
+                       if ((!isLib) && (iLib == iCurrentLib))
+                               continue;
+                       if (iCurrent[iLib].synidx==UNSET_INDEX)
+                               continue;
+                       if (iCurrent[iLib].synidx!=INVALID_INDEX) {
+                               if (iCurrent[iLib].synidx>=nsynarticles(iRealLib) || iCurrent[iLib].synidx<=0)
+                                       continue;
+                       }
+                       if (GetWordPrev(iCurrent[iLib].synidx, pidx, iRealLib, false, servercollatefunc)) {
+                               word = poGetSynonymWord(pidx, iRealLib, servercollatefunc);
+                               if (strcmp(poCurrentWord, word) == 0) {
+                                       iCurrent[iLib].synidx=pidx;
+                               }
+                       }
+               }
+               if (isLib) {
+                       GetWordPrev(iCurrent[iCurrentLib].idx, pidx, iCurrentRealLib, true, servercollatefunc);
+                       iCurrent[iCurrentLib].idx = pidx;
+               } else {
+                       GetWordPrev(iCurrent[iCurrentLib].synidx, pidx, iCurrentRealLib, false, servercollatefunc);
+                       iCurrent[iCurrentLib].synidx = pidx;
+               }
+       }
+       return poCurrentWord;
+}
+
+bool Libs::LookupSynonymSimilarWord(const gchar* sWord, glong &iSynonymWordIndex, glong &synidx_suggest, size_t iLib, int servercollatefunc)
+{
+       if (oLib[iLib]->syn_file.get() == NULL)
+               return false;
+
+       glong iIndex;
+       glong iIndex_suggest;
+       bool bFound=false;
+       gchar *casestr;
+       bool bLookup;
+
+       if (!bFound) {
+               // to lower case.
+               casestr = g_utf8_strdown(sWord, -1);
+               if (strcmp(casestr, sWord)) {
+                       bLookup = oLib[iLib]->LookupSynonym(casestr, iIndex, iIndex_suggest, EnableCollationLevel, servercollatefunc);
+                       if(bLookup)
+                               bFound=true;
+               }
+               g_free(casestr);
+               // to upper case.
+               if (!bFound) {
+                       casestr = g_utf8_strup(sWord, -1);
+                       if (strcmp(casestr, sWord)) {
+                               bLookup = oLib[iLib]->LookupSynonym(casestr, iIndex, iIndex_suggest, EnableCollationLevel, servercollatefunc);
+                               if(bLookup)
+                                       bFound=true;
+                       }
+                       g_free(casestr);
+               }
+               // Upper the first character and lower others.
+               if (!bFound) {
+                       gchar *nextchar = g_utf8_next_char(sWord);
+                       gchar *firstchar = g_utf8_strup(sWord, nextchar - sWord);
+                       nextchar = g_utf8_strdown(nextchar, -1);
+                       casestr = g_strdup_printf("%s%s", firstchar, nextchar);
+                       g_free(firstchar);
+                       g_free(nextchar);
+                       if (strcmp(casestr, sWord)) {
+                               bLookup = oLib[iLib]->LookupSynonym(casestr, iIndex, iIndex_suggest, EnableCollationLevel, servercollatefunc);
+                               if(bLookup)
+                                       bFound=true;
+                       }
+                       g_free(casestr);
+               }
+               if (!bFound) {
+                       iIndex = iSynonymWordIndex;
+                       glong pidx;
+                       const gchar *cword;
+                       do {
+                               if (GetWordPrev(iIndex, pidx, iLib, false, servercollatefunc)) {
+                                       cword = poGetSynonymWord(pidx, iLib, servercollatefunc);
+                                       if (stardict_casecmp(cword, sWord, EnableCollationLevel, CollateFunction, servercollatefunc)==0) {
+                                               iIndex = pidx;
+                                               bFound=true;
+                                       } else {
+                                               break;
+                                       }
+                               } else {
+                                       break;
+                               }
+                       } while (true);
+                       if (!bFound) {
+                               if (iIndex!=INVALID_INDEX) {
+                                       cword = poGetSynonymWord(iIndex, iLib, servercollatefunc);
+                                       if (stardict_casecmp(cword, sWord, EnableCollationLevel, CollateFunction, servercollatefunc)==0) {
+                                               bFound=true;
+                                       }
+                               }
+                       }
+               }
+       }
+       if (bFound) {
+               iSynonymWordIndex = iIndex;
+               synidx_suggest = iIndex_suggest;
+       }
+       return bFound;
+}
+
+bool Libs::LookupSimilarWord(const gchar* sWord, glong & iWordIndex, glong &idx_suggest, size_t iLib, int servercollatefunc)
+{
+       glong iIndex;
+       bool bFound=false;
+       gchar *casestr;
+
+       if (!bFound) {
+               // to lower case.
+               casestr = g_utf8_strdown(sWord, -1);
+               if (strcmp(casestr, sWord)) {
+                       if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                               bFound=true;
+               }
+               g_free(casestr);
+               // to upper case.
+               if (!bFound) {
+                       casestr = g_utf8_strup(sWord, -1);
+                       if (strcmp(casestr, sWord)) {
+                               if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                       bFound=true;
+                       }
+                       g_free(casestr);
+               }
+               // Upper the first character and lower others.
+               if (!bFound) {
+                       gchar *nextchar = g_utf8_next_char(sWord);
+                       gchar *firstchar = g_utf8_strup(sWord, nextchar - sWord);
+                       nextchar = g_utf8_strdown(nextchar, -1);
+                       casestr = g_strdup_printf("%s%s", firstchar, nextchar);
+                       g_free(firstchar);
+                       g_free(nextchar);
+                       if (strcmp(casestr, sWord)) {
+                               if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                       bFound=true;
+                       }
+                       g_free(casestr);
+               }
+               if (!bFound) {
+                       iIndex = iWordIndex;
+                       glong pidx;
+                       const gchar *cword;
+                       do {
+                               if (GetWordPrev(iIndex, pidx, iLib, true, servercollatefunc)) {
+                                       cword = poGetWord(pidx, iLib, servercollatefunc);
+                                       if (stardict_casecmp(cword, sWord, EnableCollationLevel, CollateFunction, servercollatefunc)==0) {
+                                               iIndex = pidx;
+                                               bFound=true;
+                                       } else {
+                                               break;
+                                       }
+                               } else {
+                                       break;
+                               }
+                       } while (true);
+                       if (!bFound) {
+                               if (iIndex!=INVALID_INDEX) {
+                                       cword = poGetWord(iIndex, iLib, servercollatefunc);
+                                       if (stardict_casecmp(cword, sWord, EnableCollationLevel, CollateFunction, servercollatefunc)==0) {
+                                               bFound=true;
+                                       }
+                               }
+                       }
+               }
+       }
+
+       if (bIsPureEnglish(sWord)) {
+               // If not Found , try other status of sWord.
+               size_t iWordLen=strlen(sWord);
+               bool isupcase;
+
+               gchar *sNewWord = (gchar *)g_malloc(iWordLen + 1);
+
+               //cut one char "s" or "d"
+               if(!bFound && iWordLen>1) {
+                       isupcase = sWord[iWordLen-1]=='S' || !strncmp(&sWord[iWordLen-2],"ED",2);
+                       if (isupcase || sWord[iWordLen-1]=='s' || !strncmp(&sWord[iWordLen-2],"ed",2)) {
+                               strcpy(sNewWord,sWord);
+                               sNewWord[iWordLen-1]='\0'; // cut "s" or "d"
+                               if (oLib[iLib]->Lookup(sNewWord, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                       bFound=true;
+                               else if (isupcase || g_ascii_isupper(sWord[0])) {
+                                       casestr = g_ascii_strdown(sNewWord, -1);
+                                       if (strcmp(casestr, sNewWord)) {
+                                               if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                                       bFound=true;
+                                       }
+                                       g_free(casestr);
+                               }
+                       }
+               }
+
+               //cut "ly"
+               if(!bFound && iWordLen>2) {
+                       isupcase = !strncmp(&sWord[iWordLen-2],"LY",2);
+                       if (isupcase || (!strncmp(&sWord[iWordLen-2],"ly",2))) {
+                               strcpy(sNewWord,sWord);
+                               sNewWord[iWordLen-2]='\0';  // cut "ly"
+                               if (iWordLen>5 && sNewWord[iWordLen-3]==sNewWord[iWordLen-4]
+                                   && !bIsVowel(sNewWord[iWordLen-4]) &&
+                                   bIsVowel(sNewWord[iWordLen-5])) {//doubled
+
+                                       sNewWord[iWordLen-3]='\0';
+                                       if(oLib[iLib]->Lookup(sNewWord, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                               bFound=true;
+                                       else {
+                                               if (isupcase || g_ascii_isupper(sWord[0])) {
+                                                       casestr = g_ascii_strdown(sNewWord, -1);
+                                                       if (strcmp(casestr, sNewWord)) {
+                                                               if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                                                       bFound=true;
+                                                       }
+                                                       g_free(casestr);
+                                               }
+                                               if (!bFound)
+                                                       sNewWord[iWordLen-3]=sNewWord[iWordLen-4];  //restore
+                                       }
+                               }
+                               if (!bFound) {
+                                       if (oLib[iLib]->Lookup(sNewWord, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                               bFound=true;
+                                       else if (isupcase || g_ascii_isupper(sWord[0])) {
+                                               casestr = g_ascii_strdown(sNewWord, -1);
+                                               if (strcmp(casestr, sNewWord)) {
+                                                       if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                                               bFound=true;
+                                               }
+                                               g_free(casestr);
+                                       }
+                               }
+                       }
+               }
+
+               //cut "ing"
+               if(!bFound && iWordLen>3) {
+                       isupcase = !strncmp(&sWord[iWordLen-3],"ING",3);
+                       if (isupcase || !strncmp(&sWord[iWordLen-3],"ing",3) ) {
+                               strcpy(sNewWord,sWord);
+                               sNewWord[iWordLen-3]='\0';
+                               if ( iWordLen>6 && (sNewWord[iWordLen-4]==sNewWord[iWordLen-5])
+                                    && !bIsVowel(sNewWord[iWordLen-5]) &&
+                                    bIsVowel(sNewWord[iWordLen-6])) {  //doubled
+                                       sNewWord[iWordLen-4]='\0';
+                                       if (oLib[iLib]->Lookup(sNewWord, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                               bFound=true;
+                                       else {
+                                               if (isupcase || g_ascii_isupper(sWord[0])) {
+                                                       casestr = g_ascii_strdown(sNewWord, -1);
+                                                       if (strcmp(casestr, sNewWord)) {
+                                                               if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                                                       bFound=true;
+                                                       }
+                                                       g_free(casestr);
+                                               }
+                                               if (!bFound)
+                                                       sNewWord[iWordLen-4]=sNewWord[iWordLen-5];  //restore
+                                       }
+                               }
+                               if( !bFound ) {
+                                       if (oLib[iLib]->Lookup(sNewWord, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                               bFound=true;
+                                       else if (isupcase || g_ascii_isupper(sWord[0])) {
+                                               casestr = g_ascii_strdown(sNewWord, -1);
+                                               if (strcmp(casestr, sNewWord)) {
+                                                       if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                                               bFound=true;
+                                               }
+                                               g_free(casestr);
+                                       }
+                               }
+                               if(!bFound) {
+                                       if (isupcase)
+                                               strcat(sNewWord,"E"); // add a char "E"
+                                       else
+                                               strcat(sNewWord,"e"); // add a char "e"
+                                       if(oLib[iLib]->Lookup(sNewWord, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                               bFound=true;
+                                       else if (isupcase || g_ascii_isupper(sWord[0])) {
+                                               casestr = g_ascii_strdown(sNewWord, -1);
+                                               if (strcmp(casestr, sNewWord)) {
+                                                       if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                                               bFound=true;
+                                               }
+                                               g_free(casestr);
+                                       }
+                               }
+                       }
+               }
+
+               //cut two char "es"
+               if(!bFound && iWordLen>3) {
+                       isupcase = (!strncmp(&sWord[iWordLen-2],"ES",2) &&
+                                   (sWord[iWordLen-3] == 'S' ||
+                                    sWord[iWordLen-3] == 'X' ||
+                                    sWord[iWordLen-3] == 'O' ||
+                                    (iWordLen >4 && sWord[iWordLen-3] == 'H' &&
+                                     (sWord[iWordLen-4] == 'C' ||
+                                      sWord[iWordLen-4] == 'S'))));
+                       if (isupcase ||
+                           (!strncmp(&sWord[iWordLen-2],"es",2) &&
+                            (sWord[iWordLen-3] == 's' || sWord[iWordLen-3] == 'x' ||
+                             sWord[iWordLen-3] == 'o' ||
+                             (iWordLen >4 && sWord[iWordLen-3] == 'h' &&
+                              (sWord[iWordLen-4] == 'c' || sWord[iWordLen-4] == 's'))))) {
+                               strcpy(sNewWord,sWord);
+                               sNewWord[iWordLen-2]='\0';
+                               if(oLib[iLib]->Lookup(sNewWord, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                       bFound=true;
+                               else if (isupcase || g_ascii_isupper(sWord[0])) {
+                                       casestr = g_ascii_strdown(sNewWord, -1);
+                                       if (strcmp(casestr, sNewWord)) {
+                                               if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                                       bFound=true;
+                                       }
+                                       g_free(casestr);
+                               }
+                       }
+               }
+
+               //cut "ed"
+               if (!bFound && iWordLen>3) {
+                       isupcase = !strncmp(&sWord[iWordLen-2],"ED",2);
+                       if (isupcase || !strncmp(&sWord[iWordLen-2],"ed",2)) {
+                               strcpy(sNewWord,sWord);
+                               sNewWord[iWordLen-2]='\0';
+                               if (iWordLen>5 && (sNewWord[iWordLen-3]==sNewWord[iWordLen-4])
+                                   && !bIsVowel(sNewWord[iWordLen-4]) &&
+                                   bIsVowel(sNewWord[iWordLen-5])) {//doubled
+                                       sNewWord[iWordLen-3]='\0';
+                                       if (oLib[iLib]->Lookup(sNewWord, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                               bFound=true;
+                                       else {
+                                               if (isupcase || g_ascii_isupper(sWord[0])) {
+                                                       casestr = g_ascii_strdown(sNewWord, -1);
+                                                       if (strcmp(casestr, sNewWord)) {
+                                                               if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                                                       bFound=true;
+                                                       }
+                                                       g_free(casestr);
+                                               }
+                                               if (!bFound)
+                                                       sNewWord[iWordLen-3]=sNewWord[iWordLen-4];  //restore
+                                       }
+                               }
+                               if (!bFound) {
+                                       if (oLib[iLib]->Lookup(sNewWord, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                               bFound=true;
+                                       else if (isupcase || g_ascii_isupper(sWord[0])) {
+                                               casestr = g_ascii_strdown(sNewWord, -1);
+                                               if (strcmp(casestr, sNewWord)) {
+                                                       if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                                               bFound=true;
+                                               }
+                                               g_free(casestr);
+                                       }
+                               }
+                       }
+               }
+
+               // cut "ied" , add "y".
+               if (!bFound && iWordLen>3) {
+                       isupcase = !strncmp(&sWord[iWordLen-3],"IED",3);
+                       if (isupcase || (!strncmp(&sWord[iWordLen-3],"ied",3))) {
+                               strcpy(sNewWord,sWord);
+                               sNewWord[iWordLen-3]='\0';
+                               if (isupcase)
+                                       strcat(sNewWord,"Y"); // add a char "Y"
+                               else
+                                       strcat(sNewWord,"y"); // add a char "y"
+                               if (oLib[iLib]->Lookup(sNewWord, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                       bFound=true;
+                               else if (isupcase || g_ascii_isupper(sWord[0])) {
+                                       casestr = g_ascii_strdown(sNewWord, -1);
+                                       if (strcmp(casestr, sNewWord)) {
+                                               if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                                       bFound=true;
+                                       }
+                                       g_free(casestr);
+                               }
+                       }
+               }
+
+               // cut "ies" , add "y".
+               if (!bFound && iWordLen>3) {
+                       isupcase = !strncmp(&sWord[iWordLen-3],"IES",3);
+                       if (isupcase || (!strncmp(&sWord[iWordLen-3],"ies",3))) {
+                               strcpy(sNewWord,sWord);
+                               sNewWord[iWordLen-3]='\0';
+                               if (isupcase)
+                                       strcat(sNewWord,"Y"); // add a char "Y"
+                               else
+                                       strcat(sNewWord,"y"); // add a char "y"
+                               if(oLib[iLib]->Lookup(sNewWord, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                       bFound=true;
+                               else if (isupcase || g_ascii_isupper(sWord[0])) {
+                                       casestr = g_ascii_strdown(sNewWord, -1);
+                                       if (strcmp(casestr, sNewWord)) {
+                                               if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                                       bFound=true;
+                                       }
+                                       g_free(casestr);
+                               }
+                       }
+               }
+
+               // cut "er".
+               if (!bFound && iWordLen>2) {
+                       isupcase = !strncmp(&sWord[iWordLen-2],"ER",2);
+                       if (isupcase || (!strncmp(&sWord[iWordLen-2],"er",2))) {
+                               strcpy(sNewWord,sWord);
+                               sNewWord[iWordLen-2]='\0';
+                               if(oLib[iLib]->Lookup(sNewWord, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                       bFound=true;
+                               else if (isupcase || g_ascii_isupper(sWord[0])) {
+                                       casestr = g_ascii_strdown(sNewWord, -1);
+                                       if (strcmp(casestr, sNewWord)) {
+                                               if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                                       bFound=true;
+                                       }
+                                       g_free(casestr);
+                               }
+                       }
+               }
+
+               // cut "est".
+               if (!bFound && iWordLen>3) {
+                       isupcase = !strncmp(&sWord[iWordLen-3], "EST", 3);
+                       if (isupcase || (!strncmp(&sWord[iWordLen-3],"est", 3))) {
+                               strcpy(sNewWord,sWord);
+                               sNewWord[iWordLen-3]='\0';
+                               if(oLib[iLib]->Lookup(sNewWord, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                       bFound=true;
+                               else if (isupcase || g_ascii_isupper(sWord[0])) {
+                                       casestr = g_ascii_strdown(sNewWord, -1);
+                                       if (strcmp(casestr, sNewWord)) {
+                                               if(oLib[iLib]->Lookup(casestr, iIndex, idx_suggest, EnableCollationLevel, servercollatefunc))
+                                                       bFound=true;
+                                       }
+                                       g_free(casestr);
+                               }
+                       }
+               }
+
+               g_free(sNewWord);
+       }
+
+       if (bFound)
+               iWordIndex = iIndex;
+#if 0
+       else {
+               //don't change iWordIndex here.
+               //when LookupSimilarWord all failed too, we want to use the old LookupWord index to list words.
+               //iWordIndex = INVALID_INDEX;
+       }
+#endif
+       return bFound;
+}
+
+bool Libs::SimpleLookupWord(const gchar* sWord, glong & iWordIndex, glong &idx_suggest, size_t iLib, int servercollatefunc)
+{
+       bool bFound = oLib[iLib]->Lookup(sWord, iWordIndex, idx_suggest, EnableCollationLevel, servercollatefunc);
+       if (!bFound)
+               bFound = LookupSimilarWord(sWord, iWordIndex, idx_suggest, iLib, servercollatefunc);
+       return bFound;
+}
+
+bool Libs::SimpleLookupSynonymWord(const gchar* sWord, glong & iWordIndex, glong &synidx_suggest, size_t iLib, int servercollatefunc)
+{
+       bool bFound = oLib[iLib]->LookupSynonym(sWord, iWordIndex, synidx_suggest, EnableCollationLevel, servercollatefunc);
+       if (!bFound)
+               bFound = LookupSynonymSimilarWord(sWord, iWordIndex, synidx_suggest, iLib, servercollatefunc);
+       return bFound;
+}
+
+struct Fuzzystruct {
+       char * pMatchWord;
+       int iMatchWordDistance;
+};
+
+static inline bool operator<(const Fuzzystruct & lh, const Fuzzystruct & rh) {
+       if (lh.iMatchWordDistance!=rh.iMatchWordDistance)
+               return lh.iMatchWordDistance<rh.iMatchWordDistance;
+
+       if (lh.pMatchWord && rh.pMatchWord)
+               return stardict_strcmp(lh.pMatchWord, rh.pMatchWord)<0;
+
+       return false;
+}
+
+static inline void unicode_strdown(gunichar *str)
+{
+       while (*str) {
+               *str=g_unichar_tolower(*str);
+               ++str;
+       }
+}
+
+bool Libs::LookupWithFuzzy(const gchar *sWord, gchar *reslist[], gint reslist_size, std::vector<InstantDictIndex> &dictmask)
+{
+       if (sWord[0] == '\0')
+               return false;
+
+       std::vector<Fuzzystruct> oFuzzystruct(reslist_size);
+
+       for (int i=0; i<reslist_size; i++) {
+               oFuzzystruct[i].pMatchWord = NULL;
+               oFuzzystruct[i].iMatchWordDistance = iMaxFuzzyDistance;
+       }
+       int iMaxDistance = iMaxFuzzyDistance;
+       int iDistance;
+       bool Found = false;
+       EditDistance oEditDistance;
+
+       glong iCheckWordLen;
+       const char *sCheck;
+       gunichar *ucs4_str1, *ucs4_str2;
+       glong ucs4_str2_len;
+
+       ucs4_str2 = g_utf8_to_ucs4_fast(sWord, -1, &ucs4_str2_len);
+       unicode_strdown(ucs4_str2);
+
+       std::vector<Dict *>::size_type iRealLib;
+       for (std::vector<InstantDictIndex>::size_type iLib=0; iLib<dictmask.size(); iLib++) {
+               if (dictmask[iLib].type != InstantDictType_LOCAL)
+                       continue;
+               iRealLib = dictmask[iLib].index;
+               for (gint synLib=0; synLib<2; synLib++) {
+                       if (synLib==1) {
+                               if (oLib[iRealLib]->syn_file.get()==NULL)
+                                       break;
+                       }
+                       show_progress->notify_about_work();
+
+                       //if (stardict_strcmp(sWord, poGetWord(0,iRealLib))>=0 && stardict_strcmp(sWord, poGetWord(narticles(iRealLib)-1,iRealLib))<=0) {
+                       //there are Chinese dicts and English dicts...
+                       if (TRUE) {
+                               glong iwords;
+                               if (synLib==0)
+                                       iwords = narticles(iRealLib);
+                               else
+                                       iwords = nsynarticles(iRealLib);
+                               for (glong index=0; index<iwords; index++) {
+                                       // Need to deal with same word in index? But this will slow down processing in most case.
+                                       if (synLib==0)
+                                               sCheck = poGetOrigWord(index,iRealLib);
+                                       else
+                                               sCheck = poGetOrigSynonymWord(index,iRealLib);
+                                       // tolower and skip too long or too short words
+                                       iCheckWordLen = g_utf8_strlen(sCheck, -1);
+                                       if (iCheckWordLen-ucs4_str2_len>=iMaxDistance ||
+                                           ucs4_str2_len-iCheckWordLen>=iMaxDistance)
+                                               continue;
+                                       ucs4_str1 = g_utf8_to_ucs4_fast(sCheck, -1, NULL);
+                                       if (iCheckWordLen > ucs4_str2_len)
+                                               ucs4_str1[ucs4_str2_len]=0;
+                                       unicode_strdown(ucs4_str1);
+
+                                       iDistance = oEditDistance.CalEditDistance(ucs4_str1, ucs4_str2, iMaxDistance);
+                                       g_free(ucs4_str1);
+                                       if (iDistance<iMaxDistance && iDistance < ucs4_str2_len) {
+                                               // when ucs4_str2_len=1,2 we need less fuzzy.
+                                               Found = true;
+                                               bool bAlreadyInList = false;
+                                               int iMaxDistanceAt=0;
+                                               for (int j=0; j<reslist_size; j++) {
+                                                       if (oFuzzystruct[j].pMatchWord &&
+                                                           strcmp(oFuzzystruct[j].pMatchWord,sCheck)==0 ) {//already in list
+                                                               bAlreadyInList = true;
+                                                               break;
+                                                       }
+                                                       //find the position,it will certainly be found (include the first time) as iMaxDistance is set by last time.
+                                                       if (oFuzzystruct[j].iMatchWordDistance == iMaxDistance ) {
+                                                               iMaxDistanceAt = j;
+                                                       }
+                                               }
+                                               if (!bAlreadyInList) {
+                                                       if (oFuzzystruct[iMaxDistanceAt].pMatchWord)
+                                                               g_free(oFuzzystruct[iMaxDistanceAt].pMatchWord);
+                                                       oFuzzystruct[iMaxDistanceAt].pMatchWord = g_strdup(sCheck);
+                                                       oFuzzystruct[iMaxDistanceAt].iMatchWordDistance = iDistance;
+                                                       // calc new iMaxDistance
+                                                       iMaxDistance = iDistance;
+                                                       for (int j=0; j<reslist_size; j++) {
+                                                               if (oFuzzystruct[j].iMatchWordDistance > iMaxDistance)
+                                                                       iMaxDistance = oFuzzystruct[j].iMatchWordDistance;
+                                                       } // calc new iMaxDistance
+                                               }   // add to list
+                                       }   // find one
+                               }   // each word
+                       }   // ok for search
+               }  // synLib
+       }   // each lib
+       g_free(ucs4_str2);
+
+       if (Found)// sort with distance
+               std::sort(oFuzzystruct.begin(), oFuzzystruct.end());
+
+       for (gint i=0; i<reslist_size; ++i)
+               reslist[i]=oFuzzystruct[i].pMatchWord;
+
+       return Found;
+}
+
+static inline bool less_for_compare(const char *lh, const char *rh) {
+       return stardict_strcmp(lh, rh)<0;
+}
+
+gint Libs::LookupWithRule(const gchar *word, gchar **ppMatchWord, std::vector<InstantDictIndex> &dictmask)
+{
+       glong aiIndex[MAX_MATCH_ITEM_PER_LIB+1];
+       gint iMatchCount = 0;
+       GPatternSpec *pspec = g_pattern_spec_new(word);
+
+       const gchar * sMatchWord;
+       bool bAlreadyInList;
+       std::vector<Dict *>::size_type iRealLib;
+       for (std::vector<InstantDictIndex>::size_type iLib=0; iLib<dictmask.size(); iLib++) {
+               //if(oLibs.LookdupWordsWithRule(pspec,aiIndex,MAX_MATCH_ITEM_PER_LIB+1-iMatchCount,iLib))
+               // -iMatchCount,so save time,but may got less result and the word may repeat.
+               if (dictmask[iLib].type != InstantDictType_LOCAL)
+                       continue;
+               iRealLib = dictmask[iLib].index;
+               if (oLib[iRealLib]->LookupWithRule(pspec, aiIndex, MAX_MATCH_ITEM_PER_LIB+1)) {
+                       show_progress->notify_about_work();
+                       for (int i=0; aiIndex[i]!=-1; i++) {
+                               sMatchWord = poGetOrigWord(aiIndex[i],iRealLib);
+                               bAlreadyInList = false;
+                               for (int j=0; j<iMatchCount; j++) {
+                                       if (strcmp(ppMatchWord[j],sMatchWord)==0) {//already in list
+                                               bAlreadyInList = true;
+                                               break;
+                                       }
+                               }
+                               if (!bAlreadyInList)
+                                       ppMatchWord[iMatchCount++] = g_strdup(sMatchWord);
+                       }
+               }
+               if (oLib[iRealLib]->LookupWithRuleSynonym(pspec, aiIndex, MAX_MATCH_ITEM_PER_LIB+1)) {
+                       show_progress->notify_about_work();
+                       for (int i=0; aiIndex[i]!=-1; i++) {
+                               sMatchWord = poGetOrigSynonymWord(aiIndex[i],iRealLib);
+                               bAlreadyInList = false;
+                               for (int j=0; j<iMatchCount; j++) {
+                                       if (strcmp(ppMatchWord[j],sMatchWord)==0) {//already in list
+                                               bAlreadyInList = true;
+                                               break;
+                                       }
+                               }
+                               if (!bAlreadyInList)
+                                       ppMatchWord[iMatchCount++] = g_strdup(sMatchWord);
+                       }
+               }
+       }
+       g_pattern_spec_free(pspec);
+
+       if (iMatchCount)// sort it.
+               std::sort(ppMatchWord, ppMatchWord+iMatchCount, less_for_compare);
+       return iMatchCount;
+}
+
+gint Libs::LookupWithRegex(const gchar *word, gchar **ppMatchWord, std::vector<InstantDictIndex> &dictmask)
+{
+       glong aiIndex[MAX_MATCH_ITEM_PER_LIB+1];
+       gint iMatchCount = 0;
+       GRegex *regex = g_regex_new(word, G_REGEX_OPTIMIZE, (GRegexMatchFlags)0, NULL);
+
+       const gchar * sMatchWord;
+       bool bAlreadyInList;
+       std::vector<Dict *>::size_type iRealLib;
+       for (std::vector<InstantDictIndex>::size_type iLib=0; iLib<dictmask.size(); iLib++) {
+               //if(oLibs.LookdupWordsWithRule(pspec,aiIndex,MAX_MATCH_ITEM_PER_LIB+1-iMatchCount,iLib))
+               // -iMatchCount,so save time,but may got less result and the word may repeat.
+               if (dictmask[iLib].type != InstantDictType_LOCAL)
+                       continue;
+               iRealLib = dictmask[iLib].index;
+               if (oLib[iRealLib]->LookupWithRegex(regex, aiIndex, MAX_MATCH_ITEM_PER_LIB+1)) {
+                       show_progress->notify_about_work();
+                       for (int i=0; aiIndex[i]!=-1; i++) {
+                               sMatchWord = poGetOrigWord(aiIndex[i],iRealLib);
+                               bAlreadyInList = false;
+                               for (int j=0; j<iMatchCount; j++) {
+                                       if (strcmp(ppMatchWord[j],sMatchWord)==0) {//already in list
+                                               bAlreadyInList = true;
+                                               break;
+                                       }
+                               }
+                               if (!bAlreadyInList)
+                                       ppMatchWord[iMatchCount++] = g_strdup(sMatchWord);
+                       }
+               }
+               if (oLib[iRealLib]->LookupWithRegexSynonym(regex, aiIndex, MAX_MATCH_ITEM_PER_LIB+1)) {
+                       show_progress->notify_about_work();
+                       for (int i=0; aiIndex[i]!=-1; i++) {
+                               sMatchWord = poGetOrigSynonymWord(aiIndex[i],iRealLib);
+                               bAlreadyInList = false;
+                               for (int j=0; j<iMatchCount; j++) {
+                                       if (strcmp(ppMatchWord[j],sMatchWord)==0) {//already in list
+                                               bAlreadyInList = true;
+                                               break;
+                                       }
+                               }
+                               if (!bAlreadyInList)
+                                       ppMatchWord[iMatchCount++] = g_strdup(sMatchWord);
+                       }
+               }
+       }
+       g_regex_unref(regex);
+
+       if (iMatchCount)// sort it.
+               std::sort(ppMatchWord, ppMatchWord+iMatchCount, less_for_compare);
+       return iMatchCount;
+}
+
+bool Libs::LookupData(const gchar *sWord, std::vector<gchar *> *reslist, updateSearchDialog_func search_func, gpointer search_data, bool *cancel, std::vector<InstantDictIndex> &dictmask)
+{
+       std::vector<std::string> SearchWords;
+       std::string SearchWord;
+        const char *p=sWord;
+        while (*p) {
+                if (*p=='\\') {
+                        p++;
+                       switch (*p) {
+                       case ' ':
+                               SearchWord+=' ';
+                               break;
+                       case '\\':
+                               SearchWord+='\\';
+                               break;
+                       case 't':
+                               SearchWord+='\t';
+                               break;
+                       case 'n':
+                               SearchWord+='\n';
+                               break;
+                       default:
+                               SearchWord+=*p;
+                       }
+                } else if (*p == ' ') {
+                       if (!SearchWord.empty()) {
+                               SearchWords.push_back(SearchWord);
+                               SearchWord.clear();
+                       }
+               } else {
+                       SearchWord+=*p;
+               }
+               p++;
+        }
+       if (!SearchWord.empty()) {
+               SearchWords.push_back(SearchWord);
+               SearchWord.clear();
+       }
+       if (SearchWords.empty())
+               return false;
+
+       glong search_count=0;
+       glong total_count=0;
+       if (search_func) {
+               for (std::vector<InstantDictIndex>::size_type i=0; i<dictmask.size(); ++i) {
+                       if (dictmask[i].type == InstantDictType_LOCAL)
+                               total_count += narticles(dictmask[i].index);
+               }
+       }
+
+       guint32 max_size =0;
+       gchar *origin_data = NULL;
+       std::vector<InstantDictIndex>::size_type iRealLib;
+       for (std::vector<InstantDictIndex>::size_type i=0; i<dictmask.size(); ++i) {
+               if (dictmask[i].type != InstantDictType_LOCAL)
+                       continue;
+               iRealLib = dictmask[i].index;
+               if (!oLib[iRealLib]->containSearchData())
+                       continue;
+               const gulong iwords = narticles(iRealLib);
+               const gchar *key;
+               guint32 offset, size;
+               for (gulong j=0; j<iwords; ++j) {
+                       if (search_func) {
+                               if (*cancel)
+                                       goto search_out;
+                               if (search_count % 10000 == 0) {
+                                       search_func(search_data, (gdouble)search_count/(gdouble)total_count);
+                               }
+                               search_count++;
+                       }
+                       oLib[iRealLib]->get_key_and_data(j, &key, &offset, &size);
+                       if (size>max_size) {
+                               origin_data = (gchar *)g_realloc(origin_data, size);
+                               max_size = size;
+                       }
+                       if (oLib[iRealLib]->SearchData(SearchWords, offset, size, origin_data)) {
+                               if (reslist[i].empty() || strcmp(reslist[i].back(), key))
+                                       reslist[i].push_back(g_strdup(key));
+                       }
+               }
+       }
+search_out:
+       g_free(origin_data);
+       KMP_end();
+
+       std::vector<InstantDictIndex>::size_type i;
+       for (i=0; i<dictmask.size(); ++i)
+               if (!reslist[i].empty())
+                       break;
+
+       return i!=dictmask.size();
+}
+
+int Libs::GetStorageType(size_t iLib)
+{
+       if (oLib[iLib]->storage == NULL)
+               return -1;
+       return oLib[iLib]->storage->is_file_or_db;
+}
+
+const char *Libs::GetStorageFilePath(size_t iLib, const char *key)
+{
+       if (oLib[iLib]->storage == NULL)
+               return NULL;
+       return oLib[iLib]->storage->get_file_path(key);
+}
+
+const char *Libs::GetStorageFileContent(size_t iLib, const char *key)
+{
+       if (oLib[iLib]->storage == NULL)
+               return NULL;
+       return oLib[iLib]->storage->get_file_content(key);
+}
diff --git a/src/lib/stddict.hpp b/src/lib/stddict.hpp
new file mode 100644 (file)
index 0000000..aa0b276
--- /dev/null
@@ -0,0 +1,380 @@
+#ifndef _STDDICT_HPP_
+#define _STDDICT_HPP_
+
+#include "stardict_libconfig.h"
+
+#include <glib.h>
+#include <string>
+#include <vector>
+#include <list>
+#include <map>
+
+#include "data.hpp"
+#include "collation.h"
+#include "dictmask.h"
+#include "storage.h"
+
+const int MAX_FUZZY_DISTANCE= 3; // at most MAX_FUZZY_DISTANCE-1 differences allowed when find similar words
+const int MAX_MATCH_ITEM_PER_LIB=100;
+
+extern gint stardict_casecmp(const gchar *s1, const gchar *s2, bool isClt, CollateFunctions func);
+extern bool bIsPureEnglish(const gchar *str);
+extern gint stardict_server_collate(const gchar *str1, const gchar *str2, int EnableCollationLevel, CollateFunctions func, int servercollatefunc);
+
+class show_progress_t {
+public:
+       virtual ~show_progress_t() {}
+       virtual void notify_about_start(const std::string& title) {}
+       virtual void notify_about_work() {}
+};
+
+enum CacheFileType {
+       CacheFileType_oft,
+       CacheFileType_clt,
+       CacheFileType_server_clt,
+};
+
+class cache_file {
+public:
+       guint32 *wordoffset;
+
+       cache_file(CacheFileType _cachefiletype);
+       ~cache_file();
+       bool load_cache(const std::string& url, const std::string& saveurl, CollateFunctions cltfunc, glong filedatasize);
+       bool save_cache(const std::string& url, CollateFunctions cltfunc, gulong npages);
+private:
+       CacheFileType cachefiletype;
+       MapFile *mf;
+       bool get_cache_filename(const std::string& url, std::string &cachefilename, bool create, CollateFunctions cltfunc);
+       MapFile* get_cache_loadfile(const gchar *filename, const std::string &url, const std::string &saveurl, CollateFunctions cltfunc, glong filedatasize, int next);
+       FILE* get_cache_savefile(const gchar *filename, const std::string &url, int next, std::string &cfilename, CollateFunctions cltfunc);
+};
+
+class idxsyn_file;
+class collation_file : public cache_file {
+public:
+       CollateFunctions CollateFunction;
+
+       collation_file(idxsyn_file *_idx_file, CacheFileType _cachefiletype);
+       bool lookup(const char *str, glong &idx, glong &idx_suggest);
+       const gchar *GetWord(glong idx);
+       glong GetOrigIndex(glong cltidx);
+private:
+       idxsyn_file *idx_file;
+};
+
+class idxsyn_file {
+public:
+       glong wordcount;
+       collation_file *clt_file;
+       collation_file *clt_files[COLLATE_FUNC_NUMS];
+       std::string url;
+       std::string saveurl;
+
+       idxsyn_file();
+       const gchar *getWord(glong idx, int EnableCollationLevel, int servercollatefunc);
+       bool Lookup(const char *str, glong &idx, glong &idx_suggest, int EnableCollationLevel, int servercollatefunc);
+       virtual const gchar *get_key(glong idx) = 0;
+       virtual bool lookup(const char *str, glong &idx, glong &idx_suggest) = 0;
+       virtual ~idxsyn_file() {}
+       void collate_sort(const std::string& url, const std::string& saveurl,
+                         CollateFunctions collf, show_progress_t *sp);
+       void collate_save_info(const std::string& _url, const std::string& _saveurl);
+       void collate_load(CollateFunctions collf);
+};
+
+class index_file : public idxsyn_file {
+public:
+       guint32 wordentry_offset;
+       guint32 wordentry_size;
+
+       virtual bool load(const std::string& url, gulong wc, gulong fsize,
+                         bool CreateCacheFile, int EnableCollationLevel,
+                         CollateFunctions _CollateFunction, show_progress_t *sp) = 0;
+       virtual void get_data(glong idx) = 0;
+       virtual  const gchar *get_key_and_data(glong idx) = 0;
+private:
+       virtual bool lookup(const char *str, glong &idx, glong &idx_suggest) = 0;
+};
+
+class synonym_file : public idxsyn_file {
+public:
+       guint32 wordentry_index;
+
+       synonym_file();
+       ~synonym_file();
+       bool load(const std::string& url, gulong wc, bool CreateCacheFile,
+                 int EnableCollationLevel, CollateFunctions _CollateFunction,
+                 show_progress_t *sp);
+private:
+       const gchar *get_key(glong idx);
+       bool lookup(const char *str, glong &idx, glong &idx_suggest);
+
+       static const gint ENTR_PER_PAGE=32;
+       gulong npages;
+
+       cache_file oft_file;
+       FILE *synfile;
+
+       gchar wordentry_buf[256+sizeof(guint32)];
+       struct index_entry {
+               glong idx;
+               std::string keystr;
+               void assign(glong i, const std::string& str) {
+                       idx=i;
+                       keystr.assign(str);
+               }
+       };
+       index_entry first, last, middle, real_last;
+
+       struct page_entry {
+               gchar *keystr;
+               guint32 index;
+       };
+       std::vector<gchar> page_data;
+       struct page_t {
+               glong idx;
+               page_entry entries[ENTR_PER_PAGE];
+
+               page_t(): idx(-1) {}
+               void fill(gchar *data, gint nent, glong idx_);
+       } page;
+       gulong load_page(glong page_idx);
+       const gchar *read_first_on_page_key(glong page_idx);
+       const gchar *get_first_on_page_key(glong page_idx);
+};
+
+class Dict : public DictBase {
+private:
+       std::string ifo_file_name;
+       std::string bookname;
+       std::string dicttype;
+
+       bool load_ifofile(const std::string& ifofilename, gulong &idxfilesize, glong &wordcount, glong &synwordcount);
+public:
+       std::auto_ptr<index_file> idx_file;
+       std::auto_ptr<synonym_file> syn_file;
+       ResourceStorage *storage;
+
+       Dict();
+       ~Dict();
+       bool load(const std::string&, bool CreateCacheFile, int EnableCollationLevel, CollateFunctions,
+                 show_progress_t *);
+
+       glong narticles() { return idx_file->wordcount; }
+       glong nsynarticles();
+       const std::string& dict_name() { return bookname; }
+       const std::string& dict_type() { return dicttype; }
+       const std::string& ifofilename() { return ifo_file_name; }
+
+       gchar *get_data(glong index)
+       {
+               idx_file->get_data(index);
+               return DictBase::GetWordData(idx_file->wordentry_offset, idx_file->wordentry_size);
+       }
+       void get_key_and_data(glong index, const gchar **key, guint32 *offset, guint32 *size)
+       {
+               *key = idx_file->get_key_and_data(index);
+               *offset = idx_file->wordentry_offset;
+               *size = idx_file->wordentry_size;
+       }
+       bool Lookup(const char *str, glong &idx, glong &idx_suggest, int EnableCollationLevel, int servercollatefunc)
+       {
+               return idx_file->Lookup(str, idx, idx_suggest, EnableCollationLevel, servercollatefunc);
+       }
+       bool LookupSynonym(const char *str, glong &synidx, glong &synidx_suggest, int EnableCollationLevel, int servercollatefunc);
+       bool LookupWithRule(GPatternSpec *pspec, glong *aIndex, int iBuffLen);
+       bool LookupWithRuleSynonym(GPatternSpec *pspec, glong *aIndex, int iBuffLen);
+       bool LookupWithRegex(GRegex *regex, glong *aIndex, int iBuffLen);
+       bool LookupWithRegexSynonym(GRegex *regex, glong *aIndex, int iBuffLen);
+       gint GetOrigWordCount(glong& iWordIndex, bool isidx);
+       bool GetWordPrev(glong iWordIndex, glong &pidx, bool isidx, int EnableCollationLevel, int servercollatefunc);
+       void GetWordNext(glong &iWordIndex, bool isidx, int EnableCollationLevel, int servercollatefunc);
+};
+
+struct CurrentIndex {
+       glong idx;
+       glong idx_suggest;
+       glong synidx;
+       glong synidx_suggest;
+};
+
+class Libs {
+public:
+       static show_progress_t default_show_progress;
+       int EnableCollationLevel;
+       CollateFunctions CollateFunction;
+
+       Libs(show_progress_t *sp, bool create, int enablelevel, int function);
+       ~Libs();
+       void set_show_progress(show_progress_t *sp) {
+               if (sp)
+                       show_progress = sp;
+               else
+                       show_progress = &default_show_progress;
+       }
+       bool load_dict(const std::string& url, show_progress_t *sp);
+#ifdef SD_SERVER_CODE
+       void LoadFromXML();
+       void SetServerDictMask(std::vector<InstantDictIndex> &dictmask, const char *dicts, int max, int level);
+       void LoadCollateFile(std::vector<InstantDictIndex> &dictmask, CollateFunctions cltfuc);
+       const std::string *get_dir_info(const char *path);
+       const std::string *get_dict_info(const char *uid, bool is_short);
+       const std::string &get_fromto_info();
+       std::string get_dicts_list(const char *dicts, int max_dict_count, int userLevel);
+       int get_dict_level(const char *uid);
+#endif
+#ifdef SD_CLIENT_CODE
+       bool find_lib_by_filename(const char *filename, size_t &iLib);
+       void load(std::list<std::string> &load_list);
+       void reload(std::list<std::string> &load_list, int is_coll_enb, int collf);
+#endif
+
+       glong narticles(size_t idict) { return oLib[idict]->narticles(); }
+       glong nsynarticles(size_t idict) { return oLib[idict]->nsynarticles(); }
+       const std::string& dict_name(size_t idict) { return oLib[idict]->dict_name(); }
+       const std::string& dict_type(size_t idict) { return oLib[idict]->dict_type(); }
+       bool has_dict() { return !oLib.empty(); }
+       gint ndicts() { return oLib.size(); }
+
+       const gchar * poGetWord(glong iIndex,size_t iLib, int servercollatefunc) {
+               return oLib[iLib]->idx_file->getWord(iIndex, EnableCollationLevel, servercollatefunc);
+       }
+       const gchar * poGetOrigWord(glong iIndex,size_t iLib) {
+               return oLib[iLib]->idx_file->getWord(iIndex, 0, 0);
+       }
+       const gchar * poGetSynonymWord(glong iSynonymIndex,size_t iLib, int servercollatefunc) {
+               return oLib[iLib]->syn_file->getWord(iSynonymIndex, EnableCollationLevel, servercollatefunc);
+       }
+       const gchar * poGetOrigSynonymWord(glong iSynonymIndex,size_t iLib) {
+               return oLib[iLib]->syn_file->getWord(iSynonymIndex, 0, 0);
+       }
+       glong poGetOrigSynonymWordIdx(glong iSynonymIndex, size_t iLib) {
+               oLib[iLib]->syn_file->getWord(iSynonymIndex, 0, 0);
+               return oLib[iLib]->syn_file->wordentry_index;
+       }
+       glong CltIndexToOrig(glong cltidx, size_t iLib, int servercollatefunc);
+       glong CltSynIndexToOrig(glong cltidx, size_t iLib, int servercollatefunc);
+       gchar * poGetOrigWordData(glong iIndex,size_t iLib) {
+               if (iIndex==INVALID_INDEX)
+                       return NULL;
+               return oLib[iLib]->get_data(iIndex);
+       }
+       const gchar *GetSuggestWord(const gchar *sWord, CurrentIndex *iCurrent, std::vector<InstantDictIndex> &dictmask, int servercollatefunc);
+       const gchar *poGetCurrentWord(CurrentIndex *iCurrent, std::vector<InstantDictIndex> &dictmask, int servercollatefunc);
+       const gchar *poGetNextWord(const gchar *word, CurrentIndex *iCurrent, std::vector<InstantDictIndex> &dictmask, int servercollatefunc);
+       const gchar *poGetPreWord(const gchar *word, CurrentIndex *iCurrent, std::vector<InstantDictIndex> &dictmask, int servercollatefunc);
+       bool LookupWord(const gchar* sWord, glong& iWordIndex, glong &idx_suggest, size_t iLib, int servercollatefunc) {
+               return oLib[iLib]->Lookup(sWord, iWordIndex, idx_suggest, EnableCollationLevel, servercollatefunc);
+       }
+       bool LookupSynonymWord(const gchar* sWord, glong& iSynonymIndex, glong &synidx_suggest, size_t iLib, int servercollatefunc) {
+               return oLib[iLib]->LookupSynonym(sWord, iSynonymIndex, synidx_suggest, EnableCollationLevel, servercollatefunc);
+       }
+       bool LookupSimilarWord(const gchar* sWord, glong &iWordIndex, glong &idx_suggest, size_t iLib, int servercollatefunc);
+       bool LookupSynonymSimilarWord(const gchar* sWord, glong &iSynonymWordIndex, glong &synidx_suggest, size_t iLib, int servercollatefunc);
+       bool SimpleLookupWord(const gchar* sWord, glong &iWordIndex, glong &idx_suggest, size_t iLib, int servercollatefunc);
+       bool SimpleLookupSynonymWord(const gchar* sWord, glong &iWordIndex, glong &synidx_suggest, size_t iLib, int servercollatefunc);
+       gint GetOrigWordCount(glong& iWordIndex, size_t iLib, bool isidx) {
+               return oLib[iLib]->GetOrigWordCount(iWordIndex, isidx);
+       }
+       bool GetWordPrev(glong iWordIndex, glong &pidx, size_t iLib, bool isidx, int servercollatefunc) {
+               return oLib[iLib]->GetWordPrev(iWordIndex, pidx, isidx, EnableCollationLevel, servercollatefunc);
+       }
+       void GetWordNext(glong &iWordIndex, size_t iLib, bool isidx, int servercollatefunc) {
+               oLib[iLib]->GetWordNext(iWordIndex, isidx, EnableCollationLevel, servercollatefunc);
+       }
+
+       bool LookupWithFuzzy(const gchar *sWord, gchar *reslist[], gint reslist_size, std::vector<InstantDictIndex> &dictmask);
+       gint LookupWithRule(const gchar *sWord, gchar *reslist[], std::vector<InstantDictIndex> &dictmask);
+       gint LookupWithRegex(const gchar *sWord, gchar *reslist[], std::vector<InstantDictIndex> &dictmask);
+
+       typedef void (*updateSearchDialog_func)(gpointer data, gdouble fraction);
+       bool LookupData(const gchar *sWord, std::vector<gchar *> *reslist, updateSearchDialog_func func, gpointer data, bool *cancel, std::vector<InstantDictIndex> &dictmask);
+       int GetStorageType(size_t iLib);
+       const char *GetStorageFilePath(size_t iLib, const char *key);
+       const char *GetStorageFileContent(size_t iLib, const char *key);
+private:
+       std::vector<Dict *> oLib; // word Libs.
+       int iMaxFuzzyDistance;
+       show_progress_t *show_progress;
+       bool CreateCacheFile;
+
+#ifdef SD_SERVER_CODE
+       struct DictInfoItem;
+       struct DictInfoDirItem {
+               ~DictInfoDirItem() {
+                       for (std::list<DictInfoItem *>::iterator i = info_item_list.begin(); i!= info_item_list.end(); ++i) {
+                               delete (*i);
+                       }
+               }
+               std::string info_string;
+               std::string name;
+               std::string dirname;
+               unsigned int dictcount;
+               std::list<DictInfoItem *> info_item_list;
+       };
+       struct DictInfoDictItem {
+               std::string info_string;
+               std::string short_info_string;
+               std::string uid;
+               std::string download;
+               std::string from;
+               std::string to;
+               unsigned int level;
+               unsigned int id;
+       };
+       struct DictInfoItem {
+               ~DictInfoItem() {
+                       if (isdir == 1)
+                               delete dir;
+                       else if (isdir == 0)
+                               delete dict;
+               }
+               int isdir;
+               union {
+                       DictInfoDirItem *dir;
+                       DictInfoDictItem *dict;
+                       std::string *linkuid;
+               };
+       };
+       DictInfoItem *root_info_item;
+       std::map<std::string, DictInfoDictItem *> uidmap;
+       void LoadXMLDir(const char *dir, DictInfoItem *info_item);
+       void GenLinkDict(DictInfoItem *info_item);
+
+       struct ParseUserData {
+               Libs *oLibs;
+               const char *dir;
+               DictInfoItem *info_item;
+               bool indict;
+               std::string path;
+               std::string uid;
+               std::string level;
+               std::string download;
+               std::string from;
+               std::string to;
+               bool inlinkdict;
+               std::string linkuid;
+       };
+       static void func_parse_start_element(GMarkupParseContext *context, const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer user_data, GError **error);
+       static void func_parse_end_element(GMarkupParseContext *context, const gchar *element_name, gpointer user_data, GError **error);
+       static void func_parse_text(GMarkupParseContext *context, const gchar *text, gsize text_len, gpointer user_data, GError **error);
+
+       struct FromToInfo {
+               std::string uid;
+               std::string bookname;
+       };
+       struct FromTo {
+               std::string to;
+               std::list<FromToInfo> fromto_info;
+       };
+       std::string cache_fromto;
+       void gen_fromto_info(struct DictInfoItem *info_item, std::map<std::string, std::list<FromTo> > &map_fromto);
+#endif
+
+       friend class DictLoader;
+       friend class DictReLoader;
+};
+
+
+#endif//!_STDDICT_HPP_
diff --git a/src/lib/storage.cpp b/src/lib/storage.cpp
new file mode 100644 (file)
index 0000000..ad1ab96
--- /dev/null
@@ -0,0 +1,92 @@
+#include "storage.h"
+#include <glib.h>
+
+ResourceStorage::ResourceStorage()
+{
+       file_storage = NULL;
+       database_storage = NULL;
+}
+
+ResourceStorage::~ResourceStorage()
+{
+       delete file_storage;
+       delete database_storage;
+}
+
+bool ResourceStorage::load(const char *dirname)
+{
+       std::string resdir(dirname);
+       resdir += G_DIR_SEPARATOR_S "res";
+       if (g_file_test(resdir.c_str(), G_FILE_TEST_IS_DIR)) {
+               file_storage = new File_ResourceStorage(resdir.c_str());
+               is_file_or_db = 1;
+               return false;
+       }
+       std::string rifofilename(dirname);
+       rifofilename += G_DIR_SEPARATOR_S "res.rifo";
+       if (g_file_test(rifofilename.c_str(), G_FILE_TEST_EXISTS)) {
+               database_storage = new Database_ResourceStorage();
+               bool failed = database_storage->load(rifofilename.c_str());
+               if (failed) {
+                       delete database_storage;
+                       database_storage = NULL;
+                       return true;
+               }
+               is_file_or_db = 0;
+               return false;
+       }
+       return true;
+}
+
+const char *ResourceStorage::get_file_path(const char *key)
+{
+       if (is_file_or_db)
+               return file_storage->get_file_path(key);
+       else
+               return database_storage->get_file_path(key);
+}
+
+const char *ResourceStorage::get_file_content(const char *key)
+{
+       if (is_file_or_db)
+               return file_storage->get_file_content(key);
+       else
+               return database_storage->get_file_content(key);
+}
+
+File_ResourceStorage::File_ResourceStorage(const char *resdir_)
+{
+       resdir = resdir_;
+}
+
+const char *File_ResourceStorage::get_file_path(const char *key)
+{
+       filepath = resdir;
+       filepath += G_DIR_SEPARATOR;
+       filepath += key;
+       return filepath.c_str();
+}
+
+const char *File_ResourceStorage::get_file_content(const char *key)
+{
+       return NULL;
+}
+
+Database_ResourceStorage::Database_ResourceStorage()
+{
+}
+
+bool Database_ResourceStorage::load(const char *rifofilename)
+{
+       return false;
+}
+
+const char *Database_ResourceStorage::get_file_path(const char *key)
+{
+       return NULL;
+}
+
+const char *Database_ResourceStorage::get_file_content(const char *key)
+{
+       return NULL;
+}
diff --git a/src/lib/storage.h b/src/lib/storage.h
new file mode 100644 (file)
index 0000000..88a3401
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef _STARDICT_RESOURCE_STORAGE_H_
+#define _STARDICT_RESOURCE_STORAGE_H_
+
+#include <string>
+
+class File_ResourceStorage {
+public:
+       File_ResourceStorage(const char *resdir);
+       const char *get_file_path(const char *key);
+       const char *get_file_content(const char *key);
+private:
+       std::string resdir;
+       std::string filepath;
+};
+
+class Database_ResourceStorage {
+public:
+       Database_ResourceStorage();
+       bool load(const char *rifofilename);
+       const char *get_file_path(const char *key);
+       const char *get_file_content(const char *key);
+};
+
+class ResourceStorage {
+public:
+       ResourceStorage();
+       ~ResourceStorage();
+       bool load(const char *dirname);
+       int is_file_or_db;
+       const char *get_file_path(const char *key);
+       const char *get_file_content(const char *key);
+private:
+       File_ResourceStorage *file_storage;
+       Database_ResourceStorage *database_storage;
+};
+
+#endif
diff --git a/src/lib/treedict.cpp b/src/lib/treedict.cpp
new file mode 100644 (file)
index 0000000..01fa89a
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+ * This file part of StarDict - A international dictionary for GNOME.
+ * http://stardict.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * Implementation of class to work with GtkTree
+ * based StarDict's dictionaries
+ */
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "file.hpp"
+#include "getuint32.h"
+
+#include "treedict.hpp"
+
+GtkTreeStore *TreeDict::model=NULL;
+
+TreeDict::TreeDict()
+{
+       if (model)
+               return;
+
+       // It is said G_TYPE_UINT will always be 32 bit.
+       // see http://bugzilla.gnome.org/show_bug.cgi?id=337966
+       model = gtk_tree_store_new (3, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_UINT); //word, offset, size
+}
+
+bool TreeDict::load(const std::string& ifofilename)
+{
+       gulong tdxfilesize;
+       if (!load_ifofile(ifofilename, &tdxfilesize))
+               return false;
+
+       std::string fullfilename(ifofilename);
+       fullfilename.replace(fullfilename.length()-sizeof("ifo")+1, sizeof("ifo")-1, "dict.dz");
+
+       if (g_file_test(fullfilename.c_str(), G_FILE_TEST_EXISTS)) {
+               dictdzfile.reset(new dictData);
+               if (!dictdzfile->open(fullfilename, 0)) {
+                       //g_print("open file %s failed!\n",fullfilename);
+                       return false;
+               }
+       } else {
+               fullfilename.erase(fullfilename.length()-sizeof(".dz")+1, sizeof(".dz")-1);
+               dictfile = fopen(fullfilename.c_str(),"rb");
+               if (!dictfile) {
+                       //g_print("open file %s failed!\n",fullfilename);
+                       return false;
+               }
+       }
+
+       fullfilename=ifofilename;
+       fullfilename.replace(fullfilename.length()-sizeof("ifo")+1, sizeof("ifo")-1, "tdx.gz");
+
+       gchar *buffer= NULL;
+       if (g_file_test(fullfilename.c_str(), G_FILE_TEST_EXISTS)) {
+               gzFile in;
+               in = gzopen(fullfilename.c_str(),"rb");
+               if (in == NULL) {
+                       //g_print("Open file %s failed!\n",idxfilename);
+                       return false;
+               }
+
+               buffer = (gchar *)g_malloc(tdxfilesize);
+
+               gulong len;
+               len = gzread(in, buffer, tdxfilesize);
+               if (len < 0) {
+                       g_free(buffer);
+                       return false;
+               }
+               gzclose(in);
+               if (len != tdxfilesize) {
+                       g_free(buffer);
+                       return false;
+               }
+       } else {
+               fullfilename.erase(fullfilename.length()-sizeof(".gz")+1, sizeof(".gz")-1);
+               FILE *file;
+               if (!(file = fopen (fullfilename.c_str(), "rb"))) {
+                       //g_print("Open file %s failed!\n",fullfilename);
+                       return false;
+               }
+               buffer = (gchar *)g_malloc(tdxfilesize);
+               gulong read_len;
+               read_len = fread(buffer, 1, tdxfilesize, file);
+               fclose(file);
+               if (read_len!=tdxfilesize) {
+                       g_free(buffer);
+                       return false;
+               }
+       }
+
+       gchar *tmp_buffer = buffer;
+       load_model(&tmp_buffer, NULL, 1); // tmp_buffer will be changed.
+       g_free(buffer);
+       return true;
+}
+
+bool TreeDict::load_ifofile(const std::string& ifofilename, gulong *tdxfilesize)
+{
+       DictInfo dict_info;
+       if (!dict_info.load_from_ifo_file(ifofilename, true))
+               return false;
+
+       *tdxfilesize = dict_info.index_file_size;
+       sametypesequence=dict_info.sametypesequence;
+
+       return true;
+}
+
+void TreeDict::load_model(gchar **buffer, GtkTreeIter *parent, guint32 count)
+{
+       GtkTreeIter iter;
+       gchar *p1;
+       guint32 offset, size, subentry_count;
+
+       for (guint32 i=0; i< count; i++) {
+               p1 = *buffer + strlen(*buffer) +1;
+               offset = g_ntohl(get_uint32(p1));
+               p1 += sizeof(guint32);
+               size = g_ntohl(get_uint32(p1));
+               p1 += sizeof(guint32);
+               subentry_count = g_ntohl(get_uint32(p1));
+               p1 += sizeof(guint32);
+               gtk_tree_store_append(model, &iter, parent);
+               gtk_tree_store_set(model, &iter, 0, *buffer, 1, offset, 2, size, -1);
+               *buffer = p1;
+               if (subentry_count)
+                       load_model(buffer, &iter, subentry_count);
+       }
+}
+
+
+/**************************************************/
+TreeDicts::TreeDicts()
+{
+}
+
+TreeDicts::~TreeDicts()
+{
+       for (std::vector<TreeDict *>::iterator it=oTreeDict.begin();
+            it!=oTreeDict.end(); ++it)
+               delete *it;
+}
+
+void TreeDicts::load_dict(const std::string& url)
+{
+       TreeDict *lib = new TreeDict;
+       if (lib->load(url))
+               oTreeDict.push_back(lib);
+       else
+               delete lib;
+}
+
+class TreeDictLoader {
+public:
+       TreeDictLoader(TreeDicts& td_) : td(td_) {}
+       void operator()(const std::string& url, bool disable) {
+               if (!disable)
+                       td.load_dict(url);
+       }
+private:
+       TreeDicts& td;
+};
+
+GtkTreeStore* TreeDicts::Load(const strlist_t& tree_dicts_dirs,
+                             const strlist_t& order_list,
+                             const strlist_t& disable_list)
+{
+       TreeDictLoader load(*this);
+       for_each_file(tree_dicts_dirs, ".ifo", order_list, disable_list, load);
+
+       return TreeDict::get_model();
+}
+
+gchar* TreeDicts::poGetWordData(guint32 offset, guint32 size, int iTreeDict)
+{
+       return oTreeDict[iTreeDict]->GetWordData(offset, size);
+}
diff --git a/src/lib/treedict.hpp b/src/lib/treedict.hpp
new file mode 100644 (file)
index 0000000..30f421e
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef _TREEDICT_HPP_
+#define _TREEDICT_HPP_
+
+#include <gtk/gtk.h>
+
+#include "common.hpp"
+#include "data.hpp"
+
+class TreeDict : public DictBase {
+public:
+       TreeDict();
+       bool load(const std::string& ifofilename);
+       static GtkTreeStore *get_model() { return model; }
+private:
+       static GtkTreeStore *model;
+
+       bool load_ifofile(const std::string& ifofilename, gulong *tdxfilesize);
+       void load_model(gchar **buffer, GtkTreeIter *parent, guint32 count);
+};
+
+class TreeDicts {
+public:
+       TreeDicts();
+       ~TreeDicts();
+       void load_dict(const std::string& url);
+       GtkTreeStore* Load(const strlist_t& tree_dicts_dirs,
+                          const strlist_t& order_list,
+                          const strlist_t& disable_list);
+       gchar * poGetWordData(guint32 offset, guint32 size, int iTreeDict);
+private:
+       std::vector<TreeDict *> oTreeDict;
+};
+
+#endif//!_TREEDICT_HPP_
diff --git a/src/lib/ttsplugin.cpp b/src/lib/ttsplugin.cpp
new file mode 100644 (file)
index 0000000..8a420d5
--- /dev/null
@@ -0,0 +1,6 @@
+#include "ttsplugin.h"
+
+StarDictTtsPlugInObject::StarDictTtsPlugInObject()
+{
+       saytext_func = 0;
+}
diff --git a/src/lib/ttsplugin.h b/src/lib/ttsplugin.h
new file mode 100644 (file)
index 0000000..a204772
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef _STARDICT_TTS_PLUGIN_H_
+#define _STARDICT_TTS_PLUGIN_H_
+
+struct StarDictTtsPlugInObject{
+       StarDictTtsPlugInObject();
+
+       typedef void (*saytext_func_t)(const char *text);
+       saytext_func_t saytext_func;
+       const char *tts_name;
+};
+
+#endif
diff --git a/src/lib/virtualdictplugin.cpp b/src/lib/virtualdictplugin.cpp
new file mode 100644 (file)
index 0000000..64f47b2
--- /dev/null
@@ -0,0 +1,6 @@
+#include "virtualdictplugin.h"
+
+StarDictVirtualDictPlugInObject::StarDictVirtualDictPlugInObject()
+{
+       lookup_func = 0;
+}
diff --git a/src/lib/virtualdictplugin.h b/src/lib/virtualdictplugin.h
new file mode 100644 (file)
index 0000000..6b3663d
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef _STARDICT_VIRTUALDICT_PLUGIN_H_
+#define _STARDICT_VIRTUALDICT_PLUGIN_H_
+
+struct StarDictVirtualDictPlugInObject{
+       StarDictVirtualDictPlugInObject();
+
+       typedef void (*lookup_func_t)(const char *text, char ***pppWord, char ****ppppWordData);
+       lookup_func_t lookup_func;
+       const char *dict_name;
+};
+
+#endif
diff --git a/src/libwrapper.cpp b/src/libwrapper.cpp
new file mode 100644 (file)
index 0000000..94acaa1
--- /dev/null
@@ -0,0 +1,272 @@
+/* 
+ * This file part of sdcv - console version of Stardict program
+ * http://sdcv.sourceforge.net
+ * Copyright (C) 2005-2006 Evgeniy <dushistov@mail.ru>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <glib/gi18n.h>
+#include <map>
+
+#include "libwrapper.hpp"
+
+
+static std::string xdxf2text(const char *p)
+{
+       std::string res;
+       for (; *p; ++p) {
+               if (*p!='<') {
+                       if (g_str_has_prefix(p, "&gt;")) {
+                               res+=">";
+                               p+=3;
+                       } else if (g_str_has_prefix(p, "&lt;")) {
+                               res+="<";
+                               p+=3;
+                       } else if (g_str_has_prefix(p, "&amp;")) {
+                               res+="&";
+                               p+=4;
+                       } else if (g_str_has_prefix(p, "&quot;")) {
+                               res+="\"";
+                               p+=5;
+                       } else
+                               res+=*p;
+                       continue;
+               }
+
+               const char *next=strchr(p, '>');
+               if (!next)
+                       continue;
+
+               std::string name(p+1, next-p-1);
+
+               if (name=="abr")
+                       res+="";
+               else if (name=="/abr")
+                       res+="";
+               else if (name=="k") {
+                       const char *begin=next;
+                       if ((next=strstr(begin, "</k>"))!=NULL)
+                               next+=sizeof("</k>")-1-1;
+                       else
+                               next=begin;
+               } else if (name=="b")
+                       res+="";
+               else if (name=="/b")
+                       res+="";
+               else if (name=="i")
+                       res+="";
+               else if (name=="/i")
+                       res+="";
+               else if (name=="tr")
+                       res+="[";
+               else if (name=="/tr")
+                       res+="]";
+               else if (name=="ex")
+                       res+="";
+               else if (name=="/ex")
+                       res+="";
+               else if (!name.empty() && name[0]=='c' && name!="co") {
+                       std::string::size_type pos=name.find("code");
+                       if (pos!=std::string::size_type(-1)) {
+                               pos+=sizeof("code=\"")-1;
+                               std::string::size_type end_pos=name.find("\"");
+                               std::string color(name, pos, end_pos-pos);
+                               res+="";
+                       } else {
+                               res+="";
+                       }
+               } else if (name=="/c")
+                       res+="";
+
+               p=next;
+       }
+       return res;
+}
+
+static string parse_data(const gchar *data)
+{
+       if (!data)
+               return "";
+
+       string res;
+       guint32 data_size, sec_size=0;
+       gchar *m_str;
+       const gchar *p=data;
+       data_size=*((guint32 *)p);
+       p+=sizeof(guint32);
+       while (guint32(p - data)<data_size) {
+               switch (*p++) {
+               case 'g':
+               case 'm':
+               case 'l': //need more work...
+                       sec_size = strlen(p);
+                       if (sec_size) {
+                               res+="\n";
+                               m_str = g_strndup(p, sec_size);
+                               res += m_str;
+                               g_free(m_str);
+                       }
+                       sec_size++;
+                       break;
+               case 'x':
+                       sec_size = strlen(p);
+                       if (sec_size) {
+                               res+="\n";
+                               m_str = g_strndup(p, sec_size);
+                               res += xdxf2text(m_str);
+                               g_free(m_str);
+                       }
+                       sec_size++;
+                       break;
+               case 't':
+                       sec_size = strlen(p);
+                       if(sec_size){
+                               res+="\n";
+                               m_str = g_strndup(p, sec_size);
+                               res += "["+string(m_str)+"]";
+                               g_free(m_str);
+                       }
+                       sec_size++;
+                       break;
+               case 'y':
+                       sec_size = strlen(p);
+                       sec_size++;                             
+                       break;
+               case 'W':
+               case 'P':
+                       sec_size=*((guint32 *)p);
+                       sec_size+=sizeof(guint32);
+                       break;
+               }
+               p += sec_size;
+       }
+
+  
+       return res;
+}
+
+void Library::SimpleLookup(const string &str, TSearchResultList& res_list)
+{      
+       glong idx, idx_suggest;
+       res_list.reserve(ndicts());
+       for (gint idict=0; idict<ndicts(); ++idict)
+               if (SimpleLookupWord(str.c_str(), idx, idx_suggest, (size_t) idict, 0))
+                       res_list.push_back(
+                               TSearchResult(dict_name(idict),
+                                             poGetWord(idx, idict, 0),
+                                             parse_data(poGetOrigWordData(idx, idict))));
+}
+
+void Library::LookupWithFuzzy(const string &str, TSearchResultList& res_list)
+{
+       static const int MAXFUZZY=10;
+
+       gchar *fuzzy_res[MAXFUZZY];
+       if (!Libs::LookupWithFuzzy(str.c_str(), fuzzy_res, MAXFUZZY, query_dictmask))
+               return;
+       
+       for (gchar **p=fuzzy_res, **end=fuzzy_res+MAXFUZZY; 
+            p!=end && *p; ++p) {
+               SimpleLookup(*p, res_list);
+               g_free(*p);
+       }
+}
+
+void Library::LookupWithRule(const string &str, TSearchResultList& res_list)
+{
+       std::vector<gchar *> match_res((MAX_MATCH_ITEM_PER_LIB) * ndicts());
+
+       gint nfound=Libs::LookupWithRule(str.c_str(), &match_res[0], query_dictmask);
+       if (!nfound)
+               return;
+
+       for (gint i=0; i<nfound; ++i) {
+               SimpleLookup(match_res[i], res_list);
+               g_free(match_res[i]);
+       }
+}
+
+void Library::LookupData(const string &str, TSearchResultList& res_list)
+{
+       bool cancel = false;
+       std::vector<gchar *> drl[ndicts()];
+       if (!Libs::LookupData(str.c_str(), drl, NULL, NULL, &cancel, query_dictmask))
+               return;
+       for (int idict=0; idict<ndicts(); ++idict)
+               for (std::vector<gchar *>::size_type j=0; j<drl[idict].size(); ++j) {
+                       SimpleLookup(drl[idict][j], res_list);
+                       g_free(drl[idict][j]);
+               }
+}
+
+bool Library::process_phrase(const char *loc_str, TSearchResultList &res_list)
+{
+       if (NULL==loc_str)
+               return true;
+
+       std::string query;
+
+       gsize bytes_read;
+       gsize bytes_written;
+       GError *err=NULL;
+       char *str=NULL;
+       if (!utf8_input)
+               str=g_locale_to_utf8(loc_str, -1, &bytes_read, &bytes_written, &err);
+       else
+               str=g_strdup(loc_str);
+
+       if (NULL==str) {
+               fprintf(stderr, _("Can not convert %s to utf8.\n"), loc_str);
+               fprintf(stderr, "%s\n", err->message);
+               g_error_free(err);
+               return false;
+       }
+
+       if (str[0]=='\0')
+               return true;
+
+       switch (analyse_query(str, query)) {
+       case qtFUZZY:
+               g_debug ("FUZZY");
+               LookupWithFuzzy(query, res_list);
+               break;
+       case qtREGEX:
+               g_debug ("REGEX");
+               LookupWithRule(query, res_list);
+               break;
+       case qtSIMPLE:
+               g_debug ("SIMPLE");
+               SimpleLookup(str, res_list);
+               if (res_list.empty())
+                       LookupWithFuzzy(str, res_list);
+               break;
+       case qtDATA:
+               g_debug ("DATA");
+               LookupData(query, res_list);
+               break;
+       default:
+               g_debug ("DEFAULT");
+               /*nothing*/;
+       }
+
+       g_free(str);
+       return true;
+}
+
diff --git a/src/libwrapper.hpp b/src/libwrapper.hpp
new file mode 100644 (file)
index 0000000..b7cd6d3
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef _LIBWRAPPER_HPP_
+#define _LIBWRAPPER_HPP_
+
+#include <string>
+#include <vector>
+
+#include "file.hpp"
+#include "lib.h"
+
+using std::string;
+using std::vector;
+
+//this structure is wrapper and it need for unification
+//results of search whith return Dicts class
+struct TSearchResult {
+       string bookname;
+       string def;
+       string exp;
+
+       TSearchResult(const string& bookname_, const string& def_, const string& exp_)
+               : bookname(bookname_), def(def_), exp(exp_)
+               {
+               }
+};
+
+typedef vector<TSearchResult> TSearchResultList;
+typedef TSearchResultList::iterator PSearchResult;
+
+//this class is wrapper around Dicts class for easy use
+//of it
+class Library : public Libs {
+public:
+       Library(bool uinput, bool uoutput) : 
+               Libs(NULL, FALSE, 0, 0), utf8_input(uinput), utf8_output(uoutput)  {}
+
+       bool process_phrase(const char *loc_str, TSearchResultList &res_list);
+       std::vector<InstantDictIndex> query_dictmask;
+
+private:
+       bool utf8_input, utf8_output;
+
+       void SimpleLookup(const string &str, TSearchResultList& res_list);
+       void LookupWithFuzzy(const string &str, TSearchResultList& res_list);
+       void LookupWithRule(const string &str, TSearchResultList& res_lsit);
+       void LookupData(const string &str, TSearchResultList& res_list);
+};
+
+#endif//!_LIBWRAPPER_HPP_
diff --git a/src/mstardict.cpp b/src/mstardict.cpp
new file mode 100644 (file)
index 0000000..596a198
--- /dev/null
@@ -0,0 +1,361 @@
+/*
+ *  MStarDict - International dictionary for Maemo.
+ *  Copyright (C) 2010 Roman Moravcik
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <cerrno>
+#include <cstring>
+#include <cstdlib>
+#include <cstdio>
+#include <clocale>
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <glib/gstdio.h>
+
+#include <gtk/gtk.h>
+#include <hildon/hildon.h>
+
+#include <getopt.h>
+#include <string>
+#include <vector>
+#include <memory>
+
+#include "libwrapper.hpp"
+#include "file.hpp"
+#include "mstardict.hpp"
+
+enum {
+       INDEX_COLUMN = 0,
+       BOOKNAME_COLUMN,
+       DEF_COLUMN,
+       N_COLUMNS
+};
+
+
+MStarDict::MStarDict ()
+{
+       label = NULL;
+       alignment = NULL;
+       results_view = NULL;
+
+       /* create list of ressults */
+       results_list = gtk_list_store_new (N_COLUMNS,
+                                          G_TYPE_INT,          /* INDEX_COLUMN */
+                                          G_TYPE_STRING,       /* BOOKNAME_COLUMN */
+                                          G_TYPE_STRING);      /* DEF_COLUMN */
+
+       /* set sorting of resuslts */
+       gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (results_list),
+                                             DEF_COLUMN,
+                                             GTK_SORT_ASCENDING);
+
+       /* initialize stardict library */
+       lib = new Library (true, true);
+}
+
+MStarDict::~MStarDict ()
+{
+       /* destroy list of results */
+       g_object_unref (results_list);
+
+       /* deinitialize stardict library */
+       delete lib;
+}
+
+gboolean
+MStarDict::on_results_view_selection_changed (GtkTreeSelection *selection,
+                                             MStarDict *mStarDict)
+{
+       GtkTreeModel *model;
+       GtkTreeIter iter;
+       char *bookname, *def, *exp;
+       gint selected = 0;
+
+       if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
+               /* unselect selected rows */
+               gtk_tree_selection_unselect_all (selection);
+               gtk_tree_model_get (model, &iter, INDEX_COLUMN, &selected, -1);
+
+               bookname = g_markup_printf_escaped ("<span color=\"dimgray\" size=\"x-small\">%s</span>",
+                                                   mStarDict->result_list[selected].bookname.c_str());
+               def = g_markup_printf_escaped ("<span color=\"darkred\" weight=\"heavy\" size=\"x-large\">%s</span>",
+                                              mStarDict->result_list[selected].def.c_str());
+               exp = g_strdup (mStarDict->result_list[selected].exp.c_str());
+
+               /* create translation window */
+               mStarDict->create_translation_window (bookname, def, exp);
+
+               g_free (bookname);
+               g_free (def);
+               g_free (exp);
+       }
+
+       /* grab focus to search entry */
+       gtk_widget_grab_focus (GTK_WIDGET (mStarDict->search));
+
+       return TRUE;
+}
+
+gboolean
+MStarDict::on_search_entry_changed (GtkEditable *editable,
+                                   MStarDict *mStarDict)
+{
+       GtkTreeSelection *selection;
+       const gchar *search;
+       GtkTreeIter iter;
+
+       search = gtk_entry_get_text (GTK_ENTRY (editable));
+
+       if (strcmp (search, "") == 0) {
+               gtk_widget_show (mStarDict->label);
+               gtk_widget_hide (mStarDict->alignment);
+       } else {
+               selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (mStarDict->results_view));
+               gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE);
+
+               /* clear previous search results */
+               mStarDict->result_list.clear();
+               gtk_list_store_clear (mStarDict->results_list);
+
+               /* unselect rows */
+               selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (mStarDict->results_view));
+               gtk_tree_selection_unselect_all (selection);
+
+               /* fill list with new results */
+               mStarDict->lib->process_phrase(search, mStarDict->result_list);
+               if (!mStarDict->result_list.empty()) {
+                       for (size_t i = 0; i < mStarDict->result_list.size(); ++i) {
+                               gtk_list_store_append (mStarDict->results_list, &iter);
+                               gtk_list_store_set (mStarDict->results_list,
+                                                   &iter,
+                                                   INDEX_COLUMN, i,
+                                                   BOOKNAME_COLUMN, mStarDict->result_list[i].bookname.c_str(),
+                                                   DEF_COLUMN, mStarDict->result_list[i].def.c_str(),
+                                                   -1);
+                       }
+               }
+
+               /* unselect selected rows */
+               gtk_tree_selection_unselect_all (selection);
+               gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
+
+               gtk_widget_hide (mStarDict->label);
+               gtk_widget_show (mStarDict->alignment);
+       }
+
+       return TRUE;
+}
+
+class GetAllDictList {
+public:
+       GetAllDictList(std::list<std::string> &dict_all_list_) :
+                                       dict_all_list(dict_all_list_) {}
+       void operator()(const std::string& url, bool disable) {
+               dict_all_list.push_back(url);
+       }
+private:
+       std::list<std::string> &dict_all_list;
+};
+
+void
+MStarDict::load_dictionaries ()
+{
+       strlist_t dicts_dir_list;
+       strlist_t order_list;
+       strlist_t disable_list;
+
+       std::list<std::string> load_list;
+
+       /* dictionary directory */
+       dicts_dir_list.push_back (std::string ("/home/user/MyDocs/mstardict"));
+
+       for_each_file(dicts_dir_list, ".ifo", order_list, disable_list, GetAllDictList(load_list));
+       lib->load(load_list);
+
+       lib->query_dictmask.clear();
+       for (std::list<std::string>::iterator i = load_list.begin(); i != load_list.end(); ++i) {
+               size_t iLib;
+               if (lib->find_lib_by_filename(i->c_str(), iLib)) {
+                       InstantDictIndex instance_dict_index;
+                       instance_dict_index.type = InstantDictType_LOCAL;
+                       instance_dict_index.index = iLib;
+                       lib->query_dictmask.push_back(instance_dict_index);
+               }
+       }
+}
+
+void
+MStarDict::create_translation_window (const gchar *bookname,
+                                     const gchar *def,
+                                     const gchar *exp)
+{
+       GtkWidget *window, *alignment, *pannable, *vbox, *label;
+
+       window = hildon_stackable_window_new ();
+       gtk_window_set_title (GTK_WINDOW (window), _("Translation"));
+
+       alignment = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
+       gtk_alignment_set_padding (GTK_ALIGNMENT (alignment),
+                                  HILDON_MARGIN_DEFAULT,
+                                  HILDON_MARGIN_DEFAULT,
+                                  HILDON_MARGIN_DOUBLE,
+                                  HILDON_MARGIN_DEFAULT);
+       gtk_container_add (GTK_CONTAINER (window), alignment);
+
+       pannable = hildon_pannable_area_new ();
+       g_object_set (G_OBJECT (pannable), "mov-mode", HILDON_MOVEMENT_MODE_BOTH,
+                     NULL);
+       gtk_container_add (GTK_CONTAINER (alignment), pannable);
+
+       vbox = gtk_vbox_new (FALSE, 0);
+       hildon_pannable_area_add_with_viewport (HILDON_PANNABLE_AREA (pannable),
+                                               vbox);
+
+       label = gtk_label_new ("Bookname");
+       gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+       gtk_label_set_markup (GTK_LABEL (label), bookname);
+       gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+       label = gtk_label_new ("Definition");
+       gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+       gtk_label_set_markup (GTK_LABEL (label), def);
+       gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+       label = gtk_label_new ("Expresion");
+       gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+       gtk_label_set_markup (GTK_LABEL (label), exp);
+       gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+       gtk_widget_show_all (window);
+}
+
+void
+MStarDict::create_main_window ()
+{
+       HildonProgram *program = NULL;
+       GtkWidget *window, *vbox, *pannable;
+       GtkCellRenderer *renderer;
+       GtkTreeSelection *selection;
+       GdkColor style_color;
+
+       program = hildon_program_get_instance ();
+       g_set_application_name (_("MStardict"));
+
+       window = hildon_stackable_window_new ();
+       hildon_program_add_window (program, HILDON_WINDOW (window));
+
+       vbox = gtk_vbox_new (FALSE, 0);
+       gtk_container_add (GTK_CONTAINER (window), vbox);
+
+       label = gtk_label_new (_("No search result"));
+       hildon_helper_set_logical_color (label, GTK_RC_FG, GTK_STATE_NORMAL,
+                                        "SecondaryTextColor");
+       hildon_helper_set_logical_font (label, "LargeSystemFont");
+       gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
+
+       alignment = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
+       gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), HILDON_MARGIN_HALF, 0,
+                                  HILDON_MARGIN_DOUBLE, HILDON_MARGIN_DEFAULT);
+       gtk_box_pack_start (GTK_BOX (vbox), alignment, TRUE, TRUE, 0);
+
+       pannable = hildon_pannable_area_new ();
+       gtk_container_add (GTK_CONTAINER (alignment), pannable);
+
+       results_view = hildon_gtk_tree_view_new (HILDON_UI_MODE_EDIT);
+       gtk_tree_view_set_model (GTK_TREE_VIEW (results_view),
+                                GTK_TREE_MODEL (results_list));
+       gtk_container_add (GTK_CONTAINER (pannable), results_view);
+
+       selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (results_view));
+       g_signal_connect (selection, "changed",
+                         G_CALLBACK (on_results_view_selection_changed), this);
+
+       /* def column */
+       renderer = gtk_cell_renderer_text_new ();
+       gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (results_view),
+                                                    -1,
+                                                    "Def", renderer,
+                                                    "text", DEF_COLUMN,
+                                                    NULL);
+
+       /* bookname column */
+       renderer = gtk_cell_renderer_text_new ();
+       gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (results_view),
+                                                    -1,
+                                                    "Bookname", renderer,
+                                                    "text", BOOKNAME_COLUMN,
+                                                    NULL);
+
+       if (!gtk_style_lookup_color (GTK_WIDGET (label)->style, "SecondaryTextColor",
+                                    &style_color)) {
+               gdk_color_parse ("grey", &style_color);
+       }
+       g_object_set (G_OBJECT (renderer),
+                     "xalign", 1.0,
+                     "width-chars", 10,
+                     "foreground-gdk", &style_color,
+                     "foreground-set", TRUE,
+                     "size", 12000,
+                     "ellipsize", PANGO_ELLIPSIZE_END,
+                     "ellipsize-set", TRUE,
+                     NULL);
+
+       /* search entry */
+       search = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT);
+       gtk_box_pack_end (GTK_BOX (vbox), search, FALSE, TRUE, 0);
+       g_signal_connect (search, "changed",
+                         G_CALLBACK (on_search_entry_changed), this);
+
+       /* window signals */
+       g_signal_connect (G_OBJECT (window), "destroy",
+                         G_CALLBACK (gtk_main_quit), NULL);
+
+       /* show all widget instead of alignment */
+       gtk_widget_show_all (GTK_WIDGET (window));
+       gtk_widget_hide (alignment);
+
+       /* grab focus to search entry */
+       gtk_widget_grab_focus (GTK_WIDGET (search));
+}
+
+int
+main (int argc, char **argv)
+{
+       /* initialize hildon */
+       hildon_gtk_init (&argc, &argv);
+
+       /* initialize localization */
+       setlocale(LC_ALL, "");
+       bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
+       bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+       textdomain(GETTEXT_PACKAGE);
+
+       /* create main window */
+       MStarDict mStarDict;
+       mStarDict.create_main_window ();
+
+       /* load all dictionaries */
+       mStarDict.load_dictionaries ();
+
+       gtk_main ();
+       return 0;
+}
diff --git a/src/mstardict.hpp b/src/mstardict.hpp
new file mode 100644 (file)
index 0000000..8c8d1b8
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ *  MStarDict - International dictionary for Maemo.
+ *  Copyright (C) 2010 Roman Moravcik
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <gtk/gtk.h>
+#include <hildon/hildon.h>
+
+class Library;
+
+class MStarDict {
+private:
+       GtkWidget *label;
+       GtkWidget *alignment;
+       GtkWidget *search;
+       GtkWidget *results_view;
+
+       GtkListStore *results_list;
+
+       Library *lib;
+       TSearchResultList result_list;
+
+       static gboolean on_results_view_selection_changed (GtkTreeSelection *selection, MStarDict *mStarDict);
+       static gboolean on_search_entry_changed (GtkEditable *editable, MStarDict *mStarDict);
+
+public:
+       MStarDict ();
+       ~MStarDict ();
+       void create_translation_window (const gchar *bookname, const gchar *def, const gchar *exp);
+       void create_main_window ();
+       void load_dictionaries ();
+};