guess argv encoding in py2 using sys.stdin.encoding
more xrange to range