Handle ill formed locale for script code