w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

utf8tooct.c
Go to the documentation of this file.
1 /*
2 change UTF-8 string in lsotfea.c into octal expression,
3 since Visual Studio 2010 cannot compile general UTF-8 strings.
4 ./utf8tooct.exe <lsotfea.c.original >lsotfea.c
5 Check by diff that the generated lsotfea.c does not break anything in
6 the original source.
7 */
8 
9 #include <stdio.h>
10 #include <string.h>
11 #include <fcntl.h>
12 #include <io.h>
13 int main(void)
14 {
15  int n;
16  _setmode(_fileno(stdin), _O_BINARY);
17  _setmode(_fileno(stdout), _O_BINARY);
18  while ((n = getc(stdin)) != EOF) {
19  if (n & 0x80) {
20  printf("\\%03o", n);
21  } else {
22  putc(n, stdout);
23  }
24  }
25  return 0;
26 }
#define n
Definition: t4ht.c:1290
int printf()
#define putc
Definition: jbib.h:20
#define EOF
Definition: afmparse.c:59
#define getc
Definition: line.c:39
#define _O_BINARY
Definition: lfs.c:127
int main(void)
Definition: utf8tooct.c:13