ceylon
ceylon copied to clipboard
cross-platform way to obtain UTF8 bytes
Currently there is no cross-platform way to convert a String to a UTF8 byte stream or array. I've long thought this was a bit silly, since it's an easy-enough operation in both Java and JS. We currently have ceylon.buffer.charset, but that's JVM-only, and carries a bunch of baggage.
I think this is a reasonable thing to add to the language module, but where should it go:
-
Stringitself? -
processorruntime?