summaryrefslogtreecommitdiff
path: root/Build/source/texk/ptexenc/ptexenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/ptexenc/ptexenc.c')
-rw-r--r--Build/source/texk/ptexenc/ptexenc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Build/source/texk/ptexenc/ptexenc.c b/Build/source/texk/ptexenc/ptexenc.c
index 92e6b866853..83842ccdaaa 100644
--- a/Build/source/texk/ptexenc/ptexenc.c
+++ b/Build/source/texk/ptexenc/ptexenc.c
@@ -840,6 +840,7 @@ long input_line2(FILE *fp, unsigned char *buff, long pos,
return last;
}
+// set encode of stdin if fp = NULL
boolean setinfileenc(FILE *fp, const char *str)
{
int enc;
@@ -849,6 +850,15 @@ boolean setinfileenc(FILE *fp, const char *str)
return true;
}
+boolean setstdinenc(const char *str)
+{
+ int enc;
+ enc = string_to_enc(str);
+ if (enc < 0) return false;
+ infile_enc[fileno(stdin)] = enc;
+ return true;
+}
+
#ifdef WIN32
void clear_infile_enc(FILE *fp)
{