I can't insert data into mysql UTF8

  • Profile Image
    mrchairman
    Asked on October 06, 2016 at 01:44 AM

    Hi I have the similar problem when tried to grab the data insert into mysql UTF8

    After

                function stripslashes_deep($value){

    $value = is_array($value) ?

    array_map('stripslashes_deep', $value) :

    stripslashes($value);

    return $value;

     

    //json to php

     

    $result = stripslashes_deep($_REQUEST['rawRequest']);

     

     

    $obj = json_decode($result, true);

     

    I debug the result and found this

    {"slug":"submit/62783803236459/","input_language":"Thai","q20_input20":{"first":"u0e17u0e14u0e2au0e2du0e1au0e1au0e2du0e35u0e01u0e01","last":"u0e2du0e22u0e32u0e01u0e01u0e25u0e2du0e07u0e07"},"q72_input72":"u0e2du0e49u0e19u0e19u0e19","q69_input69":{"area":" 088","phone":"3557777"},"q68_email":"mm@live.com","q73_input73":"u0e17u0e35u0e48u0e2du0e2du0e2du0e2du0e2du0e2du0e2du0e2du0e2du0e2du0e2du0e2d","q7_input7":"35","q11_input11":"189","q10_input10":"67","q37_input37":"u0e2du0e22u0e32u0e01u0e01u0e25u0e14u0e14u0e14u0e14u0e14u0e14u0e14u0e14u0e14u0e14u0e14u0e14u0e14u0e14u0e14","q67_input67":["2 u0e2au0e31u0e1bu0e14u0e32u0e2bu0e4c"],"q71_input71":"lineeidddddddddddd","event_id":"1475726050218_62783803236459_aQKkcBt"}

     

    and after json_decode

    "q72_input72":"u0e2du0e49u0e19u0e19u0e19"

    The $obj still be the same value

    u0e2du0e49u0e19u0e19u0e19

  • Profile Image
    liyam
    Answered on October 06, 2016 at 02:46 AM

    Hello,

    Do you still have the data of the original request data and compare it instead if json_decode or other functions might have altered the data?

    I believe if the obj var still returns the same value means that has become the source text and could not be changed to a different unicode value anymore.

    Or do you mean that this is the only part that does not get changed?

         "q72_input72":"u0e2du0e49u0e19u0e19u0e19"

    Will look forward to your response.

    Thanks.

  • Profile Image
    mrchairman
    Answered on October 06, 2016 at 02:54 AM

    Hello Support 

    thank you for your response I've already found some way after waiting for your response

    I notice that as in your recommend website http://requestb.in/  There is another Key=>Value

    that Key lead to the right encoded strings so I replace

    $result = stripslashes_deep($_REQUEST['rawRequest']); 

    with 

    $result = stripslashes_deep($_REQUEST['pretty']);

    and now the Key "pretty"  work for me!

     

    any way Thank for your support :)

  • Profile Image
    liyam
    Answered on October 06, 2016 at 03:00 AM

    Thanks for letting us know. We're glad you found a way to address the issue. 

    If you have other questions or concerns, please do let us know. 

    Warm regards. :)

  • Profile Image
    mrchairman
    Answered on October 07, 2016 at 02:44 PM
    Urgent! I just know after 1 day some customer told me that they can not access the page tab on facebbook fanpage on mobile and me too Your app link work only on desktop.
    Any idea?

    ...
  • Profile Image
    Jim_R
    Answered on October 07, 2016 at 05:30 PM

    We have moved your most recent question to a separate thread https://www.jotform.com/answers/954777

    We'll have it addressed there shortly.