summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2019-05-02 23:25:34 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2019-05-02 23:25:34 +0000
commit5e38e665a82929a95a9e4f34527daea028f8d45c (patch)
tree336ab7e89b20d34abbc168f55679eda5c4c97a1e /Build
parent255276b0f5ede7ae938255567c712e0d7de9f3da (diff)
support file names always in default CP of OS (Windows only)
git-svn-id: svn://tug.org/texlive/trunk@50954 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/dvipsk/ChangeLog6
-rw-r--r--Build/source/texk/dvipsk/dvips.c17
-rw-r--r--Build/source/texk/dvipsk/output.c11
-rw-r--r--Build/source/texk/dvipsk/search.c3
4 files changed, 34 insertions, 3 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog
index c307a6f7d87..afe728cf790 100644
--- a/Build/source/texk/dvipsk/ChangeLog
+++ b/Build/source/texk/dvipsk/ChangeLog
@@ -1,3 +1,9 @@
+2019-05-03 Akira Kakuto <kakuto@w32tex.org>
+
+ * dvips.c, output.c, search.c: Support non-ascii file names
+ in default code page of OS irrespective of values of a
+ variable 'command_line_encoding' (Windows only).
+
2019-04-30 Karl Berry <karl@tug.org>
* dosection.c (dosection): close PostScript string constant
diff --git a/Build/source/texk/dvipsk/dvips.c b/Build/source/texk/dvipsk/dvips.c
index 5c7f6d3dc86..b544de4599f 100644
--- a/Build/source/texk/dvipsk/dvips.c
+++ b/Build/source/texk/dvipsk/dvips.c
@@ -49,8 +49,23 @@ extern char *strtok(); /* some systems don't have this in strings.h */
#endif
#if defined(WIN32) && defined(KPATHSEA)
+FILE *generic_fsyscp_fopen(const char *filename, const char *mode)
+{
+ FILE *f;
+
+ f = fsyscp_fopen (filename, mode);
+
+ if (f == NULL && file_system_codepage != win32_codepage) {
+ int tmpcp = file_system_codepage;
+ file_system_codepage = win32_codepage;
+ f = fsyscp_fopen (filename, mode);
+ file_system_codepage = tmpcp;
+ }
+
+ return f;
+}
#undef fopen
-#define fopen(file, fmode) fsyscp_fopen(file, fmode)
+#define fopen(file, fmode) generic_fsyscp_fopen(file, fmode)
#endif
#ifndef DEFRES
diff --git a/Build/source/texk/dvipsk/output.c b/Build/source/texk/dvipsk/output.c
index 1114ee7faf5..73207e88e75 100644
--- a/Build/source/texk/dvipsk/output.c
+++ b/Build/source/texk/dvipsk/output.c
@@ -20,7 +20,8 @@
#undef fopen
#undef popen
#undef pclose
-#define fopen(file, fmode) fsyscp_fopen(file, fmode)
+extern FILE *generic_fsyscp_fopen(const char *name, const char *mode);
+#define fopen(file, fmode) generic_fsyscp_fopen(file, fmode)
#define popen(pcmd, pmode) fsyscp_popen(pcmd, pmode)
#define pclose(pstream) _pclose(pstream)
#endif
@@ -157,6 +158,14 @@ copyfile_general(const char *s, struct header_list *cur_header)
* or figure files to be installed in the .../ps directory.
*/
f = search(figpath, s, READBIN);
+#if defined(WIN32)
+ if (f == 0 && file_system_codepage != win32_codepage) {
+ int tmpcp = file_system_codepage;
+ file_system_codepage = win32_codepage;
+ f = search(figpath, s, READBIN);
+ file_system_codepage = tmpcp;
+ }
+#endif
if (f == 0)
f = search(headerpath, s, READBIN);
#if defined(VMCMS) || defined (MVSXA)
diff --git a/Build/source/texk/dvipsk/search.c b/Build/source/texk/dvipsk/search.c
index d3f10c60075..c3e6123b79c 100644
--- a/Build/source/texk/dvipsk/search.c
+++ b/Build/source/texk/dvipsk/search.c
@@ -24,7 +24,8 @@
#undef fopen
#undef popen
#undef pclose
-#define fopen(file, fmode) fsyscp_fopen(file, fmode)
+extern FILE *generic_fsyscp_fopen(const char *name, const char *mode);
+#define fopen(file, fmode) generic_fsyscp_fopen(file, fmode)
#define popen(pcmd, pmode) fsyscp_popen(pcmd, pmode)
#define pclose(pstream) _pclose(pstream)
#endif