1

I made a register page in my site which sends to preview page before inserting the data to the database.

The problem is that it converts hebrew to gibberish (it works well with english). What can I do? This is the function I use to pass the strings:

function getParams() {
  var idx = document.URL.indexOf('?');
  var params = new Array();
  if (idx != -1) {
    var pairs = document.URL.substring(idx + 1, document.URL.length).split('&');
    for (var i = 0; i < pairs.length; i++) {
      nameVal = pairs[i].split('=');
      params[nameVal[0]] = nameVal[1];
    }
  }
  return params;
}
Doug
  • 3,312
  • 1
  • 24
  • 31
Yuval Simon
  • 335
  • 1
  • 10
  • 1
    This may help http://stackoverflow.com/questions/7873290/hebrew-text-in-html-files – Pooshonk Jul 30 '13 at 10:25
  • 3
    What do you mean by gibberish? Did you try applying [decodeURIComponent()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent) to the query parameters after extracting them? – Frédéric Hamidi Jul 30 '13 at 10:25
  • It doesn't help. I know there is something called hash code which is consists of numbers. Do you know how can I convert the string to hashcode and in the next page convert the hash code to string? – Yuval Simon Jul 30 '13 at 13:48

0 Answers0