O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
Book List Learning Lab PDFs O'Reilly Gear Newsletters Press Room Jobs  



considering special characters/umlauts
how to encode queries with special characters (e.g. umlauts) and decode the results

Contributed by:
Christian Wenz
[04/27/03 | Discuss (0) | Link to this hack]

some special characters in book titles come out bad when not specially taking care of character encoding. Same goes for queries that contain these special characters. Solution: The Amazon API encodes data in UTF-8 format, so queries must be UTF-8-encoded, results must be UTF-8-decoded. Using PHP, this can be done as follows (search term in variable $searchterm, result in $result): $searchterm = utf8_encode($searchterm); $result = utf8_decode($result);


O'Reilly Home | Privacy Policy

© 2007 O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.