pub fn from_utf8(str: &str) -> Cow<'_, JavaStr>
Converts a str into a JavaStr. We avoid copying unless necessary. In the case where there are no four-byte encodings, then no allocation will happen.
str
JavaStr