summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/pdftexdir
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/pdftexdir')
-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
4 files changed, 32 insertions, 0 deletions
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