Back to index

moin  1.9.0~rc2
Functions
MoinMoin.i18n.tools.recode Namespace Reference

Functions

def error
def run

Function Documentation

Definition at line 38 of file recode.py.

00038 
00039 def error(msg):
00040     sys.stderr.write(msg + '\n')

Here is the caller graph for this function:

Definition at line 41 of file recode.py.

00041 
00042 def run():
00043     try:
00044         cmd, src_enc, dst_enc = sys.argv
00045 
00046         for line in sys.stdin:
00047             line = unicode(line, src_enc).encode(dst_enc)
00048             sys.stdout.write(line)
00049 
00050     except UnicodeError, err:
00051         error("Can't recode: %s" % str(err))
00052     except LookupError, err:
00053         error(str(err))
00054     except ValueError:
00055         error("Wrong number of arguments")
00056         error(__doc__)
00057 

Here is the call graph for this function: