build: remove iconv wrapper for macOS (#992)

This commit is contained in:
Marijn van der Werf 2023-03-23 02:21:32 +01:00 committed by GitHub
parent 4f723327d8
commit 7c04b86492
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 30 deletions

View File

@ -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}")
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"

View File

@ -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())