I got the impression from the code that this runs pretty deep into the FB classes - I'm assuming that the web side is passing a utf8 string?  The wchar_t stuff is also pretty platform specific (e.g. doesn't behave in the same way cross platform) so it feels safer to keep it in here.