Hello!
I'm trying to add some keywords in my AdWords using PHP language. When I 
add some keywords in english it works fine, but in russian it shows me next 
error message:

Notice: Failed to load response into DOM: DOMDocument::loadXML(): Empty 
string supplied as input in /var/www/html/www3.repka.com.ua/sources/repka/
work/adwords/AdWordsApi/source/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php 
on line 268 Notice: Failed to load request into DOM: DOMDocument::loadXML(): 
Empty string supplied as input in /var/www/html/www3.repka.com.ua/sources/
repka/work/adwords/AdWordsApi/source/src/Google/Api/Ads/Common/Lib/
AdsSoapClient.php on line 275 Notice: Failed to load response into DOM: 
DOMDocument::loadXML(): Empty string supplied as input in /var/www/html/www3
.repka.com.ua/sources/repka/work/adwords/AdWordsApi/source/src/Google/Api/
Ads/Common/Lib/AdsSoapClient.php on line 375 Notice: Failed to load 
response into DOM: DOMDocument::loadXML(): Empty string supplied as input in 
/var/www/html/www3.repka.com.ua/sources/repka/work/adwords/AdWordsApi/source
/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php on line 393[SoapFault] 
SOAP-ERROR: Encoding: string '\xd2...' is not a valid utf-8 string (0)
/var/www/html/www3.repka.com.ua/sources/repka/work/adwords/AdWordsApi/source
/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php:232
#0: SoapClient->__soapCall(string, array, NULL, array, array)
 /var/www/html/www3.repka.com.ua/sources/repka/work/adwords/AdWordsApi/
source/src/Google/Api/Ads/Common/Lib/AdsSoapClient.php:232
#1: AdsSoapClient->__soapCall(string, array)
 /var/www/html/www3.repka.com.ua/sources/repka/work/adwords/AdWordsApi/
source/src/Google/Api/Ads/AdWords/v201409/AdGroupCriterionService.php:9936
#2: AdGroupCriterionService->mutate(array)
 /var/www/html/www3.repka.com.ua/sources/repka/work/adwords/index.php:212


Bellow You can see example of my code:

$adGroupId = 1648319****; 
$adGroupId = (float)$adGroupId; 
$user = new AdWordsUser(); 
$user->LogAll();


$word = "Ключевое слово"; // error, but with $word = "Keyword"; it works 
fine

$adGroupCriterionService = $user->GetService('AdGroupCriterionService', 
'v201409');
// Create keyword criterion.
$keyword = new Keyword();
$keyword->text = $word;
$keyword->matchType = 'BROAD';
 
// Create biddable ad group criterion.
$adGroupCriterion = new BiddableAdGroupCriterion();
$adGroupCriterion->adGroupId = $adGroupId;
$adGroupCriterion->criterion = $keyword;
 
// Set additional settings (optional).
$adGroupCriterion->userStatus = 'PAUSED';
$adGroupCriterion->destinationUrl = 
'https://repka.ua/noutbuki/asus-s301lp-s301lp-c1010h-92202/';
 
$adGroupCriteria[] = $adGroupCriterion;
//var_dump($adGroupCriteria);
 
// Create operation.
$operation = new AdGroupCriterionOperation();
$operation->operand = $adGroupCriterion;
$operation->operator = 'ADD';
$operations[] = $operation;
 
 
$result = $adGroupCriterionService->mutate($operations);
 
// Display results.
foreach ($result->value as $adGroupCriterion) {
 printf("Keyword with text '%s', match type '%s', and ID '%s' was added.\n",
 $adGroupCriterion->criterion->text,
 $adGroupCriterion->criterion->matchType,
 $adGroupCriterion->criterion->id);
}


I'm using php file in utf-8 encoding and my $word variable contains utf-8 
string.

Tell me please how can I solve this problem? Thanks!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/122dffc3-d4b7-49c2-b724-a49378401fd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to