This bug is now closed and httplib2 now has support for IRIs. The code for doing such a transformation lives in its own file with unit tests in case you want that functionality outside of httplib2. This is currently in trunk and will appear in the next release.

As an aside you will notice the first half of the file is a data structure, the second half is the algorithm, and the third half is the unit tests.

Algorithms + Data Structures = Programs