Giter VIP home page Giter VIP logo

Comments (8)

cryogenix avatar cryogenix commented on August 14, 2024

there is an optional second parameter for generate() to accept custom charsets. see here:
https://github.com/IgnitedDatatables/Ignited-Datatables/wiki/Function-Reference#this-datatables-generateoutput-charset

from ignited-datatables.

yahyaerturan avatar yahyaerturan commented on August 14, 2024

Sure, default is utf-8 and I generate it utf-8. It is stored in db table as utf-8 all. That's why I am stacked and don't know how to fix it.

echo $this->datatables->generate('json','utf-8');

I think, the problem is how it posts. For example if I type 'ş', error must be query must be LIKE '%ş%', not 'LIKE '%Ä°%'.

from ignited-datatables.

cryogenix avatar cryogenix commented on August 14, 2024

use ISO-8859-1

from ignited-datatables.

yahyaerturan avatar yahyaerturan commented on August 14, 2024

cryogenix, it makes no different. Forcing to use something is not quite a solution indeed. when using dataTables without Ignited-Tables, it works. So problem is handling POST data.

from ignited-datatables.

n1crack avatar n1crack commented on August 14, 2024

Yahya Bey merhaba,
html encode olarak utf-8 kullandığını kontrol edebilir misiniz? Ajax ile bilgi göndermek istediğinde, html gönderdiğin değerleri utf-8 olarak yorumlamıyor olabilir. Karşılayan ajax sayfası da sonuçta farklı bir karakter görerek onu sorgulatıyordur.

Saygılarımla,
Regards.

from ignited-datatables.

yahyaerturan avatar yahyaerturan commented on August 14, 2024

n1Crack, yanıt için teşekkürler..
Öncelikle tüm sayfalar UTF-8(without BOM) ve Unix style EOL.
.htaccess'te AddDefaultCharset UTF-8
index.php'de ini_set('default_charset','utf-8');
Ajax tarafında contentType form..., utf-8
Ajax'ın çağrıldığı sayfada meta charset utf-8
ancak $this->input->post('sSearch') değişik geliyor. utf8_decode yaptığımda da '?'ne dönüyor, sanırım özünde gelen data utf-8 ama saçımızı beyazlatıyor..

from ignited-datatables.

yahyaerturan avatar yahyaerturan commented on August 14, 2024

Yusuf Bey, merhaba,
Post datasının utf-8 döndüğünü, sSearch datasını utf8 ile kodlanmış bir dosyaya yazdırarak teyit ettim.
Aynı şekilde sorgu kısmını da onayladım.

$this->writelog($this->ci->db->last_query());
if($output == 'json')
{ ...

Problem biraz daha mysql tarafında olmalı. Çünkü türkçe karakter ile arama yaptığınız zaman son çalışan sorgu yenilenmiyor. Yani bu yazının başlığına dönüp orada takılıyoruz.

get_filtering()

if($sWhere != '')
        $this->ci->db->where('(' . $sWhere . ' ) COLLATE utf8_bin ');
        // ya da         $this->ci->db->where('(' . $sWhere . ' COLLATE utf8_bin ) ');

da bir değişiklik yaratmadı. "Illegal mix of collations for operation 'like'" kısmında yatıyor çözüm.

Veritabanını da iki kez kontrol ettim, tüm tablolar ve text alanlarında utf8 collate var, tablo charset'leri de utf8.

Umarım yardımı olur.

from ignited-datatables.

yahyaerturan avatar yahyaerturan commented on August 14, 2024

http://stackoverflow.com/questions/15535674/mysql-query-issue-illegal-mix-of-collations-for-operation-like?rq=1

Yukarıdaki sorunun id ve datetime alanları olduğuna dair yazı. Benim örneğime uyarlayarak test ettim, sonuç id alanları problem yaratmıyor, ancak DATETIME alanı eklendiği anda "illegal collation" uyarısı çıkıyor. Sanıyorum işin Ignited-Datatables ile bir ilgisi yok, dolayısıyla teşekkür ediyor ve konuyu kapatıyorum.

from ignited-datatables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.