write

suspend fun ByteWriteChannel.write(string: String, charset: Charset = Charsets.UTF_8)

Deprecated (with error)

This is going to be removed or renamed.

Replace with

import io.ktor.utils.io.writeFully
writeFully(string.toByteArray(charset))

Write a string in the specified charset