Problem with special characters / Line to long

61 views
Skip to first unread message

ac

unread,
Sep 23, 2008, 5:04:52 PM9/23/08
to AdWords API Forum
I have solved the problem, that I can´t add ÄÖÜäöüß and € directly to
text ads with this:

$string = str_replace('Ä', 'Ä', $string);
$string = str_replace('Ö', 'Ö', $string);
$string = str_replace('Ü', 'Ü', $string);
$string = str_replace('ß', 'ß', $string);
$string = str_replace('ä', 'ä', $string);
$string = str_replace('ö', 'ö', $string);
$string = str_replace('ü', 'ü', $string);
$string = str_replace('€', '&#x20AC', $string);

(I have set nusoap to utf-8 encoding).

This works fine, but now i have not 35 characters in description1
because the euro sign alone takes at least 5 characters.
How can I transmit spezial characters without using linespace?

Jan Piotrowski (AdWords API Guru)

unread,
Sep 23, 2008, 6:00:43 PM9/23/08
to AdWords API Forum
That looks like PHP. Are you using APIlity?

- Jan

ac

unread,
Sep 24, 2008, 6:37:59 AM9/24/08
to AdWords API Forum
No, I just use the templates from google and nusoap as provided on
http://www.google.com/apis/adwords/php.html

In the meantime, I have seen, that umlaute works fine, just the
doublbye euro-sign is
reducing the length of the fields according to the adword guidelines
for doublebyte characters.

Yesterday I found a single byte code € representing the euro-
sign. It shows an"?" in the
sandbox enviroment, but it shall work in real adwords - is that true?

Jan Piotrowski (AdWords API Guru)

unread,
Sep 24, 2008, 10:19:17 AM9/24/08
to AdWords API Forum
APIlity is using exactly this in nusoap.php before sending the content
to the API:

$body = str_replace("€", "€", $body);

So I assume this work in real adwords. But it's strange it doesn't in
the sandbox environment. Perhaps there's something wrong with your
output? Just test it in production environment.

- Jan



On 24 Sep., 12:37, ac <andr...@tigersoft.de> wrote:
> No, I just use the templates from google and nusoap as provided onhttp://www.google.com/apis/adwords/php.html

ac

unread,
Sep 25, 2008, 4:57:57 AM9/25/08
to AdWords API Forum
Sorry, but the problem is not solved, as I thought.

New Test:

12345678901234567890123456789012345 works
ä2345678901234567890123456789012345 works not -> Error: New text ad
was not created due to the following policy violations: Detail: The
line is too wide.

ä23456789012345678901234567890 works
ä234567890123456789012345678901 works not -> Error: New text
ad was not created due to the following policy violations: Detail: The
line is too wide.

€2345678901234567890123456789 works
€23456789012345678901234567890 works not -> Error: New text
ad was not created due to the following policy violations: Detail: The
line is too wide.


Done with $string = str_replace('ä', '&amp;#228;', $string); and
$string = str_replace('€', '&amp;#8364;', $string);

It seems that the code &amp;#228; will decrease the number of allowed
characters to 30, it takes 5.
The euro sign now works fine with 8364, in the sanbox too, but it
takes 6 characters.

I guess that th #228; and #8364; is counted as 5 resp. 6.

How to prevent this?

Jan Piotrowski (AdWords API Guru)

unread,
Sep 25, 2008, 5:03:01 AM9/25/08
to AdWords API Forum
Why are you using '&amp;#8364;' instead of '&#8364;'?

- Jan

ac

unread,
Sep 25, 2008, 6:24:18 AM9/25/08
to AdWords API Forum
Well, this works for Umlaute
äöüÄÖÜß8901234567890123456789012345 -> OK with '&#..' instead of
'&amp;#..'.

But it didn´t work with €.
€2345678901234567890123456789012345
goes to
?2345678901234567890123456789012345

Perhaps it is the limitation of the sandbox. I will try it in real.

Thank You so far.
Reply all
Reply to author
Forward
0 new messages