JavaScript  encoding