summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorTakuji Tanaka <KXD02663@nifty.ne.jp>2018-06-10 06:12:41 +0000
committerTakuji Tanaka <KXD02663@nifty.ne.jp>2018-06-10 06:12:41 +0000
commit94f0b880cd88c2f9737d2f1c77cecbc88f195400 (patch)
tree2fa8c42d5608adf057eb862262f3638b026e75f7 /Build
parentb1b0a37f50014a4612d7c4e65cefad1a27ac6eff (diff)
pdfTeX: Allow non-ascii file names with UTF-8 source files (Windows only)
git-svn-id: svn://tug.org/texlive/trunk@47973 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog6
-rw-r--r--Build/source/texk/kpathsea/Makefile.am4
-rw-r--r--Build/source/texk/kpathsea/Makefile.in4
-rw-r--r--Build/source/texk/kpathsea/knj.h1
-rw-r--r--Build/source/texk/kpathsea/kpsewhich.c1
-rw-r--r--Build/source/texk/kpathsea/progname.c2
-rw-r--r--Build/source/texk/kpathsea/types.h2
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog5
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c10
-rw-r--r--Build/source/texk/web2c/pdftexdir/ChangeLog7
-rw-r--r--Build/source/texk/web2c/pdftexdir/pdftoepdf-newpoppler.cc9
-rw-r--r--Build/source/texk/web2c/pdftexdir/pdftoepdf.cc9
-rw-r--r--Build/source/texk/web2c/pdftexdir/ptexlib.h7
-rw-r--r--Build/source/texk/web2c/synctexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/synctexdir/synctex.c2
15 files changed, 62 insertions, 12 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 1a3112a8929..00a5b710094 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,9 @@
+2018-06-10 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * progname.c, types.h, knj.h: Add a variable W32_codepage.
+ * kpsewhich.c: Allow Unicode file name for pdftex in kpsewhich.
+ (Windows only)
+
2018-05-29 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* kpsewhich.c: Revert. Since "command_line_encoding=utf8" is
diff --git a/Build/source/texk/kpathsea/Makefile.am b/Build/source/texk/kpathsea/Makefile.am
index 67b4541d425..8179942bbd9 100644
--- a/Build/source/texk/kpathsea/Makefile.am
+++ b/Build/source/texk/kpathsea/Makefile.am
@@ -283,14 +283,14 @@ uninstall-local:
if !WIN32
@for f in $(dist_noinst_SCRIPTS); do \
if grep "original $$f --" "$(DESTDIR)$(bindir)/$$f" >/dev/null 2>&1; then \
- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
else :; fi; \
done
endif !WIN32
@for f in $(dist_noinst_DATA); do \
if grep "original $$f --" "$(DESTDIR)$(web2cdir)/$$f" >/dev/null 2>&1; then \
- echo " rm -f '$(DESTDIR)$(web2cdir)/$$f'"; \
+ echo " rm -f '$(DESTDIR)$(web2cdir)/$$f'"; \
rm -f "$(DESTDIR)$(web2cdir)/$$f"; \
else :; fi; \
done
diff --git a/Build/source/texk/kpathsea/Makefile.in b/Build/source/texk/kpathsea/Makefile.in
index 593a35278d5..36beec2bd64 100644
--- a/Build/source/texk/kpathsea/Makefile.in
+++ b/Build/source/texk/kpathsea/Makefile.in
@@ -2497,13 +2497,13 @@ install-data-local: installdirs-am
uninstall-local:
@WIN32_FALSE@ @for f in $(dist_noinst_SCRIPTS); do \
@WIN32_FALSE@ if grep "original $$f --" "$(DESTDIR)$(bindir)/$$f" >/dev/null 2>&1; then \
-@WIN32_FALSE@ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+@WIN32_FALSE@ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
@WIN32_FALSE@ rm -f "$(DESTDIR)$(bindir)/$$f"; \
@WIN32_FALSE@ else :; fi; \
@WIN32_FALSE@ done
@for f in $(dist_noinst_DATA); do \
if grep "original $$f --" "$(DESTDIR)$(web2cdir)/$$f" >/dev/null 2>&1; then \
- echo " rm -f '$(DESTDIR)$(web2cdir)/$$f'"; \
+ echo " rm -f '$(DESTDIR)$(web2cdir)/$$f'"; \
rm -f "$(DESTDIR)$(web2cdir)/$$f"; \
else :; fi; \
done
diff --git a/Build/source/texk/kpathsea/knj.h b/Build/source/texk/kpathsea/knj.h
index 5387533de1a..d373a55408d 100644
--- a/Build/source/texk/kpathsea/knj.h
+++ b/Build/source/texk/kpathsea/knj.h
@@ -46,6 +46,7 @@ extern KPSEDLL wchar_t *kpathsea_get_wstring_from_fsyscp(kpathsea kpse, const ch
#if defined (KPSE_COMPAT_API)
#define is_cp932_system kpse_def->Is_cp932_system
#define file_system_codepage kpse_def->File_system_codepage
+#define win32_codepage kpse_def->Win32_codepage
extern KPSEDLL int isknj(int c);
extern KPSEDLL int isknj2(int c);
diff --git a/Build/source/texk/kpathsea/kpsewhich.c b/Build/source/texk/kpathsea/kpsewhich.c
index 0cacaba5d96..40acd31e904 100644
--- a/Build/source/texk/kpathsea/kpsewhich.c
+++ b/Build/source/texk/kpathsea/kpsewhich.c
@@ -773,6 +773,7 @@ main (int argc, string *argv)
#ifdef WIN32
if(strstr(kpse->program_name,"xetex") || strstr(kpse->program_name,"xelatex")
|| strstr(kpse->program_name,"uptex") || strstr(kpse->program_name,"uplatex")
+ || strstr(kpse->program_name,"pdftex") || strstr(kpse->program_name,"pdflatex")
|| strstr(kpse->program_name,"dvipdfm") || strstr(kpse->program_name,"extractbb")
|| strstr(kpse->program_name,"xbb") || strstr(kpse->program_name,"ebb")
|| strstr(kpse->program_name,"dvips") || strstr(kpse->program_name,"upmendex"))
diff --git a/Build/source/texk/kpathsea/progname.c b/Build/source/texk/kpathsea/progname.c
index 564aab1113a..54563f136ba 100644
--- a/Build/source/texk/kpathsea/progname.c
+++ b/Build/source/texk/kpathsea/progname.c
@@ -496,7 +496,7 @@ kpathsea_set_program_name (kpathsea kpse, const_string argv0,
#if defined(WIN32)
if (!kpse->File_system_codepage)
kpse->File_system_codepage = AreFileApisANSI() ? GetACP() : GetOEMCP();
- cp = kpse->File_system_codepage;
+ cp = kpse->Win32_codepage = kpse->File_system_codepage;
if (cp == 932 || cp == 936 || cp == 950) {
kpse->Is_cp932_system = cp;
}
diff --git a/Build/source/texk/kpathsea/types.h b/Build/source/texk/kpathsea/types.h
index 081202a2f63..b2c15a1fdd1 100644
--- a/Build/source/texk/kpathsea/types.h
+++ b/Build/source/texk/kpathsea/types.h
@@ -294,7 +294,7 @@ typedef struct kpathsea_instance {
#endif /* WIN32 && !__MINGW32__ */
#if defined(WIN32)
int Is_cp932_system;
- int File_system_codepage;
+ int File_system_codepage, Win32_codepage;
int getc_len;
int getc_buff[4];
wchar_t wcbuf;
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index aec693cacc5..e0949c96cf7 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-10 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * texmfmp.c: Allow non-ascii file names for pdfTeX
+ with UTF-8 source files (w32 only).
+
2018-06-09 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
* texmfmp.c, openclose.c: Support UTF-8 file names
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index 3b5b81a3593..4f0da681dc4 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -674,7 +674,7 @@ void
maininit (int ac, string *av)
{
string main_input_file;
-#if (IS_upTeX || defined(XeTeX)) && defined(WIN32)
+#if (IS_upTeX || defined(XeTeX) || defined(pdfTeX)) && defined(WIN32)
string enc;
#endif
/* Save to pass along to topenin. */
@@ -703,10 +703,10 @@ maininit (int ac, string *av)
kpse_set_program_name (argv[0], NULL);
initkanji ();
#endif
-#if defined(XeTeX) && defined(WIN32)
+#if (defined(XeTeX) || defined(pdfTeX)) && defined(WIN32)
kpse_set_program_name (argv[0], NULL);
#endif
-#if (IS_upTeX || defined(XeTeX)) && defined(WIN32)
+#if (IS_upTeX || defined(XeTeX) || defined(pdfTeX)) && defined(WIN32)
enc = kpse_var_value("command_line_encoding");
get_command_line_args_utf8(enc, &argc, &argv);
#endif
@@ -717,7 +717,7 @@ maininit (int ac, string *av)
/* If the user says --help or --version, we need to notice early. And
since we want the --ini option, have to do it before getting into
the web (which would read the base file, etc.). */
-#if ((IS_upTeX || defined(XeTeX)) && defined(WIN32)) || (IS_pTeX && !IS_upTeX && !defined(WIN32))
+#if ((IS_upTeX || defined(XeTeX) || defined(pdfTeX)) && defined(WIN32)) || (IS_pTeX && !IS_upTeX && !defined(WIN32))
parse_options (argc, argv);
#else
parse_options (ac, av);
@@ -741,7 +741,7 @@ maininit (int ac, string *av)
/* Do this early so we can inspect kpse_invocation_name and
kpse_program_name below, and because we have to do this before
any path searching. */
-#if IS_pTeX || (defined(XeTeX) && defined(WIN32))
+#if IS_pTeX || ((defined(XeTeX) || defined(pdfTeX)) && defined(WIN32))
if (user_progname)
kpse_reset_program_name (user_progname);
#else
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog
index e65b1d8a6b9..d276de6c4d5 100644
--- a/Build/source/texk/web2c/pdftexdir/ChangeLog
+++ b/Build/source/texk/web2c/pdftexdir/ChangeLog
@@ -1,3 +1,10 @@
+2018-06-10 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * ptexlib.h, pdftoepdf.cc, pdftoepdf-newpoppler.cc:
+ Allow non-ascii file names for pdfTeX with UTF-8 source files
+ (w32 only). The function is enabled by setting
+ 'command_line_encoding=utf-8' in texmf.cnf.
+
2018-05-29 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* ptexlib.h: Discard the changes on 2018-05-11, since
diff --git a/Build/source/texk/web2c/pdftexdir/pdftoepdf-newpoppler.cc b/Build/source/texk/web2c/pdftexdir/pdftoepdf-newpoppler.cc
index 750579d6135..77f537810a6 100644
--- a/Build/source/texk/web2c/pdftexdir/pdftoepdf-newpoppler.cc
+++ b/Build/source/texk/web2c/pdftexdir/pdftoepdf-newpoppler.cc
@@ -147,6 +147,15 @@ static XRef *xref = 0;
static PdfDocument *find_add_document(char *file_name)
{
PdfDocument *p = pdfDocuments;
+#ifdef _WIN32
+ wchar_t *fnamew;
+ if (file_system_codepage == CP_UTF8 && win32_codepage != CP_UTF8) {
+ fnamew = get_wstring_from_mbstring(CP_UTF8, file_name, fnamew=NULL);
+ xfree(file_name);
+ file_name = get_mbstring_from_wstring(win32_codepage, fnamew, file_name=NULL);
+ xfree(fnamew);
+ }
+#endif
while (p && strcmp(p->file_name, file_name) != 0)
p = p->next;
if (p) {
diff --git a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc
index 4db0c90a639..747c6838c00 100644
--- a/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc
+++ b/Build/source/texk/web2c/pdftexdir/pdftoepdf.cc
@@ -166,6 +166,15 @@ static XRef *xref = 0;
static PdfDocument *find_add_document(char *file_name)
{
PdfDocument *p = pdfDocuments;
+#ifdef _WIN32
+ wchar_t *fnamew;
+ if (file_system_codepage == CP_UTF8 && win32_codepage != CP_UTF8) {
+ fnamew = get_wstring_from_mbstring(CP_UTF8, file_name, fnamew=NULL);
+ xfree(file_name);
+ file_name = get_mbstring_from_wstring(win32_codepage, fnamew, file_name=NULL);
+ xfree(fnamew);
+ }
+#endif
while (p && strcmp(p->file_name, file_name) != 0)
p = p->next;
if (p) {
diff --git a/Build/source/texk/web2c/pdftexdir/ptexlib.h b/Build/source/texk/web2c/pdftexdir/ptexlib.h
index dc3403f7677..c43c8728f9b 100644
--- a/Build/source/texk/web2c/pdftexdir/ptexlib.h
+++ b/Build/source/texk/web2c/pdftexdir/ptexlib.h
@@ -20,6 +20,13 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef PDFTEXLIB
# define PDFTEXLIB
+#ifdef _WIN32
+#undef fopen
+#undef xfopen
+#define fopen fsyscp_fopen
+#define xfopen fsyscp_xfopen
+#endif
+
/* WEB2C macros and prototypes */
# if !defined(PDFTEXCOERCE) && !defined(PDFETEXCOERCE)
# ifdef pdfTeX
diff --git a/Build/source/texk/web2c/synctexdir/ChangeLog b/Build/source/texk/web2c/synctexdir/ChangeLog
index dc8a2bb219c..6ee95359a19 100644
--- a/Build/source/texk/web2c/synctexdir/ChangeLog
+++ b/Build/source/texk/web2c/synctexdir/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-10 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * synctex.c: Allow non-ascii file names for pdfTeX
+ with UTF-8 source files (w32 only).
+
2018-05-29 Akira Kakuto <kakuto@fuk.kindai.ac.jp>
* synctex.c: Discard the changes on 2018-05-11, since
diff --git a/Build/source/texk/web2c/synctexdir/synctex.c b/Build/source/texk/web2c/synctexdir/synctex.c
index 66397d164ae..0c48281a823 100644
--- a/Build/source/texk/web2c/synctexdir/synctex.c
+++ b/Build/source/texk/web2c/synctexdir/synctex.c
@@ -292,7 +292,7 @@ mem[NODE+TYPE##_node_size-synchronization_field_size+1].cint
# define SYNCTEX_OFFSET_IS_PDF 0
# endif
-#if defined(_WIN32) && (defined(upTeX) || defined(eupTeX) || defined(XeTeX))
+#if defined(_WIN32) && (defined(pdfTeX) || defined(upTeX) || defined(eupTeX) || defined(XeTeX))
#define W32UPTEXSYNCTEX 1
#include <wchar.h>
static char *chgto_oem(char *src);