title: How to Convert Non-English Characters to English Using JavaScript
body: <p>I have a c# function which converts all non-english characters to proper characters for a given text. like as follows</p>
  
  <pre><code>public static string convertString(string phrase)
          {
              int maxLength = 100;
              string str = phrase.ToLower();
              int i = str.IndexOfAny( new char[] { 'ş','ç','ö','ğ','ü','ı'});
              //if any non-english charr exists,replace it with proper char
              if (i &gt; -1)
              {
                  StringBuilder outPut = new StringBuilder(str);
                  outPut.Replace('ö', 'o');
                  outPut.Replace('ç', 'c');
                  outPut.Replace('ş', 's');
                  outPut.Replace('ı', 'i');
                  outPut.Replace('ğ', 'g');
                  outPut.Replace('ü', 'u');
                  str = outPut.ToString();
              }
              // if there are other invalid chars, convert them into blank spaces
              str = Regex.Replace(str, @"[^a-z0-9\s-]", "");
              // convert multiple spaces and hyphens into one space       
              str = Regex.Replace(str, @"[\s-]+", " ").Trim();
              // cut and trim string
              str = str.Substring(0, str.Length &lt;= maxLength ? str.Length : maxLength).Trim();
              // add hyphens
              str = Regex.Replace(str, @"\s", "-");    
              return str;
          }
  </code></pre>
  
  <p>but i should use same function on client side with javascript.
  is it possible to convert above function to js ?</p>