JASON error in Server-side processing when Korean typed in sSearch

JASON error in Server-side processing when Korean typed in sSearch

SwannSwann Posts: 5Questions: 0Answers: 0
edited July 2013 in DataTables 1.8
I got the following error alert message:
"JASON data could not be parsed.... "

only when I type a Korean keyword in filter input box.
English has NO PROBLEM. why only Korean? :( I guess it is caused by character since Jason accepts only utf-8.
I checked everything .. file encoding, mysql server character set..etc.

Any advice would be really appreciated. I spent all night for this. giving me headache.

Chae from Seoul Korea

Replies

  • allanallan Posts: 61,433Questions: 1Answers: 10,049 Site admin
    What is the return from the server?

    Allan
  • SwannSwann Posts: 5Questions: 0Answers: 0
    It returns nothing but alert message.
    If I use it client-side process. Filter works well with Korean and even Chinese.

    One funny thing is ... initializing the datatables works fine with Korean Language.

    thanks,
  • allanallan Posts: 61,433Questions: 1Answers: 10,049 Site admin
    What does the server return. Its returning non-valid JSON, so we need to know what that is. You can use the DataTables debugger or Firebug / Inspector etc to find out.

    Allan
  • SwannSwann Posts: 5Questions: 0Answers: 0
    http://debug.datatables.net/ayelit

    This is the result of DataTables debugger. I can't see any problem with this. :(
  • allanallan Posts: 61,433Questions: 1Answers: 10,049 Site admin
    Reply from the server:

    [quote]
    Illegal mix of collations
    for operation 'like'
    [/quote]

    That's not valid JSON as the error says :-). Not sure what would be triggering that error in your script, but that's what the problem is.

    Allan
  • SwannSwann Posts: 5Questions: 0Answers: 0
    I've installed the same source code on another system (apache, php, mysql) and tested it.
    It works fine with Korean characters that makes me more crazy and confused. :(
    So I tried to have exactly the same configurations as the testing system for mysql character set, default charset of php.ini, and even system locale... But it doesn't work on my actual system.
    Did I miss something??

    The debugging report of the system on which datatables filter works with Korean characters.
    http://debug.datatables.net/eriwul

    Please give me any advice. If I solve this weird problem... I can't help loving Datatables.

    Chae from Seoul Korea.
  • allanallan Posts: 61,433Questions: 1Answers: 10,049 Site admin
    HI Chae,

    I'm afraid I don't know what would cause the error condition that you are seeing above. Very likely a character set conversion issue. I'd start by making sure that everything (javascript, HTML page, database, php / db link etc etc) is all in UTF8.

    Allan
  • SwannSwann Posts: 5Questions: 0Answers: 0
    Dear allan,

    I've solved my problem. It's caused by mysql bug or not bug.. Not sure yet. Anyways,

    My code to fetch data from mysql includes registration date in datetime type. datatables filter uses like query like "%Korean character%". This caused the problem. This works fine on my testing system with mysql 5.14 but it doesn't with 5.5x version of mysql and returns an error saying illegal mix of collation bla bla....

    Now I left out the datetime column from datatables search.. and it works fine.
    But I can't say for sure if it's about mysql version or something. I have to keep an eye on it. and if I found something else, I will leave the message here. I have wasted long time for this. alot of catching up to do.
    Hope I will be back with correct answers...

    Allan, thanks again for your support.
    And I love datatables.. :)

    Chae.
  • allanallan Posts: 61,433Questions: 1Answers: 10,049 Site admin
    Hi Chae,

    Thanks for the update. Sounds like a horrible little bug that if they've broken something in the latest releases! Good luck resolving it full.

    Regards,
    Allan
This discussion has been closed.