The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Changes 010
MANIFEST 01
MANIFEST.SKIP 099
META.json 1324
META.yml 213
btparse/src/format_name.c 1210
btparse/src/names.c 22
btparse/src/util.c 01145
lib/Text/BibTeX/Bib.pm 25
lib/Text/BibTeX/BibFormat.pm 11
lib/Text/BibTeX/BibSort.pm 11
lib/Text/BibTeX/Entry.pm 11
lib/Text/BibTeX/File.pm 11
lib/Text/BibTeX/Name.pm 11
lib/Text/BibTeX/NameFormat.pm 11
lib/Text/BibTeX/Structure.pm 11
lib/Text/BibTeX/Value.pm 15
lib/Text/BibTeX.pm 11
t/nameformat.t 42
t/names.t 315
20 files changed (This is a version diff) 1561329
@@ -1,5 +1,15 @@
 Revision history for Perl module Text::BibTeX
 
+0.69 2013-02-27
+ * Fixes in the distribution, namely adding versions to unversioned packages.
+
+0.68 2013-02-27
+ * Replacement for islower() which understands all Unicode 6.2.0
+   chars with "LOWERCASE" property. Now we can detect prefices
+   not just in ASCII ... this also seems to have fixed the strange
+   windows XP test failures, probably due to undefined islower(). See RT #92864
+ * Fixed strange problem with Solaris coredumping due to 0.67 changes.
+
 0.67 2013-02-20
  * Reformatted changelog (thanks to Sergey Romanov)
  * Remove accents from C source file for Sun compiler probs.
@@ -150,3 +150,4 @@ btparse/src/bt_config.h.in
 
 README.OLD
 META.json
+MANIFEST.SKIP
@@ -0,0 +1,99 @@
+
+#!start included /opt/perl/lib/5.18.0/ExtUtils/MANIFEST.SKIP
+# Avoid version control files.
+\bRCS\b
+\bCVS\b
+\bSCCS\b
+,v$
+\B\.svn\b
+\B\.git\b
+\B\.gitignore\b
+\b_darcs\b
+\B\.cvsignore$
+
+# Avoid VMS specific MakeMaker generated files
+\bDescrip.MMS$
+\bDESCRIP.MMS$
+\bdescrip.mms$
+
+# Avoid Makemaker generated and utility files.
+\bMANIFEST\.bak
+\bMakefile$
+\bblib/
+\bMakeMaker-\d
+\bpm_to_blib\.ts$
+\bpm_to_blib$
+\bblibdirs\.ts$         # 6.18 through 6.25 generated this
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\b_build/
+\bBuild.bat$
+\bBuild.COM$
+\bBUILD.COM$
+\bbuild.com$
+
+# Avoid temp and backup files.
+~$
+\.old$
+\#$
+\b\.#
+\.bak$
+\.tmp$
+\.#
+\.rej$
+
+# Avoid OS-specific files/dirs
+# Mac OSX metadata
+\B\.DS_Store
+# Mac OSX SMB mount metadata files
+\B\._
+
+# Avoid Devel::Cover and Devel::CoverX::Covered files.
+\bcover_db\b
+\bcovered\b
+
+# Avoid MYMETA files
+^MYMETA\.
+#!end included /opt/perl/lib/5.18.0/ExtUtils/MANIFEST.SKIP
+
+# Avoid configuration metadata file
+^MYMETA\.
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\bBuild.bat$
+\b_build
+\bBuild.COM$
+\bBUILD.COM$
+\bbuild.com$
+^MANIFEST\.SKIP
+
+# Avoid archives of this distribution
+\bText-BibTeX-[\d\.\_]+
+
+.*\.o$
+
+
+btparse/BUGS
+btparse/ChangeLog
+btparse/COPYING
+btparse/progs/biblex
+btparse/progs/bibparse
+btparse/progs/dumpnames
+btparse/README
+btparse/src/bt_config.h
+btparse/src/libbtparse.dylib
+btparse/tests/macro_test
+btparse/tests/name_test
+btparse/tests/postprocess_test
+btparse/tests/purify_test
+btparse/tests/read_test
+btparse/tests/simple_test
+btparse/tests/tex_test
+btparse/thoughts
+btparse/TODO
+config.log
+crash.bib
+Other/pccts133mr.zip
+xscode/BibTeX.c
@@ -36,43 +36,54 @@
    "provides" : {
       "Text::BibTeX" : {
          "file" : "lib/Text/BibTeX.pm",
-         "version" : "0.67"
+         "version" : "0.69"
       },
       "Text::BibTeX::BibEntry" : {
-         "file" : "lib/Text/BibTeX/Bib.pm"
+         "file" : "lib/Text/BibTeX/Bib.pm",
+         "version" : "0.1"
       },
       "Text::BibTeX::BibFormat" : {
-         "file" : "lib/Text/BibTeX/BibFormat.pm"
+         "file" : "lib/Text/BibTeX/BibFormat.pm",
+         "version" : "0.1"
       },
       "Text::BibTeX::BibSort" : {
-         "file" : "lib/Text/BibTeX/BibSort.pm"
+         "file" : "lib/Text/BibTeX/BibSort.pm",
+         "version" : "0.1"
       },
       "Text::BibTeX::BibStructure" : {
-         "file" : "lib/Text/BibTeX/Bib.pm"
+         "file" : "lib/Text/BibTeX/Bib.pm",
+         "version" : "0.1"
       },
       "Text::BibTeX::Entry" : {
-         "file" : "lib/Text/BibTeX/Entry.pm"
+         "file" : "lib/Text/BibTeX/Entry.pm",
+         "version" : "0.1"
       },
       "Text::BibTeX::File" : {
-         "file" : "lib/Text/BibTeX/File.pm"
+         "file" : "lib/Text/BibTeX/File.pm",
+         "version" : "0.1"
       },
       "Text::BibTeX::Name" : {
-         "file" : "lib/Text/BibTeX/Name.pm"
+         "file" : "lib/Text/BibTeX/Name.pm",
+         "version" : "0.1"
       },
       "Text::BibTeX::NameFormat" : {
-         "file" : "lib/Text/BibTeX/NameFormat.pm"
+         "file" : "lib/Text/BibTeX/NameFormat.pm",
+         "version" : "0.1"
       },
       "Text::BibTeX::SimpleValue" : {
-         "file" : "lib/Text/BibTeX/Value.pm"
+         "file" : "lib/Text/BibTeX/Value.pm",
+         "version" : "0.1"
       },
       "Text::BibTeX::Structure" : {
-         "file" : "lib/Text/BibTeX/Structure.pm"
+         "file" : "lib/Text/BibTeX/Structure.pm",
+         "version" : "0.1"
       },
       "Text::BibTeX::StructuredEntry" : {
          "file" : "lib/Text/BibTeX/Structure.pm"
       },
       "Text::BibTeX::Value" : {
-         "file" : "lib/Text/BibTeX/Value.pm"
+         "file" : "lib/Text/BibTeX/Value.pm",
+         "version" : "0.1"
       }
    },
    "release_status" : "stable",
@@ -81,5 +92,5 @@
          "http://dev.perl.org/licenses/"
       ]
    },
-   "version" : "0.67"
+   "version" : "0.69"
 }
@@ -24,31 +24,42 @@ name: Text-BibTeX
 provides:
   Text::BibTeX:
     file: lib/Text/BibTeX.pm
-    version: '0.67'
+    version: '0.69'
   Text::BibTeX::BibEntry:
     file: lib/Text/BibTeX/Bib.pm
+    version: '0.1'
   Text::BibTeX::BibFormat:
     file: lib/Text/BibTeX/BibFormat.pm
+    version: '0.1'
   Text::BibTeX::BibSort:
     file: lib/Text/BibTeX/BibSort.pm
+    version: '0.1'
   Text::BibTeX::BibStructure:
     file: lib/Text/BibTeX/Bib.pm
+    version: '0.1'
   Text::BibTeX::Entry:
     file: lib/Text/BibTeX/Entry.pm
