Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-10210

API 'get' not working with international characters

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.7
    • Component/s: CiviCRM API
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      Using API, 'get' on any entity with parameters that contain international characters does not work.

      As an example, here are the results of creating contact entities with a name, and then doing a get with the same parameters:
      Acme, Inc. : created OK, found OK
      Scarabée : created OK, NOT found afterwards
      Iñtërnâtiônàlizætiøn : created OK, NOT found afterwards
      これは日本語のテキストです。読めますか : created OK, NOT found afterwards
      देखें हिन्दी कैसी नजर आती है। अरे वाह ये तो नजर आती है। : created OK, found OK

      Here is the test program:
      $test_strings = array(
      'English' => 'Acme, Inc.',
      'French' => 'Scarabée',
      'classic' => 'Iñtërnâtiônàlizætiøn',
      'Japanese' => 'これは日本語のテキストです。読めますか',
      'Hindi' => 'देखें हिन्दी कैसी नजर आती है। अरे वाह ये तो नजर आती है।',
      );

      header('Content-Type: text/html; charset=utf-8');
      echo "<head><title>CiviCRM API Iñtërnâtiônàlizætiøn test</title></head><body>";

      foreach ($test_strings as $title => $string) {
      $params = array(
      'version' => 3,
      'contact_type' => 'Organization',
      'organization_name' => $string,
      );
      echo $string . ' :';
      $result = civicrm_api( 'Contact', 'create', $params );
      if (!$result['is_error'])

      { $contact = reset( $result['values'] ); echo ($contact['organization_name']==$string?' created OK':' NOT created right'); }

      else exit(1);
      $result = civicrm_api( 'Contact', 'get', $params );
      echo ($result['count']?', found OK':', NOT found afterwards') . '<br>';
      }
      echo "</body>";

        Attachments

          Activity

            People

            • Assignee:
              erikhommel Erik Hommel
              Reporter:
              nganivet Nicolas Ganivet
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1 hour
                1h
                Remaining:
                Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified