Thanks Pravin for posting it.
I feel obliged also to mention glibc/localedata/show-ucs-data.c in this context which does
inline decoding of the ucs2 I believe.
I don't think it is shipped with glibc so one probably has to compile it oneself - so
having a portable python implementation is good.
Jens