js encoding test