From 7c04b86492fe0cfab90dc56869f95f032da28cb0 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Thu, 23 Mar 2023 02:21:32 +0100 Subject: [PATCH] build: remove iconv wrapper for macOS (#992) --- tools/build/configure.py | 9 ++------- tools/iconv.py | 23 ----------------------- 2 files changed, 2 insertions(+), 30 deletions(-) delete mode 100755 tools/iconv.py diff --git a/tools/build/configure.py b/tools/build/configure.py index 3c0992497b..1e77beaa09 100755 --- a/tools/build/configure.py +++ b/tools/build/configure.py @@ -29,12 +29,7 @@ def exec_shell(command: List[str]) -> str: def write_ninja_rules(ninja: ninja_syntax.Writer, cpp: str, extra_cppflags: str, extra_cflags: str, use_ccache: bool, shift: bool, debug: bool): # platform-specific - if sys.platform == "darwin": - iconv = "tools/iconv.py UTF-8 $encoding" - elif sys.platform == "linux": - iconv = "iconv --from UTF-8 --to $encoding" - else: - raise Exception(f"unsupported platform {sys.platform}") + iconv = "iconv --from UTF-8 --to $encoding" ccache = "" @@ -418,7 +413,7 @@ class Configure: task = "cc_272" cflags = cflags.replace("gcc_272", "") - encoding = "SHIFT-JIS" + encoding = "CP932" # similar to SHIFT-JIS, but includes backslash and tilde if version == "ique": encoding = "EUC-JP" diff --git a/tools/iconv.py b/tools/iconv.py deleted file mode 100755 index 9575a57043..0000000000 --- a/tools/iconv.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/python3 - -import argparse -import sys - -parser = argparse.ArgumentParser(description='Convert a file from one encoding to another') -parser.add_argument("f") -parser.add_argument("t") -parser.add_argument('infile', nargs='?', type=argparse.FileType('r'), default=sys.stdin) -parser.add_argument('outfile', nargs='?', type=argparse.FileType('w'), default=sys.stdout) - -args = parser.parse_args() - - -def main(args): - sys.stdin.reconfigure(encoding=args.f) - in_data = args.infile.read() - sys.stdout.reconfigure(encoding=args.t) - args.outfile.write(in_data) - - -if __name__ == "__main__": - main(parser.parse_args())