Force convert to UTF-8

Not sure if this is the best/most efficient method and haven't really check the impact, but what do you think about this?
I keep running into edge cases when dealing with debugging non-utf8 data, this would make sure that all strings are utf8, or converted to utf-8 (with non-utf8 characters replaced)
Otherwise json_encode will throw an exception..