I am using the Amazon and eBay API via PHP5 and Curl to get product listings for a client. When I ask the API to give me a description or a category for a product, I'm sometimes getting something that looks like this:
Estée Lauder
When I go look at the XML download from the API, it shows this entry inside:
<categoryName>Estée Lauder</categoryName>
The product in particular was this one.... So as not to give away the affiliate ID, just do t开发者_开发问答his -- query http://ebay.com/ on "ESTEE LAUDER HIGH GLOSS ULTRA BRILLIANCE GLOSS-'Berry'". Then click the link that is named this.
How can I trap for this and properly display this? I am using PHP5.
Use the mb_content_encoding function and convert the string utf-8. You can read more from this http://hu.php.net/manual/en/book.mbstring.php
精彩评论