From 929d8005a93b27f29b4ed481f31d62f92f67d28b Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sat, 19 Dec 2009 23:10:16 +0000
Subject: hyperref update (19dec09)

git-svn-id: svn://tug.org/texlive/trunk@16451 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/hyperref/hyperref.sty | 109 +++++++++++++++++++++-
 1 file changed, 107 insertions(+), 2 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/hyperref/hyperref.sty')

diff --git a/Master/texmf-dist/tex/latex/hyperref/hyperref.sty b/Master/texmf-dist/tex/latex/hyperref/hyperref.sty
index da9b80b7afc..f63ae3c99b3 100644
--- a/Master/texmf-dist/tex/latex/hyperref/hyperref.sty
+++ b/Master/texmf-dist/tex/latex/hyperref/hyperref.sty
@@ -25,7 +25,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{hyperref}
-  [2009/12/16 v6.79u
+  [2009/12/17 v6.79v
   Hypertext links for LaTeX]
 \begingroup
   \@makeother\`%
@@ -480,17 +480,27 @@
         }{%
           \EdefUnescapeString\HyPsd@temp#1%
           \ifxetex
+            \let\HyPsd@UnescapedString\HyPsd@temp
             \StringEncodingConvertTest\HyPsd@temp\HyPsd@temp
                                       {utf16be}{ascii-print}{%
               \EdefEscapeString\HyPsd@temp\HyPsd@temp
               \global\let#1\HyPsd@temp
               \Hy@unicodefalse
-            }{}%
+            }{%
+              \HyPsd@ToBigChars#1%
+            }%
           \else
+            \StringEncodingConvertTest\HyPsd@temp\HyPsd@temp
+                                      {utf16be}{pdfdoc}{%
+              \EdefEscapeString\HyPsd@temp\HyPsd@temp
+              \global\let#1\HyPsd@temp
+              \Hy@unicodefalse
+            }{}%
           \fi
         }%
       \fi
     \fi
+    \HyPsd@XeTeXBigCharsfalse
     \pdfstringdefPostHook#1%
   \endgroup
 }
@@ -498,6 +508,95 @@
   \pdfstringdef\Hy@gtemp{#2}%
   \let#1\Hy@gtemp
 }
+\edef\Hy@temp{\catcode0=\the\catcode0\relax}
+\catcode\z@=12 %
+\ifxetex
+  \expandafter\@firstofone
+\else
+  \let\HyPsd@XeTeXBigCharstrue\@empty
+  \let\HyPsd@XeTeXBigCharsfalse\@empty
+  \expandafter\@gobble
+\fi
+{%
+  \newif\ifHyPsd@XeTeXBigChars
+  \def\HyPsd@XeTeXBigCharsfalse{%
+    \global\let\ifHyPsd@XeTeXBigChars\iffalse
+  }%
+  \def\HyPsd@XeTeXBigCharstrue{%
+    \global\let\ifHyPsd@XeTeXBigChars\iftrue
+  }%
+  \def\HyPsd@ToBigChars#1{%
+    \ifHyPsd@XeTeXBigChars
+      \EdefEscapeHex\HyPsd@UnescapedString{%
+        \expandafter\@gobbletwo\HyPsd@UnescapedString
+      }%
+      \begingroup
+        \toks@{}%
+        \lccode`0=`0\relax
+        \lccode`1=`1\relax
+        \lccode`2=`2\relax
+        \lccode`3=`3\relax
+        \lccode`4=`4\relax
+        \lccode`5=`5\relax
+        \lccode`6=`6\relax
+        \lccode`7=`7\relax
+        \lccode`8=`8\relax
+        \lccode`9=`9\relax
+        \lccode`A=`a\relax
+        \lccode`B=`b\relax
+        \lccode`C=`c\relax
+        \lccode`D=`d\relax
+        \lccode`E=`e\relax
+        \lccode`F=`f\relax
+        \escapechar=92\relax
+        \let\x\HyPsd@ToBigChar
+        \expandafter\HyPsd@ToBigChar\HyPsd@UnescapedString
+        \relax\relax\relax\relax\relax\relax\relax
+      \edef\x{%
+        \endgroup
+        \gdef\noexpand#1{\the\toks@}%
+      }%
+      \x
+    \fi
+  }%
+  \def\HyPsd@ToBigChar#1#2#3#4{%
+    \ifx\relax#1\relax
+      \let\x\relax
+    \else
+      \count@="#1#2#3#4\relax
+      \let\y\@empty
+      \lccode\z@=\count@
+      \ifnum\count@=40 % (
+        \let\y\@backslashchar
+      \else
+        \ifnum\count@=41 % )
+          \let\y\@backslashchar
+        \else
+          \ifnum\count@=92 % backslash
+            \let\y\@backslashchar
+          \else
+            \ifnum\count@=10 % newline
+              \edef\y##1{\string\n}%
+            \else
+              \ifnum\count@=13 % carriage return
+                \edef\y##1{\string\r}%
+              \fi
+            \fi
+          \fi
+        \fi
+      \fi
+      \lowercase{%
+        \toks@\expandafter{%
+          \the\expandafter\toks@
+          \y
+          ^^@%
+        }%
+      }%
+    \fi
+    \x
+  }%
+}
+\Hy@temp
 \@ifpackageloaded{linguex}{%
   \let\HyLinguex@OrgB\b
   \let\HyLinguex@OrgC\c
@@ -2791,18 +2890,22 @@
 }
 \define@key{Hyp}{pdftitle}{%
   \HyXeTeX@CheckUnicode
+  \HyPsd@XeTeXBigCharstrue
   \pdfstringdef\@pdftitle{#1}%
 }
 \define@key{Hyp}{pdfauthor}{%
   \HyXeTeX@CheckUnicode
+  \HyPsd@XeTeXBigCharstrue
   \pdfstringdef\@pdfauthor{#1}%
 }
 \define@key{Hyp}{pdfproducer}{%
   \HyXeTeX@CheckUnicode
+  \HyPsd@XeTeXBigCharstrue
   \pdfstringdef\@pdfproducer{#1}%
 }
 \define@key{Hyp}{pdfcreator}{%
   \HyXeTeX@CheckUnicode
+  \HyPsd@XeTeXBigCharstrue
   \pdfstringdef\@pdfcreator{#1}%
 }
 \define@key{Hyp}{pdfcreationdate}{%
@@ -2819,10 +2922,12 @@
 }
 \define@key{Hyp}{pdfsubject}{%
   \HyXeTeX@CheckUnicode
+  \HyPsd@XeTeXBigCharstrue
   \pdfstringdef\@pdfsubject{#1}%
 }
 \define@key{Hyp}{pdfkeywords}{%
   \HyXeTeX@CheckUnicode
+  \HyPsd@XeTeXBigCharstrue
   \pdfstringdef\@pdfkeywords{#1}%
 }
 \define@key{Hyp}{pdfview}{\calculate@pdfview#1 \\}
-- 
cgit v1.2.3

