Skip to content

Comment on HN: Name a problem, any problem, you'd like to see someone solve

Comments

A way to automatically change double byte romaji characters to single byte

Try this in Python?

    import codecs
    
    fin = codecs.open('input.txt', 'rb', 'shift-jis')
    fout = codecs.open('output.txt', 'wb', 'utf-8')
    
    try:
        fout.write(fin.read())
    except ValueError:
        print "Not encoded using Shift-JIS!"
Not sure if that's what you mean - feel free to clarify, if not.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.