py2.7 fix for sys.intern
encoding fix for py2.7