Fix Issue 8877 - std.encoding.transcode is extremely slow

Some changes which makes std.encoding.transcode approximately 12 times faster