Hi,
What should be the correct behavior of string_to_utf8() in case if source string is not wide-string? Currently it just converts all 8-bit values to UTF-8 representation, which is not (really) Right Thing (tm) - imagine UTF-8 string passed on... It will be scrambled...
Yes, that is the _right_ thing to do.
May be it makes sense to do nothing (return source string) in case if source is 8-bit string?
No
? Or (at least) check that source is valid UTF-8 stream (I wouldn't choose this way, though)?
No.