force encoding to utf8

alfred-data
Nils Schneider 2012-06-15 18:27:51 +02:00
parent c6e1cf2acd
commit 4a02fe2899
1 changed files with 9 additions and 0 deletions

View File

@ -11,6 +11,15 @@ import argparse
from nodedb import NodeDB from nodedb import NodeDB
from d3mapbuilder import D3MapBuilder from d3mapbuilder import D3MapBuilder
# Force encoding to UTF-8
import locale # Ensures that subsequent open()s
locale.getpreferredencoding = lambda: 'UTF-8' # are UTF-8 encoded.
import sys
sys.stdin = open('/dev/stdin', 'r')
sys.stdout = open('/dev/stdout', 'w')
sys.stderr = open('/dev/stderr', 'w')
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('-a', '--aliases', parser.add_argument('-a', '--aliases',