import sys
import json
import codecs
with codecs.open(sys.argv[1], 'r', 'utf-8') as ifile:
    with codecs.open(sys.argv[2], 'w', 'utf-8') as ofile:
        json.dump(json.load(ifile), ofile, indent=4, ensure_ascii=False)
getting a UnicodeEncodeError when trying to write a JSON file