Encodes c in str's encoding and appends it to str.
UTFException if c is not a valid UTF code point.
char[] s = "abcd".dup; dchar d1 = 'a'; dchar d2 = 'ø'; encode(s, d1); assert(s.length == 5); assert(s == "abcda"); encode(s, d2); assert(s.length == 7); assert(s == "abcdaø");
See Implementation
Encodes c in str's encoding and appends it to str.