+    version: '0.1'
   Text::BibTeX::File:
     file: lib/Text/BibTeX/File.pm
+    version: '0.1'
   Text::BibTeX::Name:
     file: lib/Text/BibTeX/Name.pm
+    version: '0.1'
   Text::BibTeX::NameFormat:
     file: lib/Text/BibTeX/NameFormat.pm
+    version: '0.1'
   Text::BibTeX::SimpleValue:
     file: lib/Text/BibTeX/Value.pm
+    version: '0.1'
   Text::BibTeX::Structure:
     file: lib/Text/BibTeX/Structure.pm
+    version: '0.1'
   Text::BibTeX::StructuredEntry:
     file: lib/Text/BibTeX/Structure.pm
   Text::BibTeX::Value:
     file: lib/Text/BibTeX/Value.pm
+    version: '0.1'
 resources:
   license: http://dev.perl.org/licenses/
-version: '0.67'
+version: '0.69'
@@ -291,7 +291,6 @@ bt_set_format_options (bt_name_format * format,
 }
 
 
-
 /* ----------------------------------------------------------------------
  * Functions for actually formatting a name (given a name and a name
  * format structure).
@@ -678,126 +677,6 @@ format_firstpass (bt_name *        name,
 
 
 /* ------------------------------------------------------------------------
-@NAME       : get_uchar()
-@INPUT      : string
-              offset in string
-@OUTPUT     : number of bytes required to gobble the next unicode character, including any combining marks
-@RETURNS    : 
-@DESCRIPTION: In order to deal with unicode chars when calculating abbreviations,
-              we need to know how many bytes the next character is.
-@CALLS      : 
-@CALLERS    : count_virtual_char()
-@CREATED    : 2010/03/14, PK
-@MODIFIED   : 
--------------------------------------------------------------------------- */
-
-get_uchar(char * string, int offset)
-{
-  unsigned char * bytes = (unsigned char *)string;
-  int init;
-
-  if(!string)
-    return 0;
-
-  if (     (// ASCII
-            bytes[offset] == 0x09 ||
-            bytes[offset] == 0x0A ||
-            bytes[offset] == 0x0D ||
-            (0x20 <= bytes[offset] && bytes[offset] <= 0x7E)
-            )
-           )
-    {
-      init = 1;
-    }
-
-  if(     (// non-overlong 2-byte
-           (0xC2 <= bytes[offset] && bytes[offset] <= 0xDF) &&
-           (0x80 <= bytes[offset+1] && bytes[offset+1] <= 0xBF)
-           )
-          )
-    {
-      init = 2;
-    }
-
-  if(     (// excluding overlongs
-           bytes[offset] == 0xE0 &&
-           (0xA0 <= bytes[offset+1] && bytes[offset+1] <= 0xBF) &&
-           (0x80 <= bytes[offset+2] && bytes[offset+2] <= 0xBF)
-           ) ||
-          (// straight 3-byte
-           ((0xE1 <= bytes[offset] && bytes[offset] <= 0xEC) ||
-            bytes[offset] == 0xEE ||
-            bytes[offset] == 0xEF) &&
-           (0x80 <= bytes[offset+1] && bytes[offset+1] <= 0xBF) &&
-           (0x80 <= bytes[offset+2] && bytes[offset+2] <= 0xBF)
-           ) ||
-          (// excluding surrogates
-           bytes[offset] == 0xED &&
-           (0x80 <= bytes[offset+1] && bytes[offset+1] <= 0x9F) &&
-           (0x80 <= bytes[offset+2] && bytes[offset+2] <= 0xBF)
-           )
-          )
-    {
-      init = 3;
-    }
-
-  if(     (// planes 1-3
-           bytes[offset] == 0xF0 &&
-           (0x90 <= bytes[offset+1] && bytes[offset+1] <= 0xBF) &&
-           (0x80 <= bytes[offset+2] && bytes[offset+2] <= 0xBF) &&
-           (0x80 <= bytes[offset+3] && bytes[offset+3] <= 0xBF)
-           ) ||
-          (// planes 4-15
-           (0xF1 <= bytes[offset] && bytes[offset] <= 0xF3) &&
-           (0x80 <= bytes[offset+1] && bytes[offset+1] <= 0xBF) &&
-           (0x80 <= bytes[offset+2] && bytes[offset+2] <= 0xBF) &&
-           (0x80 <= bytes[offset+3] && bytes[offset+3] <= 0xBF)
-           ) ||
-          (// plane 16
-           bytes[offset] == 0xF4 &&
-           (0x80 <= bytes[offset+1] && bytes[offset+1] <= 0x8F) &&
-           (0x80 <= bytes[offset+2] && bytes[offset+2] <= 0xBF) &&
-           (0x80 <= bytes[offset+3] && bytes[offset+3] <= 0xBF)
-           )
-          )
-    {
-      init = 4;
-    }
-
-  /* Now check for combining marks which are separate even in NFC */
-  int c = 0;
-  while (bytes[offset+init+c]) {
-    /* 0300–036F - Combining Diacritical Marks */
-    if (  bytes[offset+init+c] == 0xCC &&
-          (0x80 <= bytes[offset+init+1+c] && bytes[offset+init+1+c] <= 0xAF)
-          )
-      {
-        c = c + 2; /* Skip to next possible combining mark */
-      }
-    /* 1DC0–1DFF - Combining Diacritical Marks Supplement */
-    else if (  bytes[offset+init+c] == 0xE1 &&
-               bytes[offset+init+1+c] == 0xB7 &&
-               (0x80 <= bytes[offset+init+2+c] && bytes[offset+init+2+c] <= 0xBF)
-               )
-      {
-        c = c + 3; /* Skip to next possible combining mark */
-      }
-    /* FE20–FE2F - Combining Half Marks */
-    else if (  bytes[offset+init+c] == 0xEF &&
-               bytes[offset+init+1+c] == 0xB8 &&
-               (0xA0 <= bytes[offset+init+2+c] && bytes[offset+init+2+c] <= 0xAF)
-               )
-      {
-        c = c + 3; /* Skip to next possible combining mark */
-      }
-    else {
-      break;
-    }
-  }
-  return init+c;
-}
-
-/* ------------------------------------------------------------------------
 @NAME       : format_name()
 @INPUT      : format
               tokens     - token list (eg. from format_firstpass())
@@ -497,13 +497,13 @@ find_lc_tokens (bt_stringlist * tokens,
    while (i < tokens->num_items)
    {
       char * token = tokens->items[i];
-      if (*first_lc == -1 && token != NULL && islower (token[0]))
+      if (*first_lc == -1 && token != NULL && isulower (token))
       {
          *first_lc = i;
 
          i++;
          char * token = tokens->items[i];
-         while (i < tokens->num_items && token != NULL && islower (token[0])) {
+         while (i < tokens->num_items && token != NULL && isulower (token)) {
             i++;
             token = tokens->items[i];
          }
@@ -77,3 +77,1148 @@ char *strupr (char *s)
    return s;
 }
 #endif
+
+/* ------------------------------------------------------------------------
+@NAME       : get_uchar()
+@INPUT      : string
+              offset in string
+@OUTPUT     : number of bytes required to gobble the next unicode character, including any combining marks
+@RETURNS    : 
+@DESCRIPTION: In order to deal with unicode chars when calculating abbreviations,
+              we need to know how many bytes the next character is.
+@CALLS      : 
+@CALLERS    : count_virtual_char()
+@CREATED    : 2010/03/14, PK
+@MODIFIED   : 
+-------------------------------------------------------------------------- */
+int
+get_uchar(char * string, int offset)
+{
+  unsigned char * bytes = (unsigned char *)string;
+  int init;
+  unsigned int c = 0; // Without unsigned, for some reason Solaris coredumps
+
+  if(!string)
+    return 0;
+
+  if (     (// ASCII
+            bytes[offset] == 0x09 ||
+            bytes[offset] == 0x0A ||
+            bytes[offset] == 0x0D ||
+            (0x20 <= bytes[offset] && bytes[offset] <= 0x7E)
+            )
+           )
+    {
+      init = 1;
+    }
+
+  if(     (// non-overlong 2-byte
+           (0xC2 <= bytes[offset] && bytes[offset] <= 0xDF) &&
+           (0x80 <= bytes[offset+1] && bytes[offset+1] <= 0xBF)
+           )
+          )
+    {
+      init = 2;
+    }
+
+  if(     (// excluding overlongs
+           bytes[offset] == 0xE0 &&
+           (0xA0 <= bytes[offset+1] && bytes[offset+1] <= 0xBF) &&
+           (0x80 <= bytes[offset+2] && bytes[offset+2] <= 0xBF)
+           ) ||
+          (// straight 3-byte
+           ((0xE1 <= bytes[offset] && bytes[offset] <= 0xEC) ||
+            bytes[offset] == 0xEE ||
+            bytes[offset] == 0xEF) &&
+           (0x80 <= bytes[offset+1] && bytes[offset+1] <= 0xBF) &&
+           (0x80 <= bytes[offset+2] && bytes[offset+2] <= 0xBF)
+           ) ||
+          (// excluding surrogates
+           bytes[offset] == 0xED &&
+           (0x80 <= bytes[offset+1] && bytes[offset+1] <= 0x9F) &&
+           (0x80 <= bytes[offset+2] && bytes[offset+2] <= 0xBF)
+           )
+          )
+    {
+      init = 3;
+    }
+
+  if(     (// planes 1-3
+           bytes[offset] == 0xF0 &&
+           (0x90 <= bytes[offset+1] && bytes[offset+1] <= 0xBF) &&
+           (0x80 <= bytes[offset+2] && bytes[offset+2] <= 0xBF) &&
+           (0x80 <= bytes[offset+3] && bytes[offset+3] <= 0xBF)
+           ) ||
+          (// planes 4-15
+           (0xF1 <= bytes[offset] && bytes[offset] <= 0xF3) &&
+           (0x80 <= bytes[offset+1] && bytes[offset+1] <= 0xBF) &&
+           (0x80 <= bytes[offset+2] && bytes[offset+2] <= 0xBF) &&
+           (0x80 <= bytes[offset+3] && bytes[offset+3] <= 0xBF)
+           ) ||
+          (// plane 16
+           bytes[offset] == 0xF4 &&
+           (0x80 <= bytes[offset+1] && bytes[offset+1] <= 0x8F) &&
+           (0x80 <= bytes[offset+2] && bytes[offset+2] <= 0xBF) &&
+           (0x80 <= bytes[offset+3] && bytes[offset+3] <= 0xBF)
+           )
+          )
+    {
+      init = 4;
+    }
+
+  /* Now check for combining marks which are separate even in NFC */
+  while (bytes[offset+init+c]) {
+    /* 0300–036F - Combining Diacritical Marks */
+    if (  bytes[offset+init+c] == 0xCC &&
+          (0x80 <= bytes[offset+init+1+c] && bytes[offset+init+1+c] <= 0xAF)
+          )
+      {
+        c = c + 2; /* Skip to next possible combining mark */
+      }
+    /* 1DC0–1DFF - Combining Diacritical Marks Supplement */
+    else if (  bytes[offset+init+c] == 0xE1 &&
+               bytes[offset+init+1+c] == 0xB7 &&
+               (0x80 <= bytes[offset+init+2+c] && bytes[offset+init+2+c] <= 0xBF)
+               )
+      {
+        c = c + 3; /* Skip to next possible combining mark */
+      }
+    /* FE20–FE2F - Combining Half Marks */
+    else if (  bytes[offset+init+c] == 0xEF &&
+               bytes[offset+init+1+c] == 0xB8 &&
+               (0xA0 <= bytes[offset+init+2+c] && bytes[offset+init+2+c] <= 0xAF)
+               )
+      {
+        c = c + 3; /* Skip to next possible combining mark */
+      }
+    else {
+      break;
+    }
+  }
+  return init+c;
+}
+
+/* ------------------------------------------------------------------------
+@NAME       : isulower()
+@INPUT      : some bytes
+@OUTPUT     : 
+@RETURNS    : boolean 1 or 0
+@DESCRIPTION: Passed some bytes, returns 1 of the first UTF-8 char is lowercase
+              The code was autogenerated from a dump of perl's fabulous
+              unichars -a '\p{Ll}', massaged into bytes and printed. This list of
+              lowercased property glyphs is from Unicode 6.2.0
+@CALLS      :
+@CALLERS    : find_lc_tokens()
+@CREATED    : 2014/02/27, PK
+@MODIFIED   :
+-------------------------------------------------------------------------- */
+int
+isulower(char * string)
+{
+  unsigned char * bytes = (unsigned char *)string;
+
+  if(!string)
+    return 0;
+
+  if (
+      ( 0x61 <= bytes[0] && bytes[0] <= 0x7A )
+      ) { return 1; }
+  if (
+      (
+       bytes[0] == 0xC2 &&
+       (
+        bytes[1] == 0xB5
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xC3 &&
+       (
+        ( 0x9F <= bytes[1] && bytes[1] <= 0xB6 ) ||
+        ( 0xB8 <= bytes[1] && bytes[1] <= 0xBF )
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xC4 &&
+       (
+        bytes[1] == 0x81 ||
+        bytes[1] == 0x83 ||
+        bytes[1] == 0x85 ||
+        bytes[1] == 0x87 ||
+        bytes[1] == 0x89 ||
+        bytes[1] == 0x8B ||
+        bytes[1] == 0x8D ||
+        bytes[1] == 0x8F ||
+        bytes[1] == 0x91 ||
+        bytes[1] == 0x93 ||
+        bytes[1] == 0x95 ||
+        bytes[1] == 0x97 ||
+        bytes[1] == 0x99 ||
+        bytes[1] == 0x9B ||
+        bytes[1] == 0x9D ||
+        bytes[1] == 0x9F ||
+        bytes[1] == 0xA1 ||
+        bytes[1] == 0xA3 ||
+        bytes[1] == 0xA5 ||
+        bytes[1] == 0xA7 ||
+        bytes[1] == 0xA9 ||
+        bytes[1] == 0xAB ||
+        bytes[1] == 0xAD ||
+        bytes[1] == 0xAF ||
+        bytes[1] == 0xB1 ||
+        bytes[1] == 0xB3 ||
+        bytes[1] == 0xB5 ||
+        ( 0xB7 <= bytes[1] && bytes[1] <= 0xB8 ) ||
+        bytes[1] == 0xBA ||
+        bytes[1] == 0xBC ||
+        bytes[1] == 0xBE
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xC5 &&
+       (
+        bytes[1] == 0x80 ||
+        bytes[1] == 0x82 ||
+        bytes[1] == 0x84 ||
+        bytes[1] == 0x86 ||
+        ( 0x88 <= bytes[1] && bytes[1] <= 0x89 ) ||
+        bytes[1] == 0x8B ||
+        bytes[1] == 0x8D ||
+        bytes[1] == 0x8F ||
+        bytes[1] == 0x91 ||
+        bytes[1] == 0x93 ||
+        bytes[1] == 0x95 ||
+        bytes[1] == 0x97 ||
+        bytes[1] == 0x99 ||
+        bytes[1] == 0x9B ||
+        bytes[1] == 0x9D ||
+        bytes[1] == 0x9F ||
+        bytes[1] == 0xA1 ||
+        bytes[1] == 0xA3 ||
+        bytes[1] == 0xA5 ||
+        bytes[1] == 0xA7 ||
+        bytes[1] == 0xA9 ||
+        bytes[1] == 0xAB ||
+        bytes[1] == 0xAD ||
+        bytes[1] == 0xAF ||
+        bytes[1] == 0xB1 ||
+        bytes[1] == 0xB3 ||
+        bytes[1] == 0xB5 ||
+        bytes[1] == 0xB7 ||
+        bytes[1] == 0xBA ||
+        bytes[1] == 0xBC ||
+        ( 0xBE <= bytes[1] && bytes[1] <= 0xBF )
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xC6 &&
+       (
+        bytes[1] == 0x80 ||
+        bytes[1] == 0x83 ||
+        bytes[1] == 0x85 ||
+        bytes[1] == 0x88 ||
+        ( 0x8C <= bytes[1] && bytes[1] <= 0x8D ) ||
+        bytes[1] == 0x92 ||
+        bytes[1] == 0x95 ||
+        ( 0x99 <= bytes[1] && bytes[1] <= 0x9B ) ||
+        bytes[1] == 0x9E ||
+        bytes[1] == 0xA1 ||
+        bytes[1] == 0xA3 ||
+        bytes[1] == 0xA5 ||
+        bytes[1] == 0xA8 ||
+        ( 0xAA <= bytes[1] && bytes[1] <= 0xAB ) ||
+        bytes[1] == 0xAD ||
+        bytes[1] == 0xB0 ||
+        bytes[1] == 0xB4 ||
+        bytes[1] == 0xB6 ||
+        ( 0xB9 <= bytes[1] && bytes[1] <= 0xBA ) ||
+        ( 0xBD <= bytes[1] && bytes[1] <= 0xBF )
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xC7 &&
+       (
+        bytes[1] == 0x86 ||
+        bytes[1] == 0x89 ||
+        bytes[1] == 0x8C ||
+        bytes[1] == 0x8E ||
+        bytes[1] == 0x90 ||
+        bytes[1] == 0x92 ||
+        bytes[1] == 0x94 ||
+        bytes[1] == 0x96 ||
+        bytes[1] == 0x98 ||
+        bytes[1] == 0x9A ||
+        ( 0x9C <= bytes[1] && bytes[1] <= 0x9D ) ||
+        bytes[1] == 0x9F ||
+        bytes[1] == 0xA1 ||
+        bytes[1] == 0xA3 ||
+        bytes[1] == 0xA5 ||
+        bytes[1] == 0xA7 ||
+        bytes[1] == 0xA9 ||
+        bytes[1] == 0xAB ||
+        bytes[1] == 0xAD ||
+        ( 0xAF <= bytes[1] && bytes[1] <= 0xB0 ) ||
+        bytes[1] == 0xB3 ||
+        bytes[1] == 0xB5 ||
+        bytes[1] == 0xB9 ||
+        bytes[1] == 0xBB ||
+        bytes[1] == 0xBD ||
+        bytes[1] == 0xBF
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xC8 &&
+       (
+        bytes[1] == 0x81 ||
+        bytes[1] == 0x83 ||
+        bytes[1] == 0x85 ||
+        bytes[1] == 0x87 ||
+        bytes[1] == 0x89 ||
+        bytes[1] == 0x8B ||
+        bytes[1] == 0x8D ||
+        bytes[1] == 0x8F ||
+        bytes[1] == 0x91 ||
+        bytes[1] == 0x93 ||
+        bytes[1] == 0x95 ||
+        bytes[1] == 0x97 ||
+        bytes[1] == 0x99 ||
+        bytes[1] == 0x9B ||
+        bytes[1] == 0x9D ||
+        bytes[1] == 0x9F ||
+        bytes[1] == 0xA1 ||
+        bytes[1] == 0xA3 ||
+        bytes[1] == 0xA5 ||
+        bytes[1] == 0xA7 ||
+        bytes[1] == 0xA9 ||
+        bytes[1] == 0xAB ||
+        bytes[1] == 0xAD ||
+        bytes[1] == 0xAF ||
+        bytes[1] == 0xB1 ||
+        ( 0xB3 <= bytes[1] && bytes[1] <= 0xB9 ) ||
+        bytes[1] == 0xBC ||
+        bytes[1] == 0xBF
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xC9 &&
+       (
+        bytes[1] == 0x80 ||
+        bytes[1] == 0x82 ||
+        bytes[1] == 0x87 ||
+        bytes[1] == 0x89 ||
+        bytes[1] == 0x8B ||
+        bytes[1] == 0x8D ||
+        ( 0x8F <= bytes[1] && bytes[1] <= 0xBF )
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xCA &&
+       (
+        ( 0x80 <= bytes[1] && bytes[1] <= 0x93 ) ||
+        ( 0x95 <= bytes[1] && bytes[1] <= 0xAF )
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xCD &&
+       (
+        bytes[1] == 0xB1 ||
+        bytes[1] == 0xB3 ||
+        bytes[1] == 0xB7 ||
+        ( 0xBB <= bytes[1] && bytes[1] <= 0xBD )
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xCE &&
+       (
+        bytes[1] == 0x90 ||
+        ( 0xAC <= bytes[1] && bytes[1] <= 0xBF )
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xCF &&
+       (
+        ( 0x80 <= bytes[1] && bytes[1] <= 0x8E ) ||
+        ( 0x90 <= bytes[1] && bytes[1] <= 0x91 ) ||
+        ( 0x95 <= bytes[1] && bytes[1] <= 0x97 ) ||
+        bytes[1] == 0x99 ||
+        bytes[1] == 0x9B ||
+        bytes[1] == 0x9D ||
+        bytes[1] == 0x9F ||
+        bytes[1] == 0xA1 ||
+        bytes[1] == 0xA3 ||
+        bytes[1] == 0xA5 ||
+        bytes[1] == 0xA7 ||
+        bytes[1] == 0xA9 ||
+        bytes[1] == 0xAB ||
+        bytes[1] == 0xAD ||
+        ( 0xAF <= bytes[1] && bytes[1] <= 0xB3 ) ||
+        bytes[1] == 0xB5 ||
+        bytes[1] == 0xB8 ||
+        ( 0xBB <= bytes[1] && bytes[1] <= 0xBC )
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xD0 &&
+       (
+        ( 0xB0 <= bytes[1] && bytes[1] <= 0xBF )
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xD1 &&
+       (
+        ( 0x80 <= bytes[1] && bytes[1] <= 0x9F ) ||
+        bytes[1] == 0xA1 ||
+        bytes[1] == 0xA3 ||
+        bytes[1] == 0xA5 ||
+        bytes[1] == 0xA7 ||
+        bytes[1] == 0xA9 ||
+        bytes[1] == 0xAB ||
+        bytes[1] == 0xAD ||
+        bytes[1] == 0xAF ||
+        bytes[1] == 0xB1 ||
+        bytes[1] == 0xB3 ||
+        bytes[1] == 0xB5 ||
+        bytes[1] == 0xB7 ||
+        bytes[1] == 0xB9 ||
+        bytes[1] == 0xBB ||
+        bytes[1] == 0xBD ||
+        bytes[1] == 0xBF
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xD2 &&
+       (
+        bytes[1] == 0x81 ||
+        bytes[1] == 0x8B ||
+        bytes[1] == 0x8D ||
+        bytes[1] == 0x8F ||
+        bytes[1] == 0x91 ||
+        bytes[1] == 0x93 ||
+        bytes[1] == 0x95 ||
+        bytes[1] == 0x97 ||
+        bytes[1] == 0x99 ||
+        bytes[1] == 0x9B ||
+        bytes[1] == 0x9D ||
+        bytes[1] == 0x9F ||
+        bytes[1] == 0xA1 ||
+        bytes[1] == 0xA3 ||
+        bytes[1] == 0xA5 ||
+        bytes[1] == 0xA7 ||
+        bytes[1] == 0xA9 ||
+        bytes[1] == 0xAB ||
+        bytes[1] == 0xAD ||
+        bytes[1] == 0xAF ||
+        bytes[1] == 0xB1 ||
+        bytes[1] == 0xB3 ||
+        bytes[1] == 0xB5 ||
+        bytes[1] == 0xB7 ||
+        bytes[1] == 0xB9 ||
+        bytes[1] == 0xBB ||
+        bytes[1] == 0xBD ||
+        bytes[1] == 0xBF
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xD3 &&
+       (
+        bytes[1] == 0x82 ||
+        bytes[1] == 0x84 ||
+        bytes[1] == 0x86 ||
+        bytes[1] == 0x88 ||
+        bytes[1] == 0x8A ||
+        bytes[1] == 0x8C ||
+        ( 0x8E <= bytes[1] && bytes[1] <= 0x8F ) ||
+        bytes[1] == 0x91 ||
+        bytes[1] == 0x93 ||
+        bytes[1] == 0x95 ||
+        bytes[1] == 0x97 ||
+        bytes[1] == 0x99 ||
+        bytes[1] == 0x9B ||
+        bytes[1] == 0x9D ||
+        bytes[1] == 0x9F ||
+        bytes[1] == 0xA1 ||
+        bytes[1] == 0xA3 ||
+        bytes[1] == 0xA5 ||
+        bytes[1] == 0xA7 ||
+        bytes[1] == 0xA9 ||
+        bytes[1] == 0xAB ||
+        bytes[1] == 0xAD ||
+        bytes[1] == 0xAF ||
+        bytes[1] == 0xB1 ||
+        bytes[1] == 0xB3 ||
+        bytes[1] == 0xB5 ||
+        bytes[1] == 0xB7 ||
+        bytes[1] == 0xB9 ||
+        bytes[1] == 0xBB ||
+        bytes[1] == 0xBD ||
+        bytes[1] == 0xBF
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xD4 &&
+       (
+        bytes[1] == 0x81 ||
+        bytes[1] == 0x83 ||
+        bytes[1] == 0x85 ||
+        bytes[1] == 0x87 ||
+        bytes[1] == 0x89 ||
+        bytes[1] == 0x8B ||
+        bytes[1] == 0x8D ||
+        bytes[1] == 0x8F ||
+        bytes[1] == 0x91 ||
+        bytes[1] == 0x93 ||
+        bytes[1] == 0x95 ||
+        bytes[1] == 0x97 ||
+        bytes[1] == 0x99 ||
+        bytes[1] == 0x9B ||
+        bytes[1] == 0x9D ||
+        bytes[1] == 0x9F ||
+        bytes[1] == 0xA1 ||
+        bytes[1] == 0xA3 ||
+        bytes[1] == 0xA5 ||
+        bytes[1] == 0xA7
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xD5 &&
+       (
+        ( 0xA1 <= bytes[1] && bytes[1] <= 0xBF )
+        )
+
+       ) ||
+      (
+       bytes[0] == 0xD6 &&
+       (
+        ( 0x80 <= bytes[1] && bytes[1] <= 0x87 )
+        )
+
+       )
+      ) { return 1; }
+  if (
+      (
+       bytes[0] == 0xE1 &&
+       (
+        bytes[1] == 0xB4 &&
+        (
+         ( 0x80 <= bytes[2] && bytes[2] <= 0xAB )
+         )
+        ) ||
+       (
+        bytes[1] == 0xB5 &&
+        (
+         ( 0xAB <= bytes[2] && bytes[2] <= 0xB7 ) ||
+         ( 0xB9 <= bytes[2] && bytes[2] <= 0xBF )
+         )
+        ) ||
+       (
+        bytes[1] == 0xB6 &&
+        (
+         ( 0x80 <= bytes[2] && bytes[2] <= 0x9A )
+         )
+        ) ||
+       (
+        bytes[1] == 0xB8 &&
+        (
+         bytes[2] == 0x81 ||
+         bytes[2] == 0x83 ||
+         bytes[2] == 0x85 ||
+         bytes[2] == 0x87 ||
+         bytes[2] == 0x89 ||
+         bytes[2] == 0x8B ||
+         bytes[2] == 0x8D ||
+         bytes[2] == 0x8F ||
+         bytes[2] == 0x91 ||
+         bytes[2] == 0x93 ||
+         bytes[2] == 0x95 ||
+         bytes[2] == 0x97 ||
+         bytes[2] == 0x99 ||
+         bytes[2] == 0x9B ||
+         bytes[2] == 0x9D ||
+         bytes[2] == 0x9F ||
+         bytes[2] == 0xA1 ||
+         bytes[2] == 0xA3 ||
+         bytes[2] == 0xA5 ||
+         bytes[2] == 0xA7 ||
+         bytes[2] == 0xA9 ||
+         bytes[2] == 0xAB ||
+         bytes[2] == 0xAD ||
+         bytes[2] == 0xAF ||
+         bytes[2] == 0xB1 ||
+         bytes[2] == 0xB3 ||
+         bytes[2] == 0xB5 ||
+         bytes[2] == 0xB7 ||
+         bytes[2] == 0xB9 ||
+         bytes[2] == 0xBB ||
+         bytes[2] == 0xBD ||
+         bytes[2] == 0xBF
+         )
+        ) ||
+       (
+        bytes[1] == 0xB9 &&
+        (
+         bytes[2] == 0x81 ||
+         bytes[2] == 0x83 ||
+         bytes[2] == 0x85 ||
+         bytes[2] == 0x87 ||
+         bytes[2] == 0x89 ||
+         bytes[2] == 0x8B ||
+         bytes[2] == 0x8D ||
+         bytes[2] == 0x8F ||
+         bytes[2] == 0x91 ||
+         bytes[2] == 0x93 ||
+         bytes[2] == 0x95 ||
+         bytes[2] == 0x97 ||
+         bytes[2] == 0x99 ||
+         bytes[2] == 0x9B ||
+         bytes[2] == 0x9D ||
+         bytes[2] == 0x9F ||
+         bytes[2] == 0xA1 ||
+         bytes[2] == 0xA3 ||
+         bytes[2] == 0xA5 ||
+         bytes[2] == 0xA7 ||
+         bytes[2] == 0xA9 ||
+         bytes[2] == 0xAB ||
+         bytes[2] == 0xAD ||
+         bytes[2] == 0xAF ||
+         bytes[2] == 0xB1 ||
+         bytes[2] == 0xB3 ||
+         bytes[2] == 0xB5 ||
+         bytes[2] == 0xB7 ||
+         bytes[2] == 0xB9 ||
+         bytes[2] == 0xBB ||
+         bytes[2] == 0xBD ||
+         bytes[2] == 0xBF
+         )
+        ) ||
+       (
+        bytes[1] == 0xBA &&
+        (
+         bytes[2] == 0x81 ||
+         bytes[2] == 0x83 ||
+         bytes[2] == 0x85 ||
+         bytes[2] == 0x87 ||
+         bytes[2] == 0x89 ||
+         bytes[2] == 0x8B ||
+         bytes[2] == 0x8D ||
+         bytes[2] == 0x8F ||
+         bytes[2] == 0x91 ||
+         bytes[2] == 0x93 ||
+         ( 0x95 <= bytes[2] && bytes[2] <= 0x9D ) ||
+         bytes[2] == 0x9F ||
+         bytes[2] == 0xA1 ||
+         bytes[2] == 0xA3 ||
+         bytes[2] == 0xA5 ||
+         bytes[2] == 0xA7 ||
+         bytes[2] == 0xA9 ||
+         bytes[2] == 0xAB ||
+         bytes[2] == 0xAD ||
+         bytes[2] == 0xAF ||
+         bytes[2] == 0xB1 ||
+         bytes[2] == 0xB3 ||
+         bytes[2] == 0xB5 ||
+         bytes[2] == 0xB7 ||
+         bytes[2] == 0xB9 ||
+         bytes[2] == 0xBB ||
+         bytes[2] == 0xBD ||
+         bytes[2] == 0xBF
+         )
+        ) ||
+       (
+        bytes[1] == 0xBB &&
+        (
+         bytes[2] == 0x81 ||
+         bytes[2] == 0x83 ||
+         bytes[2] == 0x85 ||
+         bytes[2] == 0x87 ||
+         bytes[2] == 0x89 ||
+         bytes[2] == 0x8B ||
+         bytes[2] == 0x8D ||
+         bytes[2] == 0x8F ||
+         bytes[2] == 0x91 ||
+         bytes[2] == 0x93 ||
+         bytes[2] == 0x95 ||
+         bytes[2] == 0x97 ||
+         bytes[2] == 0x99 ||
+         bytes[2] == 0x9B ||
+         bytes[2] == 0x9D ||
+         bytes[2] == 0x9F ||
+         bytes[2] == 0xA1 ||
+         bytes[2] == 0xA3 ||
+         bytes[2] == 0xA5 ||
+         bytes[2] == 0xA7 ||
+         bytes[2] == 0xA9 ||
+         bytes[2] == 0xAB ||
+         bytes[2] == 0xAD ||
+         bytes[2] == 0xAF ||
+         bytes[2] == 0xB1 ||
+         bytes[2] == 0xB3 ||
+         bytes[2] == 0xB5 ||
+         bytes[2] == 0xB7 ||
+         bytes[2] == 0xB9 ||
+         bytes[2] == 0xBB ||
+         bytes[2] == 0xBD ||
+         bytes[2] == 0xBF
+         )
+        ) ||
+       (
+        bytes[1] == 0xBC &&
+        (
+         ( 0x80 <= bytes[2] && bytes[2] <= 0x87 ) ||
+         ( 0x90 <= bytes[2] && bytes[2] <= 0x95 ) ||
+         ( 0xA0 <= bytes[2] && bytes[2] <= 0xA7 ) ||
+         ( 0xB0 <= bytes[2] && bytes[2] <= 0xB7 )
+         )
+        ) ||
+       (
+        bytes[1] == 0xBD &&
+        (
+         ( 0x80 <= bytes[2] && bytes[2] <= 0x85 ) ||
+         ( 0x90 <= bytes[2] && bytes[2] <= 0x97 ) ||
+         ( 0xA0 <= bytes[2] && bytes[2] <= 0xA7 ) ||
+         ( 0xB0 <= bytes[2] && bytes[2] <= 0xBD )
+         )
+        ) ||
+       (
+        bytes[1] == 0xBE &&
+        (
+         ( 0x80 <= bytes[2] && bytes[2] <= 0x87 ) ||
+         ( 0x90 <= bytes[2] && bytes[2] <= 0x97 ) ||
+         ( 0xA0 <= bytes[2] && bytes[2] <= 0xA7 ) ||
+         ( 0xB0 <= bytes[2] && bytes[2] <= 0xB4 ) ||
+         ( 0xB6 <= bytes[2] && bytes[2] <= 0xB7 ) ||
+         bytes[2] == 0xBE
+         )
+        ) ||
+       (
+        bytes[1] == 0xBF &&
+        (
+         ( 0x82 <= bytes[2] && bytes[2] <= 0x84 ) ||
+         ( 0x86 <= bytes[2] && bytes[2] <= 0x87 ) ||
+         ( 0x90 <= bytes[2] && bytes[2] <= 0x93 ) ||
+         ( 0x96 <= bytes[2] && bytes[2] <= 0x97 ) ||
+         ( 0xA0 <= bytes[2] && bytes[2] <= 0xA7 ) ||
+         ( 0xB2 <= bytes[2] && bytes[2] <= 0xB4 ) ||
+         ( 0xB6 <= bytes[2] && bytes[2] <= 0xB7 )
+         )
+        )
+       ) ||
+      (
+       bytes[0] == 0xE2 &&
+       (
+        bytes[1] == 0x84 &&
+        (
+         bytes[2] == 0x8A ||
+         ( 0x8E <= bytes[2] && bytes[2] <= 0x8F ) ||
+         bytes[2] == 0x93 ||
+         bytes[2] == 0xAF ||
+         bytes[2] == 0xB4 ||
+         bytes[2] == 0xB9 ||
+         ( 0xBC <= bytes[2] && bytes[2] <= 0xBD )
+         )
+        ) ||
+       (
+        bytes[1] == 0x85 &&
+        (
+         ( 0x86 <= bytes[2] && bytes[2] <= 0x89 ) ||
+         bytes[2] == 0x8E
+         )
+        ) ||
+       (
+        bytes[1] == 0x86 &&
+        (
+         bytes[2] == 0x84
+         )
+        ) ||
+       (
+        bytes[1] == 0xB0 &&
+        (
+         ( 0xB0 <= bytes[2] && bytes[2] <= 0xBF )
+         )
+        ) ||
+       (
+        bytes[1] == 0xB1 &&
+        (
+         ( 0x80 <= bytes[2] && bytes[2] <= 0x9E ) ||
+         bytes[2] == 0xA1 ||
+         ( 0xA5 <= bytes[2] && bytes[2] <= 0xA6 ) ||
+         bytes[2] == 0xA8 ||
+         bytes[2] == 0xAA ||
+         bytes[2] == 0xAC ||
+         bytes[2] == 0xB1 ||
+         ( 0xB3 <= bytes[2] && bytes[2] <= 0xB4 ) ||
+         ( 0xB6 <= bytes[2] && bytes[2] <= 0xBB )
+         )
+        ) ||
+       (
+        bytes[1] == 0xB2 &&
+        (
+         bytes[2] == 0x81 ||
+         bytes[2] == 0x83 ||
+         bytes[2] == 0x85 ||
+         bytes[2] == 0x87 ||
+         bytes[2] == 0x89 ||
+         bytes[2] == 0x8B ||
+         bytes[2] == 0x8D ||
+         bytes[2] == 0x8F ||
+         bytes[2] == 0x91 ||
+         bytes[2] == 0x93 ||
+         bytes[2] == 0x95 ||
+         bytes[2] == 0x97 ||
+         bytes[2] == 0x99 ||
+         bytes[2] == 0x9B ||
+         bytes[2] == 0x9D ||
+         bytes[2] == 0x9F ||
+         bytes[2] == 0xA1 ||
+         bytes[2] == 0xA3 ||
+         bytes[2] == 0xA5 ||
+         bytes[2] == 0xA7 ||
+         bytes[2] == 0xA9 ||
+         bytes[2] == 0xAB ||
+         bytes[2] == 0xAD ||
+         bytes[2] == 0xAF ||
+         bytes[2] == 0xB1 ||
+         bytes[2] == 0xB3 ||
+         bytes[2] == 0xB5 ||
+         bytes[2] == 0xB7 ||
+         bytes[2] == 0xB9 ||
+         bytes[2] == 0xBB ||
+         bytes[2] == 0xBD ||
+         bytes[2] == 0xBF
+         )
+        ) ||
+       (
+        bytes[1] == 0xB3 &&
+        (
+         bytes[2] == 0x81 ||
+         bytes[2] == 0x83 ||
+         bytes[2] == 0x85 ||
+         bytes[2] == 0x87 ||
+         bytes[2] == 0x89 ||
+         bytes[2] == 0x8B ||
+         bytes[2] == 0x8D ||
+         bytes[2] == 0x8F ||
+         bytes[2] == 0x91 ||
+         bytes[2] == 0x93 ||
+         bytes[2] == 0x95 ||
+         bytes[2] == 0x97 ||
+         bytes[2] == 0x99 ||
+         bytes[2] == 0x9B ||
+         bytes[2] == 0x9D ||
+         bytes[2] == 0x9F ||
+         bytes[2] == 0xA1 ||
+         ( 0xA3 <= bytes[2] && bytes[2] <= 0xA4 ) ||
+         bytes[2] == 0xAC ||
+         bytes[2] == 0xAE ||
+         bytes[2] == 0xB3
+         )
+        ) ||
+       (
+        bytes[1] == 0xB4 &&
+        (
+         ( 0x80 <= bytes[2] && bytes[2] <= 0xA5 ) ||
+         bytes[2] == 0xA7 ||
+         bytes[2] == 0xAD
+         )
+        )
+       ) ||
+      (
+       bytes[0] == 0xEA &&
+       (
+        bytes[1] == 0x99 &&
+        (
+         bytes[2] == 0x81 ||
+         bytes[2] == 0x83 ||
+         bytes[2] == 0x85 ||
+         bytes[2] == 0x87 ||
+         bytes[2] == 0x89 ||
+         bytes[2] == 0x8B ||
+         bytes[2] == 0x8D ||
+         bytes[2] == 0x8F ||
+         bytes[2] == 0x91 ||
+         bytes[2] == 0x93 ||
+         bytes[2] == 0x95 ||
+         bytes[2] == 0x97 ||
+         bytes[2] == 0x99 ||
+         bytes[2] == 0x9B ||
+         bytes[2] == 0x9D ||
+         bytes[2] == 0x9F ||
+         bytes[2] == 0xA1 ||
+         bytes[2] == 0xA3 ||
+         bytes[2] == 0xA5 ||
+         bytes[2] == 0xA7 ||
+         bytes[2] == 0xA9 ||
+         bytes[2] == 0xAB ||
+         bytes[2] == 0xAD
+         )
+        ) ||
+       (
+        bytes[1] == 0x9A &&
+        (
+         bytes[2] == 0x81 ||
+         bytes[2] == 0x83 ||
+         bytes[2] == 0x85 ||
+         bytes[2] == 0x87 ||
+         bytes[2] == 0x89 ||
+         bytes[2] == 0x8B ||
+         bytes[2] == 0x8D ||
+         bytes[2] == 0x8F ||
+         bytes[2] == 0x91 ||
+         bytes[2] == 0x93 ||
+         bytes[2] == 0x95 ||
+         bytes[2] == 0x97
+         )
+        ) ||
+       (
+        bytes[1] == 0x9C &&
+        (
+         bytes[2] == 0xA3 ||
+         bytes[2] == 0xA5 ||
+         bytes[2] == 0xA7 ||
+         bytes[2] == 0xA9 ||
+         bytes[2] == 0xAB ||
+         bytes[2] == 0xAD ||
+         ( 0xAF <= bytes[2] && bytes[2] <= 0xB1 ) ||
+         bytes[2] == 0xB3 ||
+         bytes[2] == 0xB5 ||
+         bytes[2] == 0xB7 ||
+         bytes[2] == 0xB9 ||
+         bytes[2] == 0xBB ||
+         bytes[2] == 0xBD ||
+         bytes[2] == 0xBF
+         )
+        ) ||
+       (
+        bytes[1] == 0x9D &&
+        (
+         bytes[2] == 0x81 ||
+         bytes[2] == 0x83 ||
+         bytes[2] == 0x85 ||
+         bytes[2] == 0x87 ||
+         bytes[2] == 0x89 ||
+         bytes[2] == 0x8B ||
+         bytes[2] == 0x8D ||
+         bytes[2] == 0x8F ||
+         bytes[2] == 0x91 ||
+         bytes[2] == 0x93 ||
+         bytes[2] == 0x95 ||
+         bytes[2] == 0x97 ||
+         bytes[2] == 0x99 ||
+         bytes[2] == 0x9B ||
+         bytes[2] == 0x9D ||
+         bytes[2] == 0x9F ||
+         bytes[2] == 0xA1 ||
+         bytes[2] == 0xA3 ||
+         bytes[2] == 0xA5 ||
+         bytes[2] == 0xA7 ||
+         bytes[2] == 0xA9 ||
+         bytes[2] == 0xAB ||
+         bytes[2] == 0xAD ||
+         bytes[2] == 0xAF ||
+         ( 0xB1 <= bytes[2] && bytes[2] <= 0xB8 ) ||
+         bytes[2] == 0xBA ||
+         bytes[2] == 0xBC ||
+         bytes[2] == 0xBF
+         )
+        ) ||
+       (
+        bytes[1] == 0x9E &&
+        (
+         bytes[2] == 0x81 ||
+         bytes[2] == 0x83 ||
+         bytes[2] == 0x85 ||
+         bytes[2] == 0x87 ||
+         bytes[2] == 0x8C ||
+         bytes[2] == 0x8E ||
+         bytes[2] == 0x91 ||
+         bytes[2] == 0x93 ||
+         bytes[2] == 0xA1 ||
+         bytes[2] == 0xA3 ||
+         bytes[2] == 0xA5 ||
+         bytes[2] == 0xA7 ||
+         bytes[2] == 0xA9
+         )
+        ) ||
+       (
+        bytes[1] == 0x9F &&
+        (
+         bytes[2] == 0xBA
+         )
+        )
+       ) ||
+      (
+       bytes[0] == 0xEF &&
+       (
+        bytes[1] == 0xAC &&
+        (
+         ( 0x80 <= bytes[2] && bytes[2] <= 0x86 ) ||
+         ( 0x93 <= bytes[2] && bytes[2] <= 0x97 )
+         )
+        ) ||
+       (
+        bytes[1] == 0xBD &&
+        (
+         ( 0x81 <= bytes[2] && bytes[2] <= 0x9A )
+         )
+        )
+       )
+      ) { return 1; }
+  if (
+      (
+       bytes[0] == 0xF0 &&
+       (
+        bytes[1] == 0x90 &&
+        (
+         bytes[2] == 0x90 &&
+         (
+          ( 0xA8 <= bytes[3] && bytes[3] <= 0xBF )
+          )
+         ) ||
+        (
+         bytes[2] == 0x91 &&
+         (
+          ( 0x80 <= bytes[3] && bytes[3] <= 0x8F )
+          )
+         )
+        ) ||
+       (
+        bytes[1] == 0x9D &&
+        (
+         bytes[2] == 0x90 &&
+         (
+          ( 0x9A <= bytes[3] && bytes[3] <= 0xB3 )
+          )
+         ) ||
+        (
+         bytes[2] == 0x91 &&
+         (
+          ( 0x8E <= bytes[3] && bytes[3] <= 0x94 ) ||
+          ( 0x96 <= bytes[3] && bytes[3] <= 0xA7 )
+          )
+         ) ||
+        (
+         bytes[2] == 0x92 &&
+         (
+          ( 0x82 <= bytes[3] && bytes[3] <= 0x9B ) ||
+          ( 0xB6 <= bytes[3] && bytes[3] <= 0xB9 ) ||
+          bytes[3] == 0xBB ||
+          ( 0xBD <= bytes[3] && bytes[3] <= 0xBF )
+          )
+         ) ||
+        (
+         bytes[2] == 0x93 &&
+         (
+          ( 0x80 <= bytes[3] && bytes[3] <= 0x83 ) ||
+          ( 0x85 <= bytes[3] && bytes[3] <= 0x8F ) ||
+          ( 0xAA <= bytes[3] && bytes[3] <= 0xBF )
+          )
+         ) ||
+        (
+         bytes[2] == 0x94 &&
+         (
+          ( 0x80 <= bytes[3] && bytes[3] <= 0x83 ) ||
+          ( 0x9E <= bytes[3] && bytes[3] <= 0xB7 )
+          )
+         ) ||
+        (
+         bytes[2] == 0x95 &&
+         (
+          ( 0x92 <= bytes[3] && bytes[3] <= 0xAB )
+          )
+         ) ||
+        (
+         bytes[2] == 0x96 &&
+         (
+          ( 0x86 <= bytes[3] && bytes[3] <= 0x9F ) ||
+          ( 0xBA <= bytes[3] && bytes[3] <= 0xBF )
+          )
+         ) ||
+        (
+         bytes[2] == 0x97 &&
+         (
+          ( 0x80 <= bytes[3] && bytes[3] <= 0x93 ) ||
+          ( 0xAE <= bytes[3] && bytes[3] <= 0xBF )
+          )
+         ) ||
+        (
+         bytes[2] == 0x98 &&
+         (
+          ( 0x80 <= bytes[3] && bytes[3] <= 0x87 ) ||
+          ( 0xA2 <= bytes[3] && bytes[3] <= 0xBB )
+          )
+         ) ||
+        (
+         bytes[2] == 0x99 &&
+         (
+          ( 0x96 <= bytes[3] && bytes[3] <= 0xAF )
+          )
+         ) ||
+        (
+         bytes[2] == 0x9A &&
+         (
+          ( 0x8A <= bytes[3] && bytes[3] <= 0xA5 )
+          )
+         ) ||
+        (
+         bytes[2] == 0x9B &&
+         (
+          ( 0x82 <= bytes[3] && bytes[3] <= 0x9A ) ||
+          ( 0x9C <= bytes[3] && bytes[3] <= 0xA1 ) ||
+          ( 0xBC <= bytes[3] && bytes[3] <= 0xBF )
+          )
+         ) ||
+        (
+         bytes[2] == 0x9C &&
+         (
+          ( 0x80 <= bytes[3] && bytes[3] <= 0x94 ) ||
+          ( 0x96 <= bytes[3] && bytes[3] <= 0x9B ) ||
+          ( 0xB6 <= bytes[3] && bytes[3] <= 0xBF )
+          )
+         ) ||
+        (
+         bytes[2] == 0x9D &&
+         (
+          ( 0x80 <= bytes[3] && bytes[3] <= 0x8E ) ||
+          ( 0x90 <= bytes[3] && bytes[3] <= 0x95 ) ||
+          ( 0xB0 <= bytes[3] && bytes[3] <= 0xBF )
+          )
+         ) ||
+        (
+         bytes[2] == 0x9E &&
+         (
+          ( 0x80 <= bytes[3] && bytes[3] <= 0x88 ) ||
+          ( 0x8A <= bytes[3] && bytes[3] <= 0x8F ) ||
+          ( 0xAA <= bytes[3] && bytes[3] <= 0xBF )
+          )
+         ) ||
+        (
+         bytes[2] == 0x9F &&
+         (
+          ( 0x80 <= bytes[3] && bytes[3] <= 0x82 ) ||
+          ( 0x84 <= bytes[3] && bytes[3] <= 0x89 ) ||
+          bytes[3] == 0x8B
+          )
+         )
+        )
+       )
+      ) { return 1; }
+
+
+  return 0; // no lowercase character
+} /* isulower */
+
@@ -109,8 +109,9 @@ BibTeX 0.99-style bibliography databases.)
 
 package Text::BibTeX::BibStructure;
 use strict;
-use vars qw(@ISA);
+use vars qw(@ISA $VERSION);
 @ISA = qw(Text::BibTeX::Structure);
+$VERSION = '0.1';
 
 =head1 STRUCTURE OPTIONS
 
@@ -447,7 +448,9 @@ L<Text::BibTeX::BibFormat> for details on these two methods.
 
 package Text::BibTeX::BibEntry;
 use strict;
-use vars qw(@ISA);
+use vars qw(@ISA $VERSION);
+
+$VERSION = '0.1';
 
 use Text::BibTeX::BibSort;
 use Text::BibTeX::BibFormat;
@@ -26,7 +26,7 @@ use Text::BibTeX::NameFormat;
 use Text::BibTeX::Structure;
 
 @ISA = qw(Text::BibTeX::StructuredEntry);
-$VERSION = 0;
+$VERSION = 0.1;
 
 use Text::BibTeX qw(:subs display_list :nameparts :joinmethods);
 
@@ -23,7 +23,7 @@ use vars qw(@ISA $VERSION);
 use Text::BibTeX::Structure;
 
 @ISA = qw(Text::BibTeX::StructuredEntry);
-$VERSION = 0;
+$VERSION = 0.1;
 
 use Text::BibTeX qw(purify_string change_case);
 
@@ -23,7 +23,7 @@ use vars qw'$VERSION';
 use Carp;
 use Text::BibTeX qw(:metatypes :nodetypes);
 
-$VERSION = 0;
+$VERSION = 0.1;
 
 =head1 NAME
 
@@ -22,7 +22,7 @@ use Carp;
 use IO::File;
 
 use vars qw'$VERSION';
-$VERSION = 0;
+$VERSION = 0.1;
 
 =head1 NAME
 
@@ -23,7 +23,7 @@ require 5.004;
 use strict;
 use Carp;
 use vars qw'$VERSION';
-$VERSION = 0;
+$VERSION = 0.1;
 
 use Text::BibTeX;
 
@@ -23,7 +23,7 @@ require 5.004;
 use strict;
 use Carp;
 use vars qw'$VERSION';
-$VERSION = 0;
+$VERSION = 0.1;
 
 =head1 NAME
 
@@ -24,7 +24,7 @@ use strict;
 use Carp;
 
 use vars qw'$VERSION';
-$VERSION = 0;
+$VERSION = 0.1;
 
 use Text::BibTeX ('check_class');
 
@@ -22,7 +22,7 @@ use UNIVERSAL 'isa';
 use Carp;
 
 use vars qw'$VERSION';
-$VERSION = 0;
+$VERSION = 0.1;
 
 =head1 NAME
 
@@ -244,6 +244,10 @@ use strict;
 use Carp;
 use Text::BibTeX qw(:nodetypes);
 
+use vars qw($VERSION);
+$VERSION = '0.1';
+
+
 =head2 Text::BibTeX::SimpleValue methods
 
 =over
@@ -24,7 +24,7 @@ use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
 require Exporter;
 require DynaLoader;
 
-our $VERSION='0.67';
+our $VERSION='0.69';
 
 @ISA = qw(Exporter DynaLoader);
 %EXPORT_TAGS = (nodetypes => [qw(BTAST_STRING BTAST_MACRO BTAST_NUMBER)],
@@ -95,8 +95,7 @@ $DEBUG = 1;
     is $format7->apply($name7), 'S.~J.';
 }
 
-TODO: {
-    local $TODO = "Check why this fails on some machines";
+{
     # test 11... to 16
     my $name8     = Text::BibTeX::Name->new('Šomeone Smith');
     my $formatter = Text::BibTeX::NameFormat->new('f', 1);
@@ -104,8 +103,7 @@ TODO: {
 
     my $name9   = Text::BibTeX::Name->new('Šomeone-Šomething Smith');
     is decode_utf8($formatter->apply($name9)), 'Š.-Š.';
-}
-{
+
     my $formatter = Text::BibTeX::NameFormat->new('f', 1);
     my $name10   = Text::BibTeX::Name->new('{Šomeone-Šomething} Smith');
     is decode_utf8($formatter->apply($name10)), 'Š.';
@@ -2,11 +2,14 @@
 use strict;
 use warnings;
 use vars qw($DEBUG);
+use Encode;
 use IO::Handle;
-use Test::More tests => 56;
+use Test::More tests => 62;
+use utf8;
 
 BEGIN {
     use_ok("Text::BibTeX");
+    use_ok("Text::BibTeX::Name");
     require "t/common.pl";
 }
 
@@ -36,8 +39,8 @@ sub test_name {
 # ----------------------------------------------------------------------
 # processing of author names
 
-my (@names, @pnames, %names, @orig_namelist, $namelist, @namelist);
-my ($text, $entry, $pentry);
+my (@names, @unames, @pnames, %names, @orig_namelist, $namelist, @namelist);
+my ($text, $entry, $pentry, $uentry);
 
 # first just a big ol' list of names, not attached to any entry
 %names =
@@ -95,6 +98,15 @@ my $protected_test = <<'PROT';
 }
 PROT
 
+my $uname = new Text::BibTeX::Name('фон дер Иванов, И. И.');
+is (decode_utf8(join('', $uname->part('last'))), 'Иванов');
+is (decode_utf8(join('', $uname->part('first'))), 'И.И.');
+is (decode_utf8(join(' ', $uname->part('von'))), 'фон дер');# 2-byte UTF-8 lowercase
+$uname = new Text::BibTeX::Name('ꝥaa Smith, John');
+is (decode_utf8(join('', $uname->part('von'))), 'ꝥaa');# 3-byte UTF-8 lowercase (U+A765)
+$uname = new Text::BibTeX::Name('𝓺aa Smith, John');
+is (decode_utf8(join('', $uname->part('von'))), '𝓺aa');# 4-byte UTF-8 lowercase (U+1D4FA)
+
 ok ($pentry = new Text::BibTeX::Entry $protected_test);
 my $pauthor = $pentry->get ('author');
 is ($pauthor, '{U.S. Department of Health and Human Services, National Institute of Mental Health, National Heart, Lung and Blood Institute}');