List Info

Thread: Special character encoding bug in the product names




Special character encoding bug in the product names
user name
2006-08-04 06:06:29
Hi,

For any of you guys that has special characters such as ™
(TradeMark)
or ® (Registered) in your item names or descriptions, be
aware...

Make sure you convert all your names and descriptions to
UTF8, BEFORE
you put them in your cart XML...

One would think that the UTF8 encoding tag in the XML header
would take
care of this, ot at least these characters would be filtered
out /
neglected, right ? NOPE , THEY DO NOT! Instead they blow the
whole
process, producing an error message like this for your users
to view,
blaming it on your company  :

Oops!
<Your company name here> has sent Google a shopping
cart with errors in
it. We'll contact them to ask that they fix this problem.
If you're
feeling lucky, you can go back in your browser and try to
checkout
again with your fingers crossed.


If you have those type of special characters in your names,
you encode
and HMACSHA1 your cart contents, submit them, and get an
error back
from Google, and scratch your head for about 2 hours as I
did...

Here is a filtering function in VB.NET for those who wonders
what to do
to make sure they get filtered out:

Private Function GetUTF8String(ByVal str As String) As
String
        Dim s As Byte() =
System.Text.Encoding.Default.GetBytes(str)
        Return System.Text.Encoding.UTF8.GetString(s)
End Function

I picked one of the few items that has those characters
among a
thousand different items to test it!
What can I say... The unlucky "Bedouin" gets
bitten by a snake on a
camel...

Duray AKAR

PS: "We'll contact them to ask that they fix this
problem."  <- No,
nobody contacted us 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "API Integration Basics" group.
To post to this group, send email to
google-checkout-api-integrationgooglegroups.com
To unsubscribe from this group, send email to
google-checkout-api-integration-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/google-checkout-api
-integration
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )