Title: Search Character Problem
Last modified: January 19, 2018

---

# Search Character Problem

 *  Resolved [Metal](https://wordpress.org/support/users/metal/)
 * (@metal)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/search-character-problem/)
 * Hi TobiasBg,
 * Find in the search box write “**i**stanbul” table not found 🙁
 * Find in the search box write “**İ**stanbul”found.
 * İ => i problem..
 * Sample link: [http://www.puantr.com/2017-ayt-lys-hukuk-fakultesi-net-sayilari/](http://www.puantr.com/2017-ayt-lys-hukuk-fakultesi-net-sayilari/)
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsearch-character-problem%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/search-character-problem/#post-9882038)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * I see what you mean, but unfortunately, there’s nothing that I can do here 🙁
   This is how JavaScript treats the different characters 🙁
 * Regards,
    Tobias
 *  Thread Starter [Metal](https://wordpress.org/support/users/metal/)
 * (@metal)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/search-character-problem/#post-9882104)
 * **Solution method:** _fnEscapeRegex function replace:
 * “function _fnEscapeRegex ( sVal ) {
    var letters = { “İ”: “[İi]”, “I”: “[Iı]”,“
   Ş”: “[Şş]”, “Ğ”: “[Ğğ]”, “Ü”: “[Üü]”, “Ö”: “[Öö]”, “Ç”: “[Çç]”, “i”: “[İi]”, “
   ı”: “[Iı]”, “ş”: “[Şş]”, “ğ”: “[Ğğ]”, “ü”: “[Üü]”, “ö”: “[Öö]”, “ç”: “[Çç]” };
   var acEscape = [ ‘/’, ‘.’, ‘*’, ‘+’, ‘?’, ‘|’, ‘(‘, ‘)’, ‘[‘, ‘]’, ‘{‘, ‘}’, ‘\\’,‘
   $’, ‘^’, ‘-‘ ]; var reReplace = new RegExp( ‘(\\’ + acEscape.join(‘|\\’) + ‘)’,‘
   g’ ); sVal=sVal.replace(reReplace, ‘\\$1’); return sVal.replace(/(([İIŞĞÜÇÖiışğüçö]))/
   g, function (letter) { return letters[letter]; }); }”
 * **it did not work. Do you have any idea on this?**
    -  This reply was modified 8 years, 3 months ago by [Metal](https://wordpress.org/support/users/metal/).
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/search-character-problem/#post-9882897)
 * Hi,
 * interesting approach. What did you do with this function and where did you find
   the information for it?
 * Regards,
    Tobias
 *  Thread Starter [Metal](https://wordpress.org/support/users/metal/)
 * (@metal)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/search-character-problem/#post-9883220)
 * /plugins/tablepress/js/jquery.datatables.min.js => _fnEscapeRegex replace it 
   did not work 🙂
 * Method: [http://www.bugraguney.com.tr/blog/jquery-js/jquery-datatables-turkce-karakter-sorun-cozumu/](http://www.bugraguney.com.tr/blog/jquery-js/jquery-datatables-turkce-karakter-sorun-cozumu/)
 *  Thread Starter [Metal](https://wordpress.org/support/users/metal/)
 * (@metal)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/search-character-problem/#post-9883806)
 * **This code is working: **
    “String.prototype.turkishToUpper = function(){ var
   string = this; var letters = { “i”: “İ”, “ş”: “Ş”, “ğ”: “Ğ”, “ü”: “Ü”, “ö”: “
   Ö”, “ç”: “Ç”, “ı”: “I” }; string = string.replace(/(([iışğüçö]))/g, function(
   letter){ return letters[letter]; }) return string.toUpperCase(); ”
 * Demo: [https://yokatlas.yok.gov.tr/tercih-sihirbazi-t3-tablo.php?p=ygs1](https://yokatlas.yok.gov.tr/tercih-sihirbazi-t3-tablo.php?p=ygs1)
 * “İstanbul” and “istanbul” found.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/search-character-problem/#post-9885432)
 * Hi,
 * thanks for sharing this! This certainly looks interesting, but unfortunately,
   I don’t really now how to integrate this into the search. As I’m not the developer
   of the DataTables JS library, I just don’t know the internal details well enough.
   
   Sorry 🙁
 * Regards,
    Tobias
 *  Thread Starter [Metal](https://wordpress.org/support/users/metal/)
 * (@metal)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/search-character-problem/#post-9889270)
 * I understand. I appreciate you for the tablepress I used. I will make a donation
   when I make money from my site. Thanks TobiasBg.
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/search-character-problem/#post-9889315)
 * Hi,
 * no problem, you are very welcome!
 * Best wishes,
    Tobias

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Search Character Problem’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/search-character-problem/#post-9889315)
 * Status: resolved