Skip to content

Commit

Permalink
load stringenc always
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed May 23, 2024
1 parent 40bdb0c commit 1caf094
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 44 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2024-05-25 Ulrike Fischer
* hyperref.dtx: load stringenc always to allow the use of pdfencoding in a group.

2024-05-22 Ulrike Fischer
* hyperref.dtx: add \@makeother{:} to \hyper@normalise, issue #340

Expand Down
67 changes: 23 additions & 44 deletions hyperref.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@
% change 2021-08-14: require expl3
% change 2023-11-26: no longer require pdftexcmds
% change 2023-11-26: no longer require expl3, we assume kernel is new enough.
% change 2024-05-23: load stringenc always (for pdfx)
% \begin{macrocode}
\RequirePackage{iftex}[2019/10/24]
\RequirePackage{keyval}[1997/11/10]
Expand All @@ -603,6 +604,7 @@
\RequirePackage{hycolor}
\RequirePackage{nameref}[2012/07/28]
\RequirePackage{etoolbox}
\RequirePackage{stringenc}[2009/12/15]%
\def\Hy@Error{\PackageError{hyperref}}
\def\Hy@Warning{\PackageWarning{hyperref}}
\def\Hy@WarningNoLine{\PackageWarningNoLine{hyperref}}
Expand Down Expand Up @@ -1863,30 +1865,27 @@
%
% \begin{macrocode}
\ifx\HyPsd@pdfencoding\HyPsd@pdfencoding@auto
\@ifundefined{StringEncodingConvertTest}{%
}{%
\EdefUnescapeString\HyPsd@temp#1%
\iftutex
\let\HyPsd@UnescapedString\HyPsd@temp
\StringEncodingConvertTest\HyPsd@temp\HyPsd@temp
{utf16be}{ascii-print}{%
\EdefEscapeString\HyPsd@temp\HyPsd@temp
\global\let#1\HyPsd@temp
\HyPsd@EscapeTeX#1%
\Hy@unicodefalse
}{%
\HyPsd@EscapeTeX#1%
}%
\else
\StringEncodingConvertTest\HyPsd@temp\HyPsd@temp
{utf16be}{pdfdoc}{%
\EdefEscapeString\HyPsd@temp\HyPsd@temp
\global\let#1\HyPsd@temp
\HyPsd@EscapeTeX#1%
\Hy@unicodefalse
}{}%
\fi
}%
\EdefUnescapeString\HyPsd@temp#1%
\iftutex
\let\HyPsd@UnescapedString\HyPsd@temp
\StringEncodingConvertTest\HyPsd@temp\HyPsd@temp
{utf16be}{ascii-print}{%
\EdefEscapeString\HyPsd@temp\HyPsd@temp
\global\let#1\HyPsd@temp
\HyPsd@EscapeTeX#1%
\Hy@unicodefalse
}{%
\HyPsd@EscapeTeX#1%
}%
\else
\StringEncodingConvertTest\HyPsd@temp\HyPsd@temp
{utf16be}{pdfdoc}{%
\EdefEscapeString\HyPsd@temp\HyPsd@temp
\global\let#1\HyPsd@temp
\HyPsd@EscapeTeX#1%
\Hy@unicodefalse
}{}%
\fi
\fi
\fi
% \end{macrocode}
Expand Down Expand Up @@ -4818,9 +4817,6 @@
\hypersetup{unicode}%
\ifHy@unicode
\def\HyPsd@pdfencoding{#1}%
\ifx\HyPsd@pdfencoding\HyPsd@pdfencoding@auto
\HyPsd@LoadStringEnc
\fi
\else
\Hy@Warning{Cannot switch to unicode bookmarks}%
\let\HyPsd@pdfencoding\HyPsd@pdfencoding@pdfdoc
Expand All @@ -4843,22 +4839,6 @@
% \begin{macrocode}
\let\HyPsd@pdfencoding\HyPsd@pdfencoding@unicode
\HyPsd@LoadUnicode
\def\HyPsd@LoadStringEnc{%
\RequirePackage{stringenc}[2009/12/15]%
\let\HyPsd@LoadStringEnc\relax
}
\Hy@AtBeginDocument{%
\@ifpackageloaded{stringenc}{%
\let\HyPsd@LoadStringEnc\relax
}{%
\def\HyPsd@LoadStringEnc{%
\Hy@WarningNoLine{%
Missing package `stringenc'. Use `pdfencoding=auto'\MessageBreak
in the preamble or load the package there%
}%
}%
}%
}
% \end{macrocode}
%
% \begin{macrocode}
Expand Down Expand Up @@ -10120,7 +10100,6 @@
\else
\let\HyPsd@pdfencoding\HyPsd@pdfencoding@auto
\fi
\HyPsd@LoadStringEnc
\define@key{Hyp}{unicode}[true]{%
\Hy@boolkey{unicode}{#1}%
\ifHy@unicode
Expand Down

0 comments on commit 1caf094

Please sign in to comment.