summaryrefslogtreecommitdiff
path: root/Build/source/texk/seetexk/dvitodvi.c
diff options
context:
space:
mode:
authorTakuji Tanaka <KXD02663@nifty.ne.jp>2017-06-23 14:52:25 +0000
committerTakuji Tanaka <KXD02663@nifty.ne.jp>2017-06-23 14:52:25 +0000
commit25a27b4b95bc9c08f15b37371d23956f6faf2dd7 (patch)
tree27be5e874331789343aab9fe61759497f89a9f50 /Build/source/texk/seetexk/dvitodvi.c
parent2e769ccbfa30589418166eb6f1c56770765a3762 (diff)
texk/seetexk [Windows]: Allow Unicode file names
git-svn-id: svn://tug.org/texlive/trunk@44674 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/seetexk/dvitodvi.c')
-rw-r--r--Build/source/texk/seetexk/dvitodvi.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/Build/source/texk/seetexk/dvitodvi.c b/Build/source/texk/seetexk/dvitodvi.c
index 91c94d75b58..c643ac95178 100644
--- a/Build/source/texk/seetexk/dvitodvi.c
+++ b/Build/source/texk/seetexk/dvitodvi.c
@@ -35,6 +35,9 @@
#include <kpathsea/config.h>
#include <kpathsea/c-fopen.h>
#include <kpathsea/getopt.h>
+#if defined(WIN32)
+#include <kpathsea/variable.h>
+#endif
#else
#define FOPEN_RBIN_MODE "rb"
#define FOPEN_WBIN_MODE "wb"
@@ -52,11 +55,16 @@ extern int optind;
#include "search.h"
#include <stdio.h>
#include <ctype.h>
+#include "seek.h"
+
+#if defined(WIN32) && defined(KPATHSEA)
+#undef fopen
+#define fopen fsyscp_fopen
+#endif
#define white(x) ((x) == ' ' || (x) == '\t' || (x) == ',')
#define MAXDVIPAGES 1000 /* max (absolute) pages in DVI file */
-#include "seek.h"
char *ProgName;
@@ -621,6 +629,17 @@ main(int argc, char **argv)
register char *s;
char *outname = NULL;
char *specstring = NULL;
+#if defined(WIN32) && defined(KPATHSEA)
+ int ac;
+ char **av, *enc;
+
+ kpse_set_program_name(argv[0], "dvitodvi");
+ enc = kpse_var_value("command_line_encoding");
+ if (get_command_line_args_utf8(enc, &ac, &av)) {
+ argc = ac;
+ argv = av;
+ }
+#endif
Width = 0;
Height = 0;