Add parseEncoding function to avoid having to have patched node build.