I saved code as UTF-8 (IntellJ IDEA setting.).
and I wrote the code. but, multi-byte code does not show correctly
val msg = "こんにちは世界"
call.respondText(msg, ContentType.Text.Html)
@shinriyo content type need to have encoding specified. It's not about ktor but general requirement: charset attribute need to be specified otherwise the default encoding will be applied.
call.respondText(msg, ContentType.Text.Html.withCharset(Charsets.UTF_8))
@cy6erGn0m Thank you very much! It works!
I still think we need to default all text/* content types to UTF8, plus JSON
Fixed for any content being sent with respondText and respondWrite and not specifying any encoding.
Most helpful comment
I still think we need to default all
text/*content types to UTF8, plus JSON