Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将 Ceylon 中的字符串编码为 UTF-8 字节?
value string = "my_string"; [Byte*] bytes = string.______;
使用ceylon.buffer.charset.
ceylon.buffer.charset
import ceylon.buffer.charset { utf8 } shared void run() { value string = "my_string"; List<Byte> bytes = utf8.encode(string); Byte[] bytesSequence = bytes.sequence(); // in case a List isn’t enough }
试试看!