1#!/usr/bin/env python 2# This Python file uses the following encoding: utf-8 3# 4# 5# Copyright 2014, NICTA 6# 7# This software may be distributed and modified according to the terms of 8# the BSD 2-Clause license. Note that NO WARRANTY is provided. 9# See "LICENSE_BSD2.txt" for details. 10# 11# @TAG(NICTA_BSD) 12# 13# 14# unicode.py 15# 16# Author: Andrew Boyton, NICTA 17# Based on code by Timothy Bourke, NICTA 18# 19 20from __future__ import print_function 21import os, sys 22 23# Make isasymbols importable. 24sys.path.append(os.path.join(os.path.dirname(__file__), '../pysymbols')) 25import isasymbols 26 27translator = isasymbols.make_translator(os.path.join(os.path.dirname(__file__), 28 '../../isabelle/etc/symbols')) 29 30if len(sys.argv) > 1: 31 f = open(sys.argv[1], 'r') 32else: 33 f = sys.stdin 34 35data = f.read().decode('utf-8') 36print(translator.decode(data), end='') 37