[http://www.blogger.com/profile/11874165719204714241 Shlomi N.] said…
Hi,
This is a cool hack!
One can simplify it by not writing to the error log but to some internal log table, in which case you can use a normal stored function, no need for UTF.