SSP.CLASS.PHP especial characters problem (solution)

SSP.CLASS.PHP especial characters problem (solution)

zhaker117zhaker117 Posts: 1Questions: 0Answers: 0

HI, i was working with server-side with POST Data and i had a problem with data that contains any especial characters, so you just need add ;charset=UTF8 in the SSP.CLASS.PHP in the line 388:

BEFORE: "mysql:host={$sql_details['host']};dbname={$sql_details['db']}",
AFTER: "mysql:host={$sql_details['host']};dbname={$sql_details['db']};charset=UTF8",

and that's it!

sorry for my bad English

Replies

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Thanks for posting this - I'm sure others will find it useful!

    Allan

  • tharwat96tharwat96 Posts: 1Questions: 0Answers: 0
    edited November 2019

    I just created an account here to thank you @zhaker117.
    THANK YOU! :heart_eyes: :relieved:
    I used this to be able to use Arabic content generated from mysql DB through server.

  • cherckytocherckyto Posts: 1Questions: 0Answers: 0

    you hacked it! good game dude!! B)
    Thanks a lot!

  • jarmoudjarmoud Posts: 1Questions: 0Answers: 0
    edited March 2021

    Thanks a lot !

    To do better I made it as a parameter from the processing file

    "mysql:host={$sql_details['host']};dbname={$sql_details['db']};charset={$sql_details['charset']}"

    In my processing php file :

    $sql_details = array(
    'user' => 'user',
    'pass' => 'password',
    'db' => 'database',
    'host' => 'server:port',
    'charset' => 'utf8'
    );

  • gadibh53gadibh53 Posts: 7Questions: 2Answers: 0

    @zhaker117 - I too have just created an account here, only to thank you.
    My Hebrew characters were showing as '????'.
    Your solution solved my problem.
    Thank you big time!

  • hualteriohualterio Posts: 1Questions: 0Answers: 0

    thanks! Después de mucho tiempo de buscar la solución, edité la base de datos muchisimas veces, pero era tan simple como agregar el charset utf8 a mi conexión de la BD. Muchas gracias! :smiley:

  • Nick HopeNick Hope Posts: 48Questions: 12Answers: 1

    Thank you for this. In my case I was getting a normal AJAX response in my local development environment, but using my remote server I was getting an empty AJAX response. This solved my problem.

    To the moderators: I think it would be very useful if a link to this post could be added as a comment on this (now closed) post, which comes very high in search results for "datatables server side empty ajax response": https://datatables.net/forums/discussion/51592/empty-values-returning-from-ajax-server-side-in-datatables

    Personally a link from there to here would have saved me a few hours.

    I also added an answer to https://stackoverflow.com/questions/51932617/empty-ajax-return-with-server-side-datatables, which is also high in search results for that issue.

    Also, how about adding a commented-out line for UTF-8 purposes in the spp.class.php on github, along with a note after the note at the top about removing the 4 lines?

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Super suggestions - thank you. I've added a few comments into the code and a link to this thread from 51592 as you suggested.

    Good to hear you got it working in the end.

    Allan

Sign In or Register to comment.