To properly handle encoding conversions, we need to do it in native code. This new function performs this role. This is useful for hxcpp which may have either ascii or utf16 encoding, but this can only be checked via the native api and it is not possible on the haxe side.