Fixed encoding for js functions