how to add win 1251 support to ktor http client?
# ktor
g
how to add win 1251 support to ktor http client?
b
It's native to the JVM but nio knows it as windows-1251 https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html
g
so what should I do to get the response?
b
Do you have control of the server at all? It should probably return the proper charset name as
windows-1251
and it should just work without any changes to the ktor client
g
sorry, I don’t have access to server. Can I omit the encoding or force to use my charset on the client?
c
It looks like your server is sending
wincp-1251
so client is unable to process it
I have no idea why is it named so strange
So the only solution is to receive response as byte array and decode it manually
👍 1
Unless your have access to the server of course