Coder Social home page Coder Social logo

non-ascii file name regression about latex2e HOT 9 CLOSED

latex3 avatar latex3 commented on May 9, 2024
non-ascii file name regression

from latex2e.

Comments (9)

davidcarlisle avatar davidcarlisle commented on May 9, 2024 1

@aminophen yes I'm actually currently running some tests with ltfinal changed as

%    \begin{macrocode}
\edef\inputencodingname{utf8}%
\input{utf8.def}
\let\UTFviii@two@octets@@\UTFviii@two@octets
\long\def\UTFviii@two@octets#1#2{\string#1\string#2}
\everyjob\expandafter{\the\everyjob
\let\UTFviii@two@octets\UTFviii@two@octets@@
}
\let\@inpenc@test\@undefined
\let\saved@space@catcode\@undefined
%    \end{macrocode}

would need the longer cases as well, not just the two byte of course. delaying the catcode activation until everyjob would work on the commandline but if we can make it work without that it may give a path to accepting utf8 filenames more generally in the document (which did not work in previous releases after inputenc was loaded)

from latex2e.

aminophen avatar aminophen commented on May 9, 2024

Already reported by me and \detokenize should be used to avoid that (from #24 (comment))

from latex2e.

josephwright avatar josephwright commented on May 9, 2024

@aminophen Not quite that simple ... but I have to say I'm surprised that the binaries treat the file name argument at the TeX level (it's not \input tést, after all).

from latex2e.

josephwright avatar josephwright commented on May 9, 2024

Something like pdflatex \input\detokenize{tést}\relax works, but that's not ideal.

from latex2e.

aminophen avatar aminophen commented on May 9, 2024

the binaries treat the file name argument at the TeX level

Any arguments to *tex is treated as TeX code;-) When the first token is a character, *tex treats it as if \input is prefixed; when the first token is a control sequence, \input is not prefixed.

from latex2e.

josephwright avatar josephwright commented on May 9, 2024

@aminophen I have to say I've always imagined the logic differently :) 'If the first char is the escape char, treat as TeX code, otherwise read as a filename'

from latex2e.

davidcarlisle avatar davidcarlisle commented on May 9, 2024

from latex2e.

aminophen avatar aminophen commented on May 9, 2024

Delaying utf8.def etc. to \everyjob might be an only solution to this (not tested well for all engines, and if so I will have to adjust platex as well)

(edit: it will change a log filename opened by $pdflatex \\relax to utf8.log instead of texput.log)

--- latex.ltx.orig	2018-04-07 06:33:45.000000000 +0900
+++ latex.ltx	2018-04-08 19:15:09.000000000 +0900
@@ -8641,12 +8641,6 @@
 \catcode10=12 % ctrl J
 \catcode12=13 % ctrl L
 \catcode13=5  % newline
-\@tempcnta=128
-\loop
-  \catcode\@tempcnta=13
-  \advance\@tempcnta\@ne
-\ifnum\@tempcnta<256
-\repeat
 \def\UseRawInputEncoding{%
 \let\DeclareFontEncoding@\DeclareFontEncoding@saved   % revert
 \let\DeclareUnicodeCharacter\@undefined               % revert
@@ -8669,10 +8663,6 @@
 \repeat
 }
 \let\DeclareFontEncoding@saved\DeclareFontEncoding@
-\edef\inputencodingname{utf8}%
-\input{utf8.def}
-\let\@inpenc@test\@undefined
-\let\saved@space@catcode\@undefined
 \else
 \@tempcnta=0
 \loop
@@ -8793,6 +8783,18 @@
   \endgroup}
 \let\@filelist\@gobble
 \def\@addtofilelist#1{\xdef\@filelist{\@filelist,#1}}%
+\everyjob\expandafter{\the\everyjob
+\@tempcnta=128
+\loop
+  \catcode\@tempcnta=13
+  \advance\@tempcnta\@ne
+\ifnum\@tempcnta<256
+\repeat
+\edef\inputencodingname{utf8}%
+\input{utf8.def}
+\let\@inpenc@test\@undefined
+\let\saved@space@catcode\@undefined
+}
 \makeatother
 \errorstopmode
 \dump

from latex2e.

aminophen avatar aminophen commented on May 9, 2024

724013b works as expected for pdfLaTeX; I commited a support for that change in pLaTeX texjporg/platex@8b6c518 and it’s ok on both pLaTeX and upLaTeX. I’ll upload the new version of pLaTeX, when LaTeX is ready.

from latex2e.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